build.zig (809B)
1 const std = @import("std"); 2 3 pub fn build(b: *std.Build) void { 4 const target = b.standardTargetOptions(.{}); 5 const optimize = b.standardOptimizeOption(.{}); 6 7 const exe = b.addExecutable(.{ 8 .name = "pmn", 9 .root_module = b.createModule(.{ 10 .root_source_file = b.path("src/main.zig"), 11 .target = target, 12 .optimize = optimize, 13 }), 14 }); 15 b.installArtifact(exe); 16 17 const exe_tests = b.addTest(.{ 18 .root_module = b.createModule(.{ 19 .root_source_file = b.path("src/main.zig"), 20 .target = target, 21 .optimize = optimize, 22 }), 23 }); 24 25 const run_exe_tests = b.addRunArtifact(exe_tests); 26 const test_step = b.step("test", "Run unit tests"); 27 test_step.dependOn(&run_exe_tests.step); 28 }