- commit
- a65a2b0
- parent
- b5b525c
- author
- Jesse Farebrother
- date
- 2025-12-05 16:17:38 -0500 EST
chore: build.zig version build option
1 files changed,
+7,
-2
+7,
-2
1@@ -1,8 +1,8 @@
2 const std = @import("std");
3
4 const linux_targets: []const std.Target.Query = &.{
5- .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .gnu },
6- .{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .gnu },
7+ .{ .cpu_arch = .x86_64, .os_tag = .linux, .abi = .musl },
8+ .{ .cpu_arch = .aarch64, .os_tag = .linux, .abi = .musl },
9 };
10
11 const macos_targets: []const std.Target.Query = &.{
12@@ -19,11 +19,15 @@ pub fn build(b: *std.Build) void {
13 const run_step = b.step("run", "Run the app");
14 const test_step = b.step("test", "Run unit tests");
15
16+ const options = b.addOptions();
17+ options.addOption([]const u8, "version", version);
18+
19 const exe_mod = b.createModule(.{
20 .root_source_file = b.path("src/main.zig"),
21 .target = target,
22 .optimize = optimize,
23 });
24+ exe_mod.addOptions("build_options", options);
25
26 // You'll want to use a lazy dependency here so that ghostty is only
27 // downloaded if you actually need it.
28@@ -97,6 +101,7 @@ pub fn build(b: *std.Build) void {
29 .target = resolved,
30 .optimize = .ReleaseSafe,
31 });
32+ release_mod.addOptions("build_options", options);
33
34 if (b.lazyDependency("ghostty", .{
35 .target = resolved,