From 51691d2ad6dd91f8ca7c8e06ab28e21489e19d09 Mon Sep 17 00:00:00 2001 From: Jarle Aase Date: Thu, 30 Jan 2025 23:12:30 +0200 Subject: [PATCH] Trying universal build --- .github/workflows/build_macos-universal.yaml | 33 ++++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_macos-universal.yaml b/.github/workflows/build_macos-universal.yaml index 9b44a34..5ed1efc 100644 --- a/.github/workflows/build_macos-universal.yaml +++ b/.github/workflows/build_macos-universal.yaml @@ -16,14 +16,14 @@ jobs: with: submodules: true - - name: Install x86_64 Homebrew (if missing) - run: | - if [[ ! -d "/usr/local/Homebrew" ]]; then - echo "Installing Homebrew for x86_64..." - arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - else - echo "x86_64 Homebrew already installed." - fi + # - name: Install x86_64 Homebrew (if missing) + # run: | + # if [[ ! -d "/usr/local/Homebrew" ]]; then + # echo "Installing Homebrew for x86_64..." + # arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + # else + # echo "x86_64 Homebrew already installed." + # fi - name: Install Dependencies run: | @@ -31,12 +31,19 @@ jobs: brew update brew install cmake ninja llvm - # Install Boost separately for each architecture - echo "Installing Boost for arm64..." - brew install boost + - name: Install Universal Boost + run: | + # Remove existing Boost installations + brew uninstall --ignore-dependencies boost || true + + # Compile Boost for both x86_64 and arm64 + brew install boost --build-from-source --formula \ + CXXFLAGS="-arch x86_64 -arch arm64" \ + CFLAGS="-arch x86_64 -arch arm64" \ + LDFLAGS="-arch x86_64 -arch arm64" - echo "Installing Boost for x86_64..." - arch -x86_64 /usr/local/bin/brew install boost + # Verify Boost architecture + file $(brew --prefix boost)/lib/libboost_system.dylib - name: Configure Build run: |