Skip to content

Commit

Permalink
make tracy a lazy dependency (#1742)
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Sep 16, 2024
1 parent f05b8b3 commit cf9b49a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

6 changes: 4 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ fn getTracyModule(
});
tracy_module.addImport("options", tracy_options.createModule());
if (!options.enable) return tracy_module;
const tracy_dependency = b.lazyDependency("tracy", .{}) orelse return tracy_module;

tracy_module.link_libc = true;
tracy_module.link_libcpp = true;

Expand All @@ -319,9 +321,9 @@ fn getTracyModule(
else
&[_][]const u8{ "-DTRACY_ENABLE=1", "-fno-sanitize=undefined" };

tracy_module.addIncludePath(b.path("src/tracy"));
tracy_module.addIncludePath(tracy_dependency.path(""));
tracy_module.addCSourceFile(.{
.file = b.path("src/tracy/public/TracyClient.cpp"),
.file = tracy_dependency.path("public/TracyClient.cpp"),
.flags = tracy_c_flags,
});

Expand Down
5 changes: 5 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
.url = "https://github.com/zigtools/zig-lsp-codegen/archive/6b34887189def7c859307f4a9fc436bc5f2f04c9.tar.gz",
.hash = "122054fe123b819c1cca154f0f89dd799832a639d432287a2371499bcaf7b9dcb7a0",
},
.tracy = .{
.url = "https://github.com/wolfpld/tracy/archive/refs/tags/v0.11.1.tar.gz",
.hash = "122022a478dccaed1309fb5d022f4041eec45d40c93a855ed24fad970774c2426d91",
.lazy = true,
},
},
.paths = .{""},
}
8 changes: 8 additions & 0 deletions deps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,12 @@ in linkFarm name [
hash = "sha256-Q1Lm0YornfymWeryFdKe0AXsOJxhxHH72U1IcMxiVtA=";
};
}
{
name = "122022a478dccaed1309fb5d022f4041eec45d40c93a855ed24fad970774c2426d91";
path = fetchZigArtifact {
name = "tracy";
url = "https://github.com/wolfpld/tracy/archive/refs/tags/v0.11.1.tar.gz";
hash = "sha256-LBHKgW8rdWvicw+GsAkpIEGfPavHpxc4Kf/Yl9kYiKE=";
};
}
]
1 change: 0 additions & 1 deletion src/tracy
Submodule tracy deleted from f81e08

0 comments on commit cf9b49a

Please sign in to comment.