fix: missed linking libc
This commit is contained in:
parent
5b3cacdb3b
commit
b4b0aac7da
3 changed files with 5 additions and 1 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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", .{
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue