From 483c2aec66a150578ee696716dbfc178d534afc1 Mon Sep 17 00:00:00 2001 From: Ultra-Code Date: Thu, 5 Dec 2024 12:20:23 +0000 Subject: [PATCH 1/2] fix(cross-compile): Detect the target os tag when setting is_macos and is_windows resolves allyourcodebase/lmdb#3 --- build.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index c5a55ff..d96d9b1 100644 --- a/build.zig +++ b/build.zig @@ -22,8 +22,8 @@ pub fn build(b: *Build) void { // writing WritingLibFiles isn't implemented on windows // and zld the only linker suppored on macos - const is_macos = builtin.os.tag == .macos; - const is_windows = builtin.os.tag == .windows; + const is_macos = builtin.os.tag == .macos or target.result.os.tag == .macos; + const is_windows = builtin.os.tag == .windows or target.result.os.tag == .windows; const use_lld = if (is_macos) false else if (is_windows) true else switch (optimize) { .Debug => false, else => true, From bda9bc0294a00f9217cc489a9ebc4abb9a242e0a Mon Sep 17 00:00:00 2001 From: Ultra-Code Date: Thu, 5 Dec 2024 12:56:26 +0000 Subject: [PATCH 2/2] CI: Add workflow test for allyourcodebase/lmdb#3 --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb024cf..8737d9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,11 @@ jobs: - name: Run `build` run: zig build ${{ matrix.build-options }} -Doptimize=${{ matrix.optimize }} --summary all + # Test allyourcodebase/lmdb#3 + - name: Run `build tools` + run: zig build tools -Dtarget=x86_64-macos-none --summary all + run: zig build tools -Dtarget=x86_64-windows-gnu --summary all + test: strategy: fail-fast: false