Skip to content

Commit dffae4e

Browse files
committed
build-script: pass down the xcrun toolchain name to CMake, and to lit
1 parent eefc5df commit dffae4e

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ option(SWIFT_RUNTIME_CRASH_REPORTER_CLIENT
125125
"Whether to enable CrashReporter integration"
126126
FALSE)
127127

128+
set(SWIFT_DARWIN_XCRUN_TOOLCHAIN "XcodeDefault" CACHE STRING
129+
"The name of the toolchain to pass to 'xcrun'")
130+
128131
set(SWIFT_DARWIN_ICU_INCLUDE_PATH "" CACHE STRING
129132
"Path to the directory where the ICU headers are located")
130133

test/lit.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,8 @@ if run_vendor == 'apple':
447447
xcrun_sdk_name = "appletvsimulator"
448448

449449
xcrun_prefix = (
450-
"xcrun --toolchain XcodeDefault --sdk %s" %
451-
(xcrun_sdk_name, ))
450+
"xcrun --toolchain %s --sdk %s" %
451+
(config.darwin_xcrun_toolchain, xcrun_sdk_name))
452452
sdk_path = subprocess.check_output(
453453
[ "xcrun", "--sdk", xcrun_sdk_name, "--show-sdk-path" ]).rstrip()
454454
extra_frameworks_dir = os.path.join(
@@ -525,8 +525,8 @@ if run_vendor == 'apple':
525525

526526
xcrun_sdk_name = "macosx"
527527
xcrun_prefix = (
528-
"xcrun --toolchain XcodeDefault --sdk %s " %
529-
(xcrun_sdk_name, ))
528+
"xcrun --toolchain %s --sdk %s " %
529+
(config.darwin_xcrun_toolchain, xcrun_sdk_name))
530530
sdk_path = subprocess.check_output(
531531
[ "xcrun", "--sdk", xcrun_sdk_name, "--show-sdk-path" ]).rstrip()
532532
extra_frameworks_dir = os.path.join(

test/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ config.targets_to_build = "@TARGETS_TO_BUILD@"
1616
config.variant_triple = "@VARIANT_TRIPLE@"
1717
config.variant_sdk = "@VARIANT_SDK@"
1818
config.swiftlib_dir = "@LIT_SWIFTLIB_DIR@"
19+
config.darwin_xcrun_toolchain = "@SWIFT_DARWIN_XCRUN_TOOLCHAIN@"
1920

2021
if "@SWIFT_ASAN_BUILD@" == "TRUE":
2122
config.available_features.add("asan")

utils/build-script-impl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,6 +1463,11 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
14631463
)
14641464
fi
14651465

1466+
swift_cmake_options=(
1467+
"${swift_cmake_options[@]}"
1468+
-DSWIFT_DARWIN_XCRUN_TOOLCHAIN:STRING="${DARWIN_XCRUN_TOOLCHAIN}"
1469+
)
1470+
14661471
if [[ "${DARWIN_STDLIB_INSTALL_NAME_DIR}" ]] ; then
14671472
swift_cmake_options=(
14681473
"${swift_cmake_options[@]}"

validation-test/lit.site.cfg.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ config.target_triple = "@TARGET_TRIPLE@"
1414
config.targets_to_build = "@TARGETS_TO_BUILD@"
1515
config.variant_triple = "@VARIANT_TRIPLE@"
1616
config.variant_sdk = "@VARIANT_SDK@"
17+
config.darwin_xcrun_toolchain = "@SWIFT_DARWIN_XCRUN_TOOLCHAIN@"
1718

1819
if "@SWIFT_ASAN_BUILD@" == "TRUE":
1920
config.available_features.add("asan")

0 commit comments

Comments
 (0)