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");
33
44pub fn build(b: *std.build.Builder) void {
55 const target = b.standardTargetOptions(.{});
6 const mode = b.standardReleaseOptions();
7 const step = b.option([]const u8, "step", "") orelse "generate";
8 b.use_stage1 = true;
6 const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug;
7
8 const step = b.option([]const u8, "step", "") orelse "run";
99
1010 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");
1212 }
1313 if (std.mem.eql(u8, step, "generate")) {
1414 addExeStep(b, target, mode, "generate", "generate.zig", "Generate the bindings");
1515 }
1616}
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 {
19 const exe = b.addExecutable(name, root_src);
20 exe.setTarget(target);
21 exe.setBuildMode(mode);
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(.{
20 .name = name,
21 .root_source_file = .{ .path = root_src },
22 .target = target,
23 .optimize = mode,
24 });
2225 deps.addAllTo(exe);
23 exe.install();
26 b.installArtifact(exe);
2427
25 const cmd = exe.run();
28 const cmd = b.addRunArtifact(exe);
2629 cmd.step.dependOn(b.getInstallStep());
2730 if (b.args) |args| {
2831 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
44license: MIT
55description: Zig bindings for the Unicode Character Database
66root_dependencies:
7 - src: git https://github.com/nektro/iguanaTLS
8 - src: git https://github.com/truemedian/zfetch
7 - src: git https://github.com/nektro/zfetch
98 - src: git https://github.com/nektro/zig-ansi
109 - 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