Skip to content

Commit c71ed97

Browse files
committed
[build-script] Prioritize SDK paths in CMake find_ functions
1 parent 16c9c00 commit c71ed97

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

utils/build-script-impl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,12 @@ function set_build_options_for_host() {
584584

585585
cmake_os_sysroot="$(xcrun --sdk ${platform} --show-sdk-path)"
586586

587+
# Give the SDK sysroot higher priority in calls to CMake `find_*`
588+
# functions, over paths that may come from `pkg-config`. This fixes
589+
# compile failures caused when `pkg-config` returns CommandLineTools
590+
# paths instead of Xcode paths.
591+
export CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${cmake_os_sysroot}/usr"
592+
587593
cmark_cmake_options=(
588594
-DCMAKE_C_FLAGS="$(cmark_c_flags ${host})"
589595
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"

0 commit comments

Comments
 (0)