fix: missed linking libc

This commit is contained in:
Nurul Huda (Apon) 2026-07-16 07:07:12 +06:00
parent 5b3cacdb3b
commit b4b0aac7da
No known key found for this signature in database
GPG key ID: 5D3F1DE2855A2F79
3 changed files with 5 additions and 1 deletions

View file

@ -57,7 +57,7 @@ pub fn build(b: *std.Build) !void {
.mode = .simple, .mode = .simple,
}, },
}); });
mod_tests.root_module.link_libc = target.result.os.tag == .freestanding; mod_tests.root_module.link_libc = target.result.os.tag != .freestanding;
test_step.dependOn(&b.addRunArtifact(mod_tests).step); test_step.dependOn(&b.addRunArtifact(mod_tests).step);
} }
} }

View file

@ -21,10 +21,12 @@ pub fn build(b: *std.Build) !void {
"libtemporal_capi.a"; "libtemporal_capi.a";
// --- Module --- // // --- Module --- //
const is_freestanding = target.result.os.tag == .freestanding;
const mod = b.addModule("libtemporal", .{ const mod = b.addModule("libtemporal", .{
.root_source_file = b.path("src/root.zig"), .root_source_file = b.path("src/root.zig"),
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.link_libc = !is_freestanding,
}); });
const temporal_rs = b.dependency("temporal_rs", .{ const temporal_rs = b.dependency("temporal_rs", .{

View file

@ -15,10 +15,12 @@ pub fn build(b: *std.Build) void {
.root_source_file = b.path(if (is_freestanding) "src/wasm.zig" else "src/main.zig"), .root_source_file = b.path(if (is_freestanding) "src/wasm.zig" else "src/main.zig"),
.target = target, .target = target,
.optimize = optimize, .optimize = optimize,
.link_libc = !is_freestanding,
.imports = &.{}, .imports = &.{},
}), }),
}); });
exe.root_module.addImport("temporalz", temporalz.module("temporalz")); exe.root_module.addImport("temporalz", temporalz.module("temporalz"));
exe.rdynamic = is_freestanding;
b.installArtifact(exe); b.installArtifact(exe);
b.enable_wasmtime = true; // This doesn't work since Zig 0.17.0 release b.enable_wasmtime = true; // This doesn't work since Zig 0.17.0 release