const std = @import("std"); const bh = @import("bh"); pub fn build(b: *std.Build) void { const opts = bh.declareOptions(b); const mod = b.addModule("p2", .{ .target = opts.target, .optimize = opts.optimize, .root_source_file = b.path("src/p2.zig"), }); const test_step = b.step("test", "test p2"); const tests = b.addTest(.{ .root_module = b.createModule(.{ .target = opts.target, .optimize = opts.optimize, .root_source_file = b.path("src/p2.zig"), }), // .link_libc = true, }); tests.root_module.addImport("p2", mod); const runArtifact = b.addRunArtifact(tests); test_step.dependOn(&runArtifact.step); if (b.args) |args| { runArtifact.addArgs(args); } b.installArtifact(tests); }