From 2448699eabfdfcea0a71cad2a66222846d3cf368 Mon Sep 17 00:00:00 2001 From: Congyu WANG Date: Sat, 2 Nov 2024 18:12:40 +0800 Subject: [PATCH] attempt to fix macos build --- .github/workflows/CI.yml | 4 ++-- .github/workflows/PR.yml | 4 ++-- justfile | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 036fad0..d9712ed 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -40,8 +40,8 @@ jobs: export CC=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang export CXX=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang++ export AR=${HOMEBREW_PREFIX}/opt/llvm@19/bin/llvm-ar - export CFLAGS="-flto=thin -O3" - export CXXFLAGS="-flto=thin -O3" + export CFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" + export CXXFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" export LLD=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld export RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${LLD}" maturin build --release --target aarch64-apple-darwin --out dist -i ${{ matrix.py_version }} diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 2f2f14d..e546fcf 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -40,8 +40,8 @@ jobs: export CC=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang export CXX=${HOMEBREW_PREFIX}/opt/llvm@19/bin/clang++ export AR=${HOMEBREW_PREFIX}/opt/llvm@19/bin/llvm-ar - export CFLAGS="-flto=thin -O3" - export CXXFLAGS="-flto=thin -O3" + export CFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" + export CXXFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" export LLD=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld export RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${LLD}" maturin build --release --target aarch64-apple-darwin --out dist -i ${{ matrix.py_version }} diff --git a/justfile b/justfile index 727bcb0..275faa3 100644 --- a/justfile +++ b/justfile @@ -8,8 +8,8 @@ develop: CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang \ CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++ \ AR=${HOMEBREW_PREFIX}/opt/llvm/bin/llvm-ar \ - CFLAGS="-flto=thin -O3" \ - CXXFLAGS="-flto=thin -O3" \ + CFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \ + CXXFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \ RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld" \ maturin develop --release --verbose @@ -20,8 +20,8 @@ build: CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang \ CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++ \ AR=${HOMEBREW_PREFIX}/opt/llvm/bin/llvm-ar \ - CFLAGS="-flto=thin -O3" \ - CXXFLAGS="-flto=thin -O3" \ + CFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \ + CXXFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \ RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld" \ maturin build --release --verbose @@ -30,7 +30,7 @@ bin: CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang \ CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++ \ AR=${HOMEBREW_PREFIX}/opt/llvm/bin/llvm-ar \ - CFLAGS="-flto=thin -O3" \ - CXXFLAGS="-flto=thin -O3" \ + CFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \ + CXXFLAGS="-flto=thin -O3 --config-system-dir=${HOMEBREW_PREFIX}/etc/clang" \ RUSTFLAGS="-Clinker-plugin-lto -Clinker=$PWD/macos-linker.sh -Clink-arg=-fuse-ld=${HOMEBREW_PREFIX}/opt/lld/bin/ld64.lld" \ cargo build --release --bin create_cf_db