aboutsummaryrefslogtreecommitdiffstats
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig16
1 files changed, 6 insertions, 10 deletions
diff --git a/build.zig b/build.zig
index de48e91..626bf25 100644
--- a/build.zig
+++ b/build.zig
@@ -1,6 +1,6 @@
1const std = @import("std"); 1const std = @import("std");
2 2
3pub fn build(b: *std.build.Builder) !void { 3pub fn build(b: *std.Build) !void {
4 const target = b.standardTargetOptions(.{}); 4 const target = b.standardTargetOptions(.{});
5 const optimize = b.standardOptimizeOption(.{}); 5 const optimize = b.standardOptimizeOption(.{});
6 6
@@ -14,15 +14,11 @@ pub fn build(b: *std.build.Builder) !void {
14 const test_step = b.step("test", "Run library tests"); 14 const test_step = b.step("test", "Run library tests");
15 test_step.dependOn(&run_lib_tests.step); 15 test_step.dependOn(&run_lib_tests.step);
16 16
17 const znk_version = "0.2.1"; 17 const znk_version = "0.2.2";
18 18
19 const znk_options = b.addOptions(); 19 const znk_options = b.addOptions();
20 znk_options.addOption([]const u8, "version", znk_version); 20 znk_options.addOption([]const u8, "version", znk_version);
21 21
22 const nkeys_module = b.addModule("nkeys", .{
23 .source_file = .{ .path = "src/main.zig" },
24 });
25
26 const lib = b.addStaticLibrary(.{ 22 const lib = b.addStaticLibrary(.{
27 .name = "nkeys", 23 .name = "nkeys",
28 .root_source_file = .{ .path = "src/main.zig" }, 24 .root_source_file = .{ .path = "src/main.zig" },
@@ -37,8 +33,8 @@ pub fn build(b: *std.build.Builder) !void {
37 .target = target, 33 .target = target,
38 .optimize = optimize, 34 .optimize = optimize,
39 }); 35 });
40 znk_tests.addModule("nkeys", nkeys_module); 36 znk_tests.root_module.addImport("nkeys", &lib.root_module);
41 znk_tests.addOptions("build_options", znk_options); 37 znk_tests.root_module.addOptions("build_options", znk_options);
42 const run_znk_tests = b.addRunArtifact(znk_tests); 38 const run_znk_tests = b.addRunArtifact(znk_tests);
43 39
44 const znk_test_step = b.step("test-znk", "Run znk tests"); 40 const znk_test_step = b.step("test-znk", "Run znk tests");
@@ -50,8 +46,8 @@ pub fn build(b: *std.build.Builder) !void {
50 .target = target, 46 .target = target,
51 .optimize = optimize, 47 .optimize = optimize,
52 }); 48 });
53 znk.addModule("nkeys", nkeys_module); 49 znk.root_module.addImport("nkeys", &lib.root_module);
54 znk.addOptions("build_options", znk_options); 50 znk.root_module.addOptions("build_options", znk_options);
55 51
56 b.installArtifact(znk); 52 b.installArtifact(znk);
57 53