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 diff --git a/build.zig b/build.zig index 7283858..b2aa97e 100644 --- a/build.zig +++ b/build.zig @@ -20,10 +20,11 @@ pub fn build(b: *Build) void { const strip = b.option(bool, "strip", "Strip debug information") orelse false; const lto = b.option(bool, "lto", "Enable link time optimization") orelse false; - // writing WritingLibFiles isn't implemented on windows - // and zld the only linker supported 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; + + // writing WritingLibFiles in zld isn't implemented on windows + // and zld is the only linker suppored on macos const use_lld = if (is_macos) false else if (is_windows) true else switch (optimize) { .Debug => false, else => true,