From 0c760bcefe8088e150626d1b5f20ca2c4d4f6e95 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Thu, 27 Oct 2022 14:12:59 +0200 Subject: [PATCH] force usage brew llvm and omp on macos --- .github/workflows/MacOS.yml | 4 ++-- scripts/macOS/1_build.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/MacOS.yml b/.github/workflows/MacOS.yml index 3760fe208..ffc8376b3 100644 --- a/.github/workflows/MacOS.yml +++ b/.github/workflows/MacOS.yml @@ -20,7 +20,7 @@ jobs: submodules: recursive - name: Install dependencies run: | - brew install libomp cgal xerces-c + brew install llvm libomp cgal xerces-c npm install -g appdmg - name: Cache Qt id: cache-qt @@ -45,7 +45,7 @@ jobs: - name: Configure and Build shell: bash run: | - bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }} --nightly + bash scripts/${{ runner.os }}/1_build.sh --${{ matrix.precision }} --nightly --use_brew_llvm - name: Deploy shell: bash run: | diff --git a/scripts/macOS/1_build.sh b/scripts/macOS/1_build.sh index f205775df..41db6d2be 100644 --- a/scripts/macOS/1_build.sh +++ b/scripts/macOS/1_build.sh @@ -20,6 +20,7 @@ INSTALL_PATH=$SOURCE_PATH/../install CORES="-j4" DOUBLE_PRECISION_OPTION="" NIGHTLY_OPTION="" +USE_BREW_LLVM=false QT_DIR="" #check parameters @@ -50,6 +51,10 @@ case $i in QT_DIR=${i#*=} shift # past argument=value ;; + --use_brew_llvm) + USE_BREW_LLVM=true + shift # past argument=value + ;; *) # unknown option ;; @@ -68,6 +73,16 @@ then mkdir -p $INSTALL_PATH fi +if [ "$USE_BREW_LLVM" = true ] ; then + export PATH="$(brew --prefix llvm)/bin:$PATH"; + export CC=/usr/local/opt/llvm/bin/clang + export CXX=/usr/local/opt/llvm/bin/clang++ + export COMPILER=${CXX} + export CFLAGS="-I /usr/local/include -I/usr/local/opt/llvm/include" + export CXXFLAGS="-I /usr/local/include -I/usr/local/opt/llvm/include" + export LDFLAGS="-L /usr/local/lib -L/usr/local/opt/llvm/lib" +fi + cd $BUILD_PATH cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $DOUBLE_PRECISION_OPTION $NIGHTLY_OPTION $SOURCE_PATH make $CORES