authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-12-28 19:33:24 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2024-12-28 19:33:24 -08:00
logb7abb501e62646641eaa22672c24fdef0106a512
treed4f6b2a192ceed8071e276b0187418ab824a5e48
parent60f0de9eb5d6c8acb1b7cea4a751751c122c272f

update to zig 0.13


3 files changed, 9 insertions(+), 7 deletions(-)

.gitignore-1
......@@ -1,4 +1,3 @@
1zig-cache
21.zig-cache
32zig-out
43.zigmod
build.zig+8-6
......@@ -1,10 +1,11 @@
11const std = @import("std");
2const deps = @import("./deps.zig");
23
34pub fn build(b: *std.Build) void {
45 const target = b.standardTargetOptions(.{});
56 const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug;
67
7 const mod = b.addModule("tracer", .{ .source_file = .{ .path = "src/mod.zig" } });
8 const mod = b.addModule("tracer", .{ .root_source_file = b.path("src/mod.zig") });
89
910 addTest(b, target, mode, mod, 0);
1011 addTest(b, target, mode, mod, 1);
......@@ -12,22 +13,23 @@ pub fn build(b: *std.Build) void {
1213 addTest(b, target, mode, mod, 3);
1314
1415 const test_step = b.step("test", "dummy test step to pass CI checks");
15 _ = test_step;
16 test_step.dependOn(b.default_step);
1617}
1718
18fn addTest(b: *std.Build, target: std.zig.CrossTarget, mode: std.builtin.Mode, mod: *std.build.Module, comptime backend: u8) void {
19fn addTest(b: *std.Build, target: std.Build.ResolvedTarget, mode: std.builtin.Mode, mod: *std.Build.Module, comptime backend: u8) void {
20 _ = mod;
1921 const options = b.addOptions();
2022 options.addOption(usize, "src_file_trimlen", std.fs.path.dirname(std.fs.path.dirname(@src().file).?).?.len);
2123 options.addOption(u8, "backend", backend);
2224
2325 const exe = b.addExecutable(.{
2426 .name = "test" ++ std.fmt.comptimePrint("{d}", .{backend}),
25 .root_source_file = .{ .path = "src/main.zig" },
27 .root_source_file = b.path("src/main.zig"),
2628 .target = target,
2729 .optimize = mode,
2830 });
31 deps.addAllTo(exe);
2932 exe.linkLibC();
30 exe.addModule("tracer", mod);
31 exe.addOptions("build_options", options);
33 exe.root_module.addImport("build_options", options.createModule());
3234 b.installArtifact(exe);
3335}
src/main.zig+1
......@@ -16,6 +16,7 @@ pub fn main() !void {
1616
1717 // main loop
1818 var go = false;
19 _ = &go;
1920 while (go) {
2021 try tracer.init_thread(std.fs.cwd());
2122 defer tracer.deinit_thread();