Skip to content

Commit

Permalink
_build.sh: use CMAKE_IGNORE_PREFIX_PATH for macOS [ci skip]
Browse files Browse the repository at this point in the history
CMake has a feature to search `/usr/local` by default for dependencies.
Setting the SDK root is not suppressing this behaviour. Use this setting
instead for that purpose.

Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_IGNORE_PREFIX_PATH.html
  • Loading branch information
vszakats committed Jul 8, 2024
1 parent 1d0f3e8 commit b8faa90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions _build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,10 @@ build_single_target() {
# Minimum SDK version supported by Xcode releases:
# https://developer.apple.com/support/xcode/

# Explicitly set the SDK root. This forces clang to drop /usr/local
# from the list of default header search paths.
# Do not pick up components from these prefixes:
_CMAKE_GLOBAL+=" -DCMAKE_IGNORE_PREFIX_PATH=/usr/local;${brew_root}"

# Explicitly set the SDK root.
# We set it for all build tools for macOS to gain control over this.
_SYSROOT="$(xcrun -sdk macosx --show-sdk-path)" # E.g. /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

Expand Down

0 comments on commit b8faa90

Please sign in to comment.