blob ffd7800a (960B) - Raw
1 const std = @import("std"); 2 const builtin = @import("builtin"); 3 4 /// This tests the path where DWARF information is embedded in a COFF binary 5 pub fn build(b: *std.Build) void { 6 const test_step = b.step("test", "Test it"); 7 b.default_step = test_step; 8 9 const optimize: std.builtin.OptimizeMode = .Debug; 10 const target = b.standardTargetOptions(.{}); 11 12 if (builtin.os.tag != .windows) return; 13 14 const exe = b.addExecutable(.{ 15 .name = "main", 16 .root_source_file = .{ .path = "main.zig" }, 17 .optimize = optimize, 18 .target = target, 19 }); 20 21 const lib = b.addSharedLibrary(.{ 22 .name = "shared_lib", 23 .optimize = optimize, 24 .target = target, 25 }); 26 lib.addCSourceFile("shared_lib.c", &.{"-gdwarf"}); 27 lib.linkLibC(); 28 exe.linkLibrary(lib); 29 30 const run = b.addRunArtifact(exe); 31 run.expectExitCode(0); 32 run.skip_foreign_checks = true; 33 34 test_step.dependOn(&run.step); 35 }