Tweak build

This commit is contained in:
Caleb Gardner
2025-05-21 22:28:50 -05:00
parent 6f02f9f14d
commit 3bfd262824
2 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -13,7 +13,6 @@ pub fn build(b: *std.Build) void {
.name = "zig_squashfs", .name = "zig_squashfs",
.root_module = lib_mod, .root_module = lib_mod,
}); });
b.installArtifact(lib);
const exe_mod = b.createModule(.{ const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"), .root_source_file = b.path("src/main.zig"),
.target = target, .target = target,
@@ -21,14 +20,20 @@ pub fn build(b: *std.Build) void {
}); });
const exe = b.addExecutable(.{ const exe = b.addExecutable(.{
.linkage = .static, .linkage = .static,
.name = "unsquashfs", .name = "zig-unsquashfs",
.root_module = exe_mod, .root_module = exe_mod,
}); });
b.installArtifact(lib);
b.installArtifact(exe); b.installArtifact(exe);
const lib_unit_tests = b.addTest(.{ const lib_unit_tests = b.addTest(.{
.root_module = lib_mod, .root_module = lib_mod,
}); });
const exe_unit_test = b.addTest(.{
.root_module = exe_mod,
});
const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests); const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);
const run_exe_unit_tests = b.addRunArtifact(exe_unit_test);
const test_step = b.step("test", "Run unit tests"); const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_lib_unit_tests.step); test_step.dependOn(&run_lib_unit_tests.step);
test_step.dependOn(&run_exe_unit_tests.step);
} }
+3 -3
View File
@@ -54,8 +54,8 @@
"build.zig", "build.zig",
"build.zig.zon", "build.zig.zon",
"src", "src",
// For example...
//"LICENSE", "LICENSE",
//"README.md", "README.md",
}, },
} }