build: upgrade to 0.15.1

This commit is contained in:
Arran Ireland
2025-10-02 10:40:00 +01:00
parent ab8170f186
commit 76911aaae1
2 changed files with 38 additions and 16 deletions

View File

@@ -59,7 +59,7 @@ const Builder = struct {
const write_files = self.b.addWriteFiles();
const bindings = @import("core/bindings.zig");
const data = bindings.data(.c, self.b.allocator) catch |err| {
const data = bindings.data(self.b.allocator, .c) catch |err| {
std.debug.print("Failed to generate header: {any}", .{err});
std.process.exit(1);
};
@@ -75,13 +75,21 @@ const Builder = struct {
pub fn examples(self: *Self) void {
const step = self.b.step("example", "Run an example");
const name = self.b.option([]const u8, "name", "The module name to run") orelse return;
const example_name = self.b.fmt("example-{s}", .{name});
const example_module = self.b.addModule(
example_name,
.{
.root_source_file = self.b.path(self.b.fmt("examples/{s}.zig", .{name})),
.target = self.target,
.optimize = self.optimize,
},
);
const example = self.b.addExecutable(.{
.name = self.b.fmt("example-{s}", .{name}),
.root_source_file = self.b.path(self.b.fmt("examples/{s}.zig", .{name})),
.target = self.target,
.optimize = self.optimize,
.name = example_name,
.root_module = example_module,
});
self.addImport(example, .core);
@@ -154,11 +162,18 @@ const Builder = struct {
inline for (.{ .app, .core, .io }) |t| {
const root = if (t == .app) "main" else "lib";
const test_module = self.b.addModule(
@tagName(t),
.{
.root_source_file = self.b.path(@tagName(t) ++ "/" ++ root ++ ".zig"),
.target = self.target,
.optimize = self.optimize,
},
);
const compile = self.b.addTest(.{
.name = @tagName(t),
.root_source_file = self.b.path(@tagName(t) ++ "/" ++ root ++ ".zig"),
.target = self.target,
.optimize = self.optimize,
.root_module = test_module,
});
step.dependOn(&self.b.addRunArtifact(compile).step);
@@ -195,11 +210,18 @@ const Builder = struct {
};
inline for (test_names) |name| {
const test_module = self.b.addModule(
name,
.{
.root_source_file = self.b.path(root_directory ++ "/" ++ name ++ ".zig"),
.target = self.target,
.optimize = self.optimize,
},
);
const t = self.b.addTest(.{
.name = name,
.root_source_file = self.b.path(root_directory ++ "/" ++ name ++ ".zig"),
.target = self.target,
.optimize = self.optimize,
.root_module = test_module,
});
inline for (packages) |package| {

View File

@@ -1,7 +1,7 @@
.{
.name = .reticulum,
.version = "0.2.0",
.minimum_zig_version = "0.14.1",
.version = "0.3.0",
.minimum_zig_version = "0.15.1",
.fingerprint = 0x357e04a91bafe743,
.paths = .{
"build.zig",
@@ -14,8 +14,8 @@
},
.dependencies = .{
.ohsnap = .{
.url = "git+https://github.com/mnemnion/ohsnap#a140626e388ad3aea2a6a678183f5c0c03887fde",
.hash = "ohsnap-0.3.1-iWxzyu6bAADX1OdmK7FFg94X6RDfDvbt0iwQFH8mSFJE",
.url = "https://github.com/mnemnion/ohsnap/archive/refs/heads/trunk.tar.gz",
.hash = "ohsnap-0.4.1-iWxzyhicAAA90MEnwxA22VshYmsSH3t0dcqM9yib7ose",
},
},
}