fix: use correct path for win
This commit is contained in:
parent
017be9dfda
commit
69faf52da7
2 changed files with 16 additions and 8 deletions
12
README.md
12
README.md
|
|
@ -52,12 +52,12 @@ const exe = b.addExecutable(.{
|
||||||
|
|
||||||
Prebuilt binaries are available for:
|
Prebuilt binaries are available for:
|
||||||
|
|
||||||
- aarch64-macos
|
- `aarch64-macos`
|
||||||
- x86_64-macos
|
- `x86_64-macos`
|
||||||
- aarch64-linux-gnu
|
- `aarch64-linux-gnu`
|
||||||
- x86_64-linux-gnu
|
- `x86_64-linux-gnu`
|
||||||
- x86_64-windows-gnu
|
- `x86_64-windows-gnu`
|
||||||
- aarch64-windows-gnu
|
- `aarch64-windows-gnu`
|
||||||
|
|
||||||
For unsupported platforms, the library will automatically build from source if the Rust toolchain is installed.
|
For unsupported platforms, the library will automatically build from source if the Rust toolchain is installed.
|
||||||
|
|
||||||
|
|
|
||||||
12
build.zig
12
build.zig
|
|
@ -21,8 +21,16 @@ pub fn build(b: *std.Build) !void {
|
||||||
// Determine target triple string for pre-built library lookup
|
// Determine target triple string for pre-built library lookup
|
||||||
const arch_str = @tagName(target.result.cpu.arch);
|
const arch_str = @tagName(target.result.cpu.arch);
|
||||||
const os_str = @tagName(target.result.os.tag);
|
const os_str = @tagName(target.result.os.tag);
|
||||||
const target_triple = b.fmt("{s}-{s}", .{ arch_str, os_str });
|
const abi = target.result.abi;
|
||||||
const lib_name = if (target.result.os.tag == .windows) "temporal_capi.lib" else "libtemporal_capi.a";
|
const abi_str = @tagName(abi);
|
||||||
|
const target_triple = if (abi == .none)
|
||||||
|
b.fmt("{s}-{s}", .{ arch_str, os_str })
|
||||||
|
else
|
||||||
|
b.fmt("{s}-{s}-{s}", .{ arch_str, os_str, abi_str });
|
||||||
|
const lib_name = if (target.result.os.tag == .windows and abi == .msvc)
|
||||||
|
"temporal_capi.lib"
|
||||||
|
else
|
||||||
|
"libtemporal_capi.a";
|
||||||
|
|
||||||
// Check if pre-built library exists in lib/<target>/
|
// Check if pre-built library exists in lib/<target>/
|
||||||
const prebuilt_lib_path = b.fmt("lib/{s}/{s}", .{ target_triple, lib_name });
|
const prebuilt_lib_path = b.fmt("lib/{s}/{s}", .{ target_triple, lib_name });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue