Skip to content

Commit 353dcf2

Browse files
authored
Merge pull request #1683 from swiftwasm/maxd/fix-sdk-paths
Prioritize SDK paths in CMake find_ functions in 5.3 branch It looks like after actions/runner-images@ff1423c was deployed, the [SR-12726](https://bugs.swift.org/browse/SR-12726) bug is now reproducible on GitHub Actions. It was fixed in upstream `master`, but wasn't applied to upstream `release/5.3`, I'm re-applying it to the release branch here.
2 parents 524a9e7 + c900779 commit 353dcf2

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
@@ -658,6 +658,12 @@ function set_build_options_for_host() {
658658

659659
cmake_os_sysroot="$(xcrun --sdk ${platform} --show-sdk-path)"
660660

661+
# Give the SDK sysroot higher priority in calls to CMake `find_*`
662+
# functions, over paths that may come from `pkg-config`. This fixes
663+
# compile failures caused when `pkg-config` returns CommandLineTools
664+
# paths instead of Xcode paths.
665+
export CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:${cmake_os_sysroot}/usr"
666+
661667
cmark_cmake_options=(
662668
-DCMAKE_C_FLAGS="$(cmark_c_flags ${host})"
663669
-DCMAKE_CXX_FLAGS="$(cmark_c_flags ${host})"

0 commit comments

Comments
 (0)