From bd62b90537753113f102da14be4af0b4270f9f5c Mon Sep 17 00:00:00 2001 From: owl Date: Fri, 5 Jan 2024 20:07:43 +0100 Subject: [PATCH] keep up with zig build system --- build.zig | 15 +++++++-------- build.zig.zon | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/build.zig b/build.zig index caa374e..10b9263 100644 --- a/build.zig +++ b/build.zig @@ -2,20 +2,19 @@ const builtin = @import("builtin"); const std = @import("std"); const mem = std.mem; const fs = std.fs; -const Builder = std.build.Builder; const Target = std.build.Target; const program_name = "bare"; const sep = fs.path.sep_str; -pub fn build(b: *Builder) !void { +pub fn build(b: *std.Build) !void { const optimize = b.standardOptimizeOption(.{}); const target = b.standardTargetOptions(.{}); const varint_dep = b.dependency("varint", .{}); const bare_mod = b.addModule("bare", .{ - .source_file = .{ .path = "src" ++ sep ++ "bare.zig" }, - .dependencies = &.{ + .root_source_file = .{ .path = "src" ++ sep ++ "bare.zig" }, + .imports = &.{ .{ .name = "varint", .module = varint_dep.module("varint"), @@ -30,8 +29,8 @@ pub fn build(b: *Builder) !void { .target = target, }); - bench.addModule("bare", bare_mod); - bench.addModule("varint", varint_dep.module("varint")); + bench.root_module.addImport("bare", bare_mod); + bench.root_module.addImport("varint", varint_dep.module("varint")); const unit_tests = b.addTest(.{ .root_source_file = .{ .path = "src" ++ sep ++ "test.zig" }, @@ -39,7 +38,7 @@ pub fn build(b: *Builder) !void { .target = target, }); - unit_tests.addModule("bare", bare_mod); + unit_tests.root_module.addImport("bare", bare_mod); const interop_tests = b.addTest(.{ .root_source_file = .{ .path = "interop" ++ sep ++ "root.zig" }, @@ -47,7 +46,7 @@ pub fn build(b: *Builder) !void { .target = target, }); - interop_tests.addModule("bare", bare_mod); + interop_tests.root_module.addImport("bare", bare_mod); const bench_run_cmd = b.addRunArtifact(bench); const bench_run_step = b.step("bench", "Run " ++ program_name ++ " benchmarks"); diff --git a/build.zig.zon b/build.zig.zon index e93b1e2..b7eefec 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -4,8 +4,8 @@ .paths = .{""}, .dependencies = .{ .varint = .{ - .url = "https://git.sr.ht/~alva/zig-varint/archive/f9e5b7f.tar.gz", - .hash = "1220136609b836df8ff707062b100395f49d6c87187c3e74312c223618ad69e9a9ab", + .url = "https://git.sr.ht/~alva/zig-varint/archive/312fc43.tar.gz", + .hash = "12206217b59bf0eac3652f2534c08b22aa9de3d8b62b3b155807625436add971f2d9", }, }, } -- 2.45.2