Skip to content

Commit 0b72965

Browse files
committed
build: update Tracy integration
* Update for v0.9 * Enable the memory and callstack integrations by default
1 parent 7d0dc2f commit 0b72965

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

build.zig

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ pub fn build(b: *Builder) !void {
122122
return;
123123

124124
const tracy = b.option([]const u8, "tracy", "Enable Tracy integration. Supply path to Tracy source");
125-
const tracy_callstack = b.option(bool, "tracy-callstack", "Include callstack information with Tracy data. Does nothing if -Dtracy is not provided") orelse false;
126-
const tracy_allocation = b.option(bool, "tracy-allocation", "Include allocation information with Tracy data. Does nothing if -Dtracy is not provided") orelse false;
125+
const tracy_callstack = b.option(bool, "tracy-callstack", "Include callstack information with Tracy data. Does nothing if -Dtracy is not provided") orelse (tracy != null);
126+
const tracy_allocation = b.option(bool, "tracy-allocation", "Include allocation information with Tracy data. Does nothing if -Dtracy is not provided") orelse (tracy != null);
127127
const force_gpa = b.option(bool, "force-gpa", "Force the compiler to use GeneralPurposeAllocator") orelse false;
128128
const link_libc = b.option(bool, "force-link-libc", "Force self-hosted compiler to link libc") orelse (enable_llvm or only_c);
129129
const sanitize_thread = b.option(bool, "sanitize-thread", "Enable thread-sanitization") orelse false;
@@ -378,7 +378,7 @@ pub fn build(b: *Builder) !void {
378378
if (tracy) |tracy_path| {
379379
const client_cpp = fs.path.join(
380380
b.allocator,
381-
&[_][]const u8{ tracy_path, "TracyClient.cpp" },
381+
&[_][]const u8{ tracy_path, "public", "TracyClient.cpp" },
382382
) catch unreachable;
383383

384384
// On mingw, we need to opt into windows 7+ to get some features required by tracy.
@@ -674,13 +674,12 @@ fn addCxxKnownPath(
674674
exe.addObjectFile(path_unpadded);
675675

676676
// TODO a way to integrate with system c++ include files here
677-
// cc -E -Wp,-v -xc++ /dev/null
677+
// c++ -E -Wp,-v -xc++ /dev/null
678678
if (need_cpp_includes) {
679679
// I used these temporarily for testing something but we obviously need a
680680
// more general purpose solution here.
681-
//exe.addIncludePath("/nix/store/fvf3qjqa5qpcjjkq37pb6ypnk1mzhf5h-gcc-9.3.0/lib/gcc/x86_64-unknown-linux-gnu/9.3.0/../../../../include/c++/9.3.0");
682-
//exe.addIncludePath("/nix/store/fvf3qjqa5qpcjjkq37pb6ypnk1mzhf5h-gcc-9.3.0/lib/gcc/x86_64-unknown-linux-gnu/9.3.0/../../../../include/c++/9.3.0/x86_64-unknown-linux-gnu");
683-
//exe.addIncludePath("/nix/store/fvf3qjqa5qpcjjkq37pb6ypnk1mzhf5h-gcc-9.3.0/lib/gcc/x86_64-unknown-linux-gnu/9.3.0/../../../../include/c++/9.3.0/backward");
681+
//exe.addIncludePath("/nix/store/2lr0fc0ak8rwj0k8n3shcyz1hz63wzma-gcc-11.3.0/include/c++/11.3.0");
682+
//exe.addIncludePath("/nix/store/2lr0fc0ak8rwj0k8n3shcyz1hz63wzma-gcc-11.3.0/include/c++/11.3.0/x86_64-unknown-linux-gnu");
684683
}
685684
}
686685

0 commit comments

Comments
 (0)