A library for parsing Tiled maps.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fixes non-linux builds

+9 -8
+9 -8
build.zig
··· 1 1 pub fn build(b: *std.Build) void { 2 2 const target = b.standardTargetOptions(.{}); 3 - const optimize = b.standardOptimizeOption(.{}); 4 - 5 3 const coverage = b.option(bool, "coverage", "Generate a coverage report with kcov") orelse false; 4 + const coverage_requested = coverage and b.graph.host.result.os.tag == .linux; 6 5 7 6 const mod = b.addModule("tmz", .{ 8 7 .root_source_file = b.path("src/root.zig"), 9 8 .target = target, 10 - .optimize = optimize, 11 9 }); 12 10 13 11 const mod_tests = b.addTest(.{ 14 12 .root_module = mod, 15 - .use_llvm = coverage, 16 13 }); 17 - const run_mod_tests = b.addRunArtifact(mod_tests); 18 14 19 15 const tests = b.addTest(.{ 20 16 .root_module = b.createModule(.{ 21 17 .root_source_file = b.path("test/tests.zig"), 22 18 .target = target, 23 - .optimize = optimize, 24 19 .imports = &.{ 25 20 .{ .name = "tmz", .module = mod }, 26 21 }, 27 22 }), 28 - .use_llvm = coverage, 29 23 }); 24 + 25 + if (coverage_requested) { 26 + mod_tests.use_llvm = true; 27 + tests.use_llvm = true; 28 + } 29 + 30 + const run_mod_tests = b.addRunArtifact(mod_tests); 30 31 const run_tests = b.addRunArtifact(tests); 31 32 32 33 const test_step = b.step("test", "Run tests"); 33 34 test_step.dependOn(&run_mod_tests.step); 34 35 test_step.dependOn(&run_tests.step); 35 36 36 - if (coverage) { 37 + if (coverage_requested) { 37 38 var run_test_steps: std.ArrayList(*std.Build.Step.Run) = .empty; 38 39 run_test_steps.append(b.allocator, run_mod_tests) catch @panic("OOM"); 39 40 run_test_steps.append(b.allocator, run_tests) catch @panic("OOM");