From 66e0e65fd17d50d857ce5e4f3e8d56b3a795845c Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Sat, 27 Apr 2024 02:25:17 +0200 Subject: Minor updates for Zig 0.12.0 --- build.zig | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'build.zig') diff --git a/build.zig b/build.zig index de48e91..626bf25 100644 --- a/build.zig +++ b/build.zig @@ -1,6 +1,6 @@ const std = @import("std"); -pub fn build(b: *std.build.Builder) !void { +pub fn build(b: *std.Build) !void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); @@ -14,15 +14,11 @@ pub fn build(b: *std.build.Builder) !void { const test_step = b.step("test", "Run library tests"); test_step.dependOn(&run_lib_tests.step); - const znk_version = "0.2.1"; + const znk_version = "0.2.2"; const znk_options = b.addOptions(); znk_options.addOption([]const u8, "version", znk_version); - const nkeys_module = b.addModule("nkeys", .{ - .source_file = .{ .path = "src/main.zig" }, - }); - const lib = b.addStaticLibrary(.{ .name = "nkeys", .root_source_file = .{ .path = "src/main.zig" }, @@ -37,8 +33,8 @@ pub fn build(b: *std.build.Builder) !void { .target = target, .optimize = optimize, }); - znk_tests.addModule("nkeys", nkeys_module); - znk_tests.addOptions("build_options", znk_options); + znk_tests.root_module.addImport("nkeys", &lib.root_module); + znk_tests.root_module.addOptions("build_options", znk_options); const run_znk_tests = b.addRunArtifact(znk_tests); const znk_test_step = b.step("test-znk", "Run znk tests"); @@ -50,8 +46,8 @@ pub fn build(b: *std.build.Builder) !void { .target = target, .optimize = optimize, }); - znk.addModule("nkeys", nkeys_module); - znk.addOptions("build_options", znk_options); + znk.root_module.addImport("nkeys", &lib.root_module); + znk.root_module.addOptions("build_options", znk_options); b.installArtifact(znk); -- cgit v1.2.3