From ef8ea6136136f5f751ab06c7becba45447c3b206 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Jul 2024 13:24:33 +0200 Subject: [PATCH] macos: try `CMAKE_IGNORE_PREFIX_PATH` --- _build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_build.sh b/_build.sh index 98c5044fb..7bfc53c08 100755 --- a/_build.sh +++ b/_build.sh @@ -842,6 +842,7 @@ build_single_target() { # NOTE: 10.8 (and older) trigger C++ issues with Xcode and CMake. macminver='10.9' _CMAKE_GLOBAL+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${macminver}" + # FIXME: This option might have been renamed to `-mmacos-version-min=`? _CFLAGS_GLOBAL+=" -mmacosx-version-min=${macminver}" _CXXFLAGS_GLOBAL+=" -mmacosx-version-min=${macminver}" _OSVER="$(printf '%02d%02d' \ @@ -1185,8 +1186,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 this prefix: + _CMAKE_GLOBAL+=" -DCMAKE_IGNORE_PREFIX_PATH=${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