diff options
author | Rutger Broekhoff | 2021-05-25 21:37:11 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2021-05-25 21:37:11 +0200 |
commit | 7621f1f91162e18a14562b52e082da0d8a324885 (patch) | |
tree | ac6e492b72164b71a0cb1f5f46eb3fab857bad8e /build.zig | |
parent | f78b029e55db9bce054d7b7cb7e290f2a4ade964 (diff) | |
download | zig-nkeys-0.1.0.tar.gz zig-nkeys-0.1.0.zip |
Prepare for 0.1.0 release0.1.0
Diffstat (limited to 'build.zig')
-rw-r--r-- | build.zig | 33 |
1 files changed, 10 insertions, 23 deletions
@@ -1,47 +1,34 @@ | |||
1 | const std = @import("std"); | 1 | const std = @import("std"); |
2 | 2 | ||
3 | pub fn build(b: *std.build.Builder) !void { | 3 | pub fn build(b: *std.build.Builder) !void { |
4 | // Standard target options allows the person running `zig build` to choose | ||
5 | // what target to build for. Here we do not override the defaults, which | ||
6 | // means any target is allowed, and the default is native. Other options | ||
7 | // for restricting supported target set are available. | ||
8 | const target = b.standardTargetOptions(.{}); | ||
9 | |||
10 | // Standard release options allow the person running `zig build` to select | ||
11 | // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. | ||
12 | const mode = b.standardReleaseOptions(); | 4 | const mode = b.standardReleaseOptions(); |
5 | const target = b.standardTargetOptions(.{}); | ||
13 | 6 | ||
14 | const version = "0.1.0-dev"; | 7 | var lib_tests = b.addTest("src/lib.zig"); |
15 | |||
16 | const lib = b.addStaticLibrary("nkeys", "src/nkeys.zig"); | ||
17 | lib.setBuildMode(mode); | ||
18 | lib.addBuildOption([:0]const u8, "version", try b.allocator.dupeZ(u8, version)); | ||
19 | lib.install(); | ||
20 | |||
21 | var lib_tests = b.addTest("src/nkeys.zig"); | ||
22 | lib_tests.setBuildMode(mode); | 8 | lib_tests.setBuildMode(mode); |
23 | lib_tests.addBuildOption([:0]const u8, "version", try b.allocator.dupeZ(u8, version)); | ||
24 | 9 | ||
25 | const test_step = b.step("test", "Run library tests"); | 10 | const test_step = b.step("test", "Run library tests"); |
26 | test_step.dependOn(&lib_tests.step); | 11 | test_step.dependOn(&lib_tests.step); |
27 | 12 | ||
13 | const znk_version = "0.1.0"; | ||
14 | |||
28 | var znk_tests = b.addTest("tool/znk.zig"); | 15 | var znk_tests = b.addTest("tool/znk.zig"); |
29 | znk_tests.setBuildMode(mode); | 16 | znk_tests.setBuildMode(mode); |
30 | znk_tests.addPackagePath("nkeys", "src/nkeys.zig"); | 17 | znk_tests.addPackagePath("nkeys", "src/lib.zig"); |
31 | znk_tests.addBuildOption([:0]const u8, "version", try b.allocator.dupeZ(u8, version)); | 18 | znk_tests.addBuildOption([:0]const u8, "version", try b.allocator.dupeZ(u8, znk_version)); |
32 | 19 | ||
33 | const znk_test_step = b.step("test-znk", "Run znk tests"); | 20 | const znk_test_step = b.step("test-znk", "Run znk tests"); |
34 | znk_test_step.dependOn(&znk_tests.step); | 21 | znk_test_step.dependOn(&znk_tests.step); |
35 | 22 | ||
36 | const znk = b.addExecutable("znk", "tool/znk.zig"); | 23 | const znk = b.addExecutable("znk", "tool/znk.zig"); |
37 | znk.setTarget(target); | ||
38 | znk.setBuildMode(mode); | 24 | znk.setBuildMode(mode); |
39 | znk.addPackagePath("nkeys", "src/nkeys.zig"); | 25 | znk.setTarget(target); |
40 | znk.addBuildOption([:0]const u8, "version", try b.allocator.dupeZ(u8, version)); | 26 | znk.addPackagePath("nkeys", "src/lib.zig"); |
27 | znk.addBuildOption([:0]const u8, "version", try b.allocator.dupeZ(u8, znk_version)); | ||
41 | 28 | ||
42 | const znk_install = b.addInstallArtifact(znk); | 29 | const znk_install = b.addInstallArtifact(znk); |
43 | 30 | ||
44 | const znk_step = b.step("znk", "Build only znk"); | 31 | const znk_step = b.step("znk", "Build znk"); |
45 | znk_step.dependOn(&znk_install.step); | 32 | znk_step.dependOn(&znk_install.step); |
46 | 33 | ||
47 | const znk_run_cmd = znk.run(); | 34 | const znk_run_cmd = znk.run(); |