only build tracy if enabled

This commit is contained in:
Mitchell Hashimoto
2022-08-17 17:03:38 -07:00
parent 08292e58f3
commit ffa9ddc0d9

View File

@ -8,6 +8,9 @@ const libuv = @import("pkg/libuv/build.zig");
const tracylib = @import("pkg/tracy/build.zig"); const tracylib = @import("pkg/tracy/build.zig");
const system_sdk = @import("vendor/mach/glfw/system_sdk.zig"); const system_sdk = @import("vendor/mach/glfw/system_sdk.zig");
/// A build that is set to true if Tracy integration should be built.
var tracy: bool = false;
pub fn build(b: *std.build.Builder) !void { pub fn build(b: *std.build.Builder) !void {
const mode = b.standardReleaseOptions(); const mode = b.standardReleaseOptions();
const target = target: { const target = target: {
@ -21,7 +24,7 @@ pub fn build(b: *std.build.Builder) !void {
break :target result; break :target result;
}; };
const tracy = b.option( tracy = b.option(
bool, bool,
"tracy", "tracy",
"Enable Tracy integration (default true in Debug on Linux)", "Enable Tracy integration (default true in Debug on Linux)",
@ -160,8 +163,10 @@ fn addDeps(
// Tracy // Tracy
step.addPackage(tracylib.pkg); step.addPackage(tracylib.pkg);
var tracy_step = try tracylib.link(b, step); if (tracy) {
system_sdk.include(b, tracy_step, .{}); var tracy_step = try tracylib.link(b, step);
system_sdk.include(b, tracy_step, .{});
}
} }
fn conformanceSteps( fn conformanceSteps(