31 lines
918 B
Zig
31 lines
918 B
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
const static_build = b.option(bool, "static_build", "builds backlog dependencies for static linking") orelse true;
|
|
_ = static_build;
|
|
|
|
const mod = b.addModule("p2", .{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.root_source_file = b.path("src/p2.zig"),
|
|
});
|
|
|
|
const test_step = b.step("test", "test p2");
|
|
const tests = b.addTest(.{
|
|
.target = target,
|
|
.optimize = 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);
|
|
}
|