Commit 936c1fa
Eric Bower
·
2026-05-16 10:47:25 -0400 EDT
parent 0a5a2a9
fix: statically link against musl
1 files changed,
+8,
-1
+8,
-1
1@@ -11,7 +11,13 @@ const macos_targets: []const std.Target.Query = &.{
2 };
3
4 pub fn build(b: *std.Build) void {
5- const target = b.standardTargetOptions(.{});
6+ const target = b.standardTargetOptions(.{
7+ .default_target = .{
8+ .cpu_arch = .x86_64,
9+ .os_tag = .linux,
10+ .abi = .musl,
11+ },
12+ });
13 const optimize = b.standardOptimizeOption(.{});
14 const version = b.option([]const u8, "version", "Version string for release") orelse
15 @as([]const u8, @import("build.zig.zon").version);
16@@ -71,6 +77,7 @@ pub fn build(b: *std.Build) void {
17 const exe_unit_tests = b.addTest(.{
18 .root_module = test_module,
19 });
20+ exe_unit_tests.linkLibC();
21 const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests);
22 test_step.dependOn(&run_exe_unit_tests.step);
23 }