mirror of
https://github.com/ziglang/zig.git
synced 2024-11-22 04:10:13 +00:00
Merge 9e9b1a97ab
into f845fa04a0
This commit is contained in:
commit
52c180d5e8
@ -168,6 +168,7 @@ pub fn build(b: *std.Build) !void {
|
||||
const tracy = b.option([]const u8, "tracy", "Enable Tracy integration. Supply path to Tracy source");
|
||||
const tracy_callstack = b.option(bool, "tracy-callstack", "Include callstack information with Tracy data. Does nothing if -Dtracy is not provided") orelse (tracy != null);
|
||||
const tracy_allocation = b.option(bool, "tracy-allocation", "Include allocation information with Tracy data. Does nothing if -Dtracy is not provided") orelse (tracy != null);
|
||||
const tracy_callstack_depth: c_int = b.option(c_int, "tracy-callstack-depth", "Declare callstack depth for Tracy data. Does nothing if -Dtracy_callstack is not provided") orelse 10;
|
||||
const force_gpa = b.option(bool, "force-gpa", "Force the compiler to use GeneralPurposeAllocator") orelse false;
|
||||
const link_libc = b.option(bool, "force-link-libc", "Force self-hosted compiler to link libc") orelse (enable_llvm or only_c);
|
||||
const sanitize_thread = b.option(bool, "sanitize-thread", "Enable thread-sanitization") orelse false;
|
||||
@ -350,6 +351,7 @@ pub fn build(b: *std.Build) !void {
|
||||
exe_options.addOption(bool, "enable_tracy", tracy != null);
|
||||
exe_options.addOption(bool, "enable_tracy_callstack", tracy_callstack);
|
||||
exe_options.addOption(bool, "enable_tracy_allocation", tracy_allocation);
|
||||
exe_options.addOption(c_int, "tracy_callstack_depth", tracy_callstack_depth);
|
||||
exe_options.addOption(bool, "value_tracing", value_tracing);
|
||||
if (tracy) |tracy_path| {
|
||||
const client_cpp = b.pathJoin(
|
||||
@ -608,6 +610,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {
|
||||
exe_options.addOption(bool, "enable_tracy", false);
|
||||
exe_options.addOption(bool, "enable_tracy_callstack", false);
|
||||
exe_options.addOption(bool, "enable_tracy_allocation", false);
|
||||
exe_options.addOption(c_int, "tracy_callstack_depth", 0);
|
||||
exe_options.addOption(bool, "value_tracing", false);
|
||||
exe_options.addOption(DevEnv, "dev", .bootstrap);
|
||||
|
||||
|
@ -5,9 +5,7 @@ const build_options = @import("build_options");
|
||||
pub const enable = if (builtin.is_test) false else build_options.enable_tracy;
|
||||
pub const enable_allocation = enable and build_options.enable_tracy_allocation;
|
||||
pub const enable_callstack = enable and build_options.enable_tracy_callstack;
|
||||
|
||||
// TODO: make this configurable
|
||||
const callstack_depth = 10;
|
||||
pub const callstack_depth = if (enable_callstack and build_options.tracy_callstack_depth > 0) build_options.tracy_callstack_depth else 10;
|
||||
|
||||
const ___tracy_c_zone_context = extern struct {
|
||||
id: u32,
|
||||
|
Loading…
Reference in New Issue
Block a user