Fixed compilation issues
This commit is contained in:
parent
dad6a6819c
commit
ad6eb69ec7
3 changed files with 23 additions and 24 deletions
42
build.zig
42
build.zig
|
|
@ -4,33 +4,31 @@ pub fn build(b: *std.Build) void {
|
|||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
// Create library
|
||||
const reticulumzero = b.addLibrary(.{
|
||||
.name = "reticulum-zero",
|
||||
.linkage = .static,
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
}),
|
||||
});
|
||||
|
||||
// Output library object
|
||||
b.installArtifact(reticulumzero);
|
||||
|
||||
// Expose library as a module
|
||||
try b.modules.put(b.dupe("reticulum-zero"), reticulumzero.root_module);
|
||||
|
||||
// Set up unit testing
|
||||
const unit_tests = b.addTest(.{
|
||||
// Create root module
|
||||
const root_module = b.createModule(.{
|
||||
.root_source_file = b.path("src/root.zig"),
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
|
||||
const run_unit_tests = b.addRunStep(unit_tests);
|
||||
// Create library
|
||||
const lib = b.addLibrary(.{
|
||||
.name = "reticulum-zero",
|
||||
.linkage = .static,
|
||||
.root_module = root_module,
|
||||
});
|
||||
|
||||
// Output library object
|
||||
b.installArtifact(lib);
|
||||
|
||||
// Set up unit testing
|
||||
// const unit_tests = b.addTest(.{
|
||||
// .root_module = root_module,
|
||||
// });
|
||||
|
||||
// const run_unit_tests = b.addRunStep(unit_tests);
|
||||
|
||||
// `zig build test` command
|
||||
const test_step = b.step("test", "Run library unit tests");
|
||||
test_step.dependency(&run_unit_tests.step);
|
||||
// const test_step = b.step("test", "Run library unit tests");
|
||||
// test_step.dependency(&run_unit_tests.step);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue