git.s-ol.nu openxPriments / 7c0d971
add renderdoc ENV in build.zig s-ol 4 months ago
1 changed file(s) with 9 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
77 pub fn build(b: *Builder) void {
88 const target = b.standardTargetOptions(.{});
99 const mode = b.standardReleaseOptions();
10
10
1111 const exe = b.addExecutable("openxPriments", "src/main.zig");
1212 exe.setTarget(target);
1313 exe.setBuildMode(mode);
1616 exe.linkSystemLibrary("vulkan");
1717 exe.linkSystemLibrary("openxr_loader");
1818 exe.linkSystemLibrary("GraphicsEngineVk");
19
20 const renderdoc = b.option(bool, "renderdoc", "Enable Renderdoc debugging") orelse false;
21 if (renderdoc) exe.linkSystemLibrary("renderdoc");
22 exe.addBuildOption(bool, "renderdoc", renderdoc);
23
19
2420 const gen_dg = dggen.DgGenerateStep.init(b, "lib/DiligentEngine", "dg.zig");
2521 gen_dg.addDeps(exe, "Debug");
2622
4036 run_cmd.step.dependOn(b.getInstallStep());
4137 const run_step = b.step("run", "Run the example example");
4238 run_step.dependOn(&run_cmd.step);
39
40 const renderdoc = b.option(bool, "renderdoc", "Enable Renderdoc debugging") orelse false;
41 exe.addBuildOption(bool, "renderdoc", renderdoc);
42 if (renderdoc) {
43 exe.linkSystemLibrary("renderdoc");
44 run_cmd.setEnvironmentVariable("VK_INSTANCE_LAYERS", "VK_LAYER_RENDERDOC_Capture");
45 }
4346 }