authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-10-03 17:57:02 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-10-03 17:57:02 -07:00
log8206949a1005042dac53c5a4f37d09f736c4d60c
tree3dbd10bc138c77d62a88e45eeeaa7eec237b7da1
parenta43326bf5a09cb1e9211685c4d639372b3d365d7

update build script to zig 0.11.0


4 files changed, 28 insertions(+), 12 deletions(-)

build.zig+13-10
...@@ -3,26 +3,29 @@ const deps = @import("./deps.zig");...@@ -3,26 +3,29 @@ const deps = @import("./deps.zig");
33
4pub fn build(b: *std.build.Builder) void {4pub fn build(b: *std.build.Builder) void {
5 const target = b.standardTargetOptions(.{});5 const target = b.standardTargetOptions(.{});
6 const mode = b.standardReleaseOptions();6 const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug;
7 const step = b.option([]const u8, "step", "") orelse "generate";7
8 b.use_stage1 = true;8 const step = b.option([]const u8, "step", "") orelse "run";
99
10 if (std.mem.eql(u8, step, "run")) {10 if (std.mem.eql(u8, step, "run")) {
11 addExeStep(b, target, mode, "zig-unicode-ucd", "src/main.zig", "Run the app");11 addExeStep(b, target, mode, "zig-unicode-uca", "src/main.zig", "Run the app");
12 }12 }
13 if (std.mem.eql(u8, step, "generate")) {13 if (std.mem.eql(u8, step, "generate")) {
14 addExeStep(b, target, mode, "generate", "generate.zig", "Generate the bindings");14 addExeStep(b, target, mode, "generate", "generate.zig", "Generate the bindings");
15 }15 }
16}16}
1717
18fn addExeStep(b: *std.build.Builder, target: std.zig.CrossTarget, mode: std.builtin.Mode, name: []const u8, root_src: ?[]const u8, sdescription: []const u8) void {18fn addExeStep(b: *std.build.Builder, target: std.zig.CrossTarget, mode: std.builtin.Mode, name: []const u8, root_src: []const u8, sdescription: []const u8) void {
19 const exe = b.addExecutable(name, root_src);19 const exe = b.addExecutable(.{
20 exe.setTarget(target);20 .name = name,
21 exe.setBuildMode(mode);21 .root_source_file = .{ .path = root_src },
22 .target = target,
23 .optimize = mode,
24 });
22 deps.addAllTo(exe);25 deps.addAllTo(exe);
23 exe.install();26 b.installArtifact(exe);
2427
25 const cmd = exe.run();28 const cmd = b.addRunArtifact(exe);
26 cmd.step.dependOn(b.getInstallStep());29 cmd.step.dependOn(b.getInstallStep());
27 if (b.args) |args| {30 if (b.args) |args| {
28 cmd.addArgs(args);31 cmd.addArgs(args);
licenses.txt created+8
...@@ -0,0 +1,8 @@
1MIT:
2= https://spdx.org/licenses/MIT
3- This
4- git https://github.com/nektro/iguanaTLS
5- git https://github.com/nektro/zfetch
6- git https://github.com/nektro/zig-ansi
7- git https://github.com/nektro/zig-fmt-valueliteral
8- git https://github.com/truemedian/hzzp
zig.mod+1-2
...@@ -4,7 +4,6 @@ main: src/lib.zig...@@ -4,7 +4,6 @@ main: src/lib.zig
4license: MIT4license: MIT
5description: Zig bindings for the Unicode Character Database5description: Zig bindings for the Unicode Character Database
6root_dependencies:6root_dependencies:
7 - src: git https://github.com/nektro/iguanaTLS7 - src: git https://github.com/nektro/zfetch
8 - src: git https://github.com/truemedian/zfetch
9 - src: git https://github.com/nektro/zig-ansi8 - src: git https://github.com/nektro/zig-ansi
10 - src: git https://github.com/nektro/zig-fmt-valueliteral9 - src: git https://github.com/nektro/zig-fmt-valueliteral
zigmod.lock created+6
...@@ -0,0 +1,6 @@
12
2git https://github.com/nektro/iguanaTLS commit-c932f557865abaa1d06cd88e9b22a9f3e583fa59
3git https://github.com/nektro/zfetch commit-f51277414a2309f776fb79f3d55f26e37f9a54da
4git https://github.com/nektro/zig-ansi commit-ac607e4e7ac36d46cc67c8786262578330543a36
5git https://github.com/nektro/zig-fmt-valueliteral commit-ec324a6979145ec8b1b405f5faef811f43ca3726
6git https://github.com/truemedian/hzzp commit-305aca97fce78eb3e787d57691a5eed5512bece7