From 3e2189463f7541df87a8710043ba3322ce5e581b Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Tue, 28 Jan 2025 20:56:42 +0100 Subject: [PATCH] static link MoltenVK (#196) * static link MoltenVK * static link MoltenVK * test * test * test * test * test * test * test * test * test * test * test * test * test --- .github/workflows/build.yml | 3 +++ build.rs | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3edbb7d..22dd9d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,12 +82,15 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive + - name: Set up Homebrew + uses: Homebrew/actions/setup-homebrew@master - uses: actions-rust-lang/setup-rust-toolchain@v1 with: target: ${{ matrix.target }} rustflags: "" - name: Build run: | + brew install molten-vk cargo build --release -v --target=${{ matrix.target }} - name: Upload file uses: actions/upload-artifact@v4 diff --git a/build.rs b/build.rs index 7141145..807dcd3 100644 --- a/build.rs +++ b/build.rs @@ -158,4 +158,12 @@ fn main() { simd_build.include("."); simd_build.compile("simd"); } + + if os == "macos" { + // Add Homebrew lib path for Apple Silicon Macs + println!("cargo:rustc-link-search=native=/opt/homebrew/lib"); + // Add Homebrew lib path for Intel Macs + println!("cargo:rustc-link-search=native=/usr/local/lib"); + println!("cargo:rustc-link-lib=static=MoltenVK"); + } }