33 lines
1.0 KiB
Zig
33 lines
1.0 KiB
Zig
const std = @import("std");
|
|
const bh = @import("bh");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const opts = bh.declareOptions(b);
|
|
|
|
const p2dep = b.dependency("p2", .{ .target = opts.target, .optimize = opts.optimize, .static_build = opts.static_build });
|
|
|
|
const mod = b.addModule("packer", .{
|
|
.target = opts.target,
|
|
.optimize = opts.optimize,
|
|
.root_source_file = b.path("src/packer.zig"),
|
|
});
|
|
|
|
const p2mod = p2dep.module("p2");
|
|
mod.addImport("p2", p2mod);
|
|
|
|
const test_exe = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.target = opts.target,
|
|
.optimize = opts.optimize,
|
|
.root_source_file = b.path("tests/test.zig"),
|
|
}),
|
|
});
|
|
test_exe.root_module.addImport("packer", mod);
|
|
test_exe.root_module.addImport("p2", p2mod);
|
|
|
|
const test_step = b.step("test", "runs sample unit tests for packer");
|
|
test_step.dependOn(&b.addRunArtifact(test_exe).step);
|
|
|
|
b.installArtifact(test_exe);
|
|
}
|