2026-06-09 19:29:01 +02:00
|
|
|
const std = @import("std");
|
|
|
|
|
|
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
|
|
|
const target = b.standardTargetOptions(.{});
|
|
|
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
|
|
2026-06-09 21:27:02 +02:00
|
|
|
// Create root module
|
|
|
|
|
const root_module = b.createModule(.{
|
|
|
|
|
.root_source_file = b.path("src/root.zig"),
|
|
|
|
|
.target = target,
|
|
|
|
|
.optimize = optimize,
|
|
|
|
|
});
|
|
|
|
|
|
2026-06-09 19:29:01 +02:00
|
|
|
// Create library
|
2026-06-09 21:27:02 +02:00
|
|
|
const lib = b.addLibrary(.{
|
2026-06-09 19:29:01 +02:00
|
|
|
.name = "reticulum-zero",
|
|
|
|
|
.linkage = .static,
|
2026-06-09 21:27:02 +02:00
|
|
|
.root_module = root_module,
|
2026-06-09 19:29:01 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Output library object
|
2026-06-09 21:27:02 +02:00
|
|
|
b.installArtifact(lib);
|
2026-06-09 19:29:01 +02:00
|
|
|
|
|
|
|
|
// Set up unit testing
|
2026-06-09 21:27:02 +02:00
|
|
|
// const unit_tests = b.addTest(.{
|
|
|
|
|
// .root_module = root_module,
|
|
|
|
|
// });
|
2026-06-09 19:29:01 +02:00
|
|
|
|
2026-06-09 21:27:02 +02:00
|
|
|
// const run_unit_tests = b.addRunStep(unit_tests);
|
2026-06-09 19:29:01 +02:00
|
|
|
|
|
|
|
|
// `zig build test` command
|
2026-06-09 21:27:02 +02:00
|
|
|
// const test_step = b.step("test", "Run library unit tests");
|
|
|
|
|
// test_step.dependency(&run_unit_tests.step);
|
2026-06-09 19:29:01 +02:00
|
|
|
}
|