Skip to content

Commit

Permalink
Update .codeql-prebuild-cpp-macOS.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed May 16, 2024
1 parent f4e5585 commit 53afdb7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .codeql-prebuild-cpp-macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ set -e

gcc_version=11

# set homebrew path based on architecture
if [ "$(uname -m)" = "arm64" ]; then
export BREW_PATH="/opt/homebrew"
else
export BREW_PATH="/usr/local"
fi

# install dependencies
brew install \
cmake \
Expand All @@ -12,8 +19,8 @@ brew install \
mkdir -p build
cd build || exit 1
cmake \
-DCMAKE_C_COMPILER="/opt/homebrew/bin/gcc-${gcc_version}" \
-DCMAKE_CXX_COMPILER="/opt/homebrew/bin/g++-${gcc_version}" \
-DCMAKE_C_COMPILER="${BREW_PATH}/bin/gcc-${gcc_version}" \
-DCMAKE_CXX_COMPILER="${BREW_PATH}/bin/g++-${gcc_version}" \
-G "Unix Makefiles" ..
make -j"$(sysctl -n hw.logicalcpu)"

Expand Down

0 comments on commit 53afdb7

Please sign in to comment.