File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -584,6 +584,17 @@ function set_build_options_for_host() {
584
584
585
585
cmake_os_sysroot=" $( xcrun --sdk ${platform} --show-sdk-path) "
586
586
587
+ # Customize the CMake `find_*` search paths to search the SDK
588
+ # sysroot before searching `pkg-config` paths. This prevents compile
589
+ # failures caused when `pkg-config` returns CommandLineTools paths
590
+ # instead of Xcode paths.
591
+ #
592
+ # These search paths can be user customized either by setting the
593
+ # `CMAKE_PREFIX_PATH` environment variable, or by setting the same
594
+ # CMake variable via the command line (`-DCMAKE_PREFIX_PATH`).
595
+ # See https://cmake.org/cmake/help/latest/command/find_path.html
596
+ export CMAKE_PREFIX_PATH=" ${CMAKE_PREFIX_PATH} :${cmake_os_sysroot} /usr"
597
+
587
598
cmark_cmake_options=(
588
599
-DCMAKE_C_FLAGS=" $( cmark_c_flags ${host} ) "
589
600
-DCMAKE_CXX_FLAGS=" $( cmark_c_flags ${host} ) "
You can’t perform that action at this time.
0 commit comments