diff --git a/README.md b/README.md index fa0ae82..ba8af24 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,12 @@ const exe = b.addExecutable(.{ Prebuilt binaries are available for: -- aarch64-macos -- x86_64-macos -- aarch64-linux-gnu -- x86_64-linux-gnu -- x86_64-windows-gnu -- aarch64-windows-gnu +- `aarch64-macos` +- `x86_64-macos` +- `aarch64-linux-gnu` +- `x86_64-linux-gnu` +- `x86_64-windows-gnu` +- `aarch64-windows-gnu` For unsupported platforms, the library will automatically build from source if the Rust toolchain is installed. diff --git a/build.zig b/build.zig index 9c941f6..62c2272 100644 --- a/build.zig +++ b/build.zig @@ -21,8 +21,16 @@ pub fn build(b: *std.Build) !void { // Determine target triple string for pre-built library lookup const arch_str = @tagName(target.result.cpu.arch); const os_str = @tagName(target.result.os.tag); - const target_triple = b.fmt("{s}-{s}", .{ arch_str, os_str }); - const lib_name = if (target.result.os.tag == .windows) "temporal_capi.lib" else "libtemporal_capi.a"; + const abi = target.result.abi; + 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// const prebuilt_lib_path = b.fmt("lib/{s}/{s}", .{ target_triple, lib_name });