@@ -377,7 +377,7 @@ function is_llvm_module_build_enabled() {
377
377
# Check if the named action should be run in the given script invocation.
378
378
function should_execute_action() {
379
379
local name=" $1 "
380
-
380
+
381
381
if [[ " ${ONLY_EXECUTE} " = " all" ]] ||
382
382
[[ " ${ONLY_EXECUTE} " = " ${name} " ]]; then
383
383
echo 1
@@ -413,7 +413,7 @@ function set_build_options_for_host() {
413
413
414
414
# Hosts which can be cross-compiled must specify:
415
415
# SWIFT_HOST_TRIPLE and llvm_target_arch (as well as usual HOST_VARIANT flags)
416
-
416
+
417
417
case ${host} in
418
418
freebsd-x86_64)
419
419
SWIFT_HOST_VARIANT=" freebsd"
@@ -517,7 +517,7 @@ function set_build_options_for_host() {
517
517
SWIFT_HOST_VARIANT=" iphonesimulator"
518
518
SWIFT_HOST_VARIANT_SDK=" IOS_SIMULATOR"
519
519
SWIFT_HOST_VARIANT_ARCH=" x86_64"
520
-
520
+
521
521
cmake_osx_deployment_target=" "
522
522
cmark_cmake_options=(
523
523
-DCMAKE_C_FLAGS=" $( cmark_c_flags ${host} ) "
@@ -535,7 +535,7 @@ function set_build_options_for_host() {
535
535
SWIFT_HOST_VARIANT=" iphoneos"
536
536
SWIFT_HOST_VARIANT_SDK=" IOS"
537
537
SWIFT_HOST_VARIANT_ARCH=" armv7"
538
-
538
+
539
539
cmake_osx_deployment_target=" "
540
540
cmark_cmake_options=(
541
541
-DCMAKE_C_FLAGS=" $( cmark_c_flags ${host} ) "
@@ -589,7 +589,7 @@ function set_build_options_for_host() {
589
589
SWIFT_HOST_VARIANT=" appletvsimulator"
590
590
SWIFT_HOST_VARIANT_SDK=" TVOS_SIMULATOR"
591
591
SWIFT_HOST_VARIANT_ARCH=" x86_64"
592
-
592
+
593
593
cmake_osx_deployment_target=" "
594
594
cmark_cmake_options=(
595
595
-DCMAKE_C_FLAGS=" $( cmark_c_flags ${host} ) "
@@ -1004,8 +1004,8 @@ function not() {
1004
1004
fi
1005
1005
}
1006
1006
1007
- function join {
1008
- local IFS=" $1 " ; shift ; echo " $* " ;
1007
+ function join {
1008
+ local IFS=" $1 " ; shift ; echo " $* " ;
1009
1009
}
1010
1010
1011
1011
function false_true() {
@@ -1091,7 +1091,7 @@ splitSemicolonDelimitedInstallPrefixes
1091
1091
1092
1092
function get_host_install_prefix() {
1093
1093
local host=" $1 "
1094
-
1094
+
1095
1095
if [[ $( is_cross_tools_host ${host} ) ]] && [[ ${# CROSS_COMPILE_INSTALL_PREFIXES[@]} -gt 0 ]]; then
1096
1096
1097
1097
# Find the host's index in CROSS_COMPILE_HOSTS.
@@ -1134,7 +1134,7 @@ function is_cross_tools_host() {
1134
1134
function should_include_host_in_lipo() {
1135
1135
local host=" $1 "
1136
1136
if [[ $( has_cross_compile_hosts) ]] && [[ -z " ${SKIP_MERGE_LIPO_CROSS_COMPILE_TOOLS} " ]]; then
1137
- case ${host} in
1137
+ case ${host} in
1138
1138
iphone* | appletv* | watch* )
1139
1139
echo 1
1140
1140
;;
@@ -1144,7 +1144,7 @@ function should_include_host_in_lipo() {
1144
1144
1145
1145
function host_has_darwin_symbols() {
1146
1146
local host=" $1 "
1147
- case ${host} in
1147
+ case ${host} in
1148
1148
macosx* | iphone* | appletv* | watch* )
1149
1149
echo 1
1150
1150
;;
@@ -1156,11 +1156,11 @@ function get_stdlib_targets_for_host() {
1156
1156
# FIXME: STDLIB_DEPLOYMENT_TARGETS argument assumed to apply when Host == Build
1157
1157
# Cross-compile Hosts are only built with their native standard libraries.
1158
1158
# To fix this, we would need to pass in a list of stdlib targets _per host_,
1159
- # and the SWIFT_SDKS parameters would need to be able to capture both the SDK
1159
+ # and the SWIFT_SDKS parameters would need to be able to capture both the SDK
1160
1160
# and architecture of each stdlib target -- currently it only captures the SDK.
1161
1161
#
1162
1162
# We turn these targets in to SWIFT_SDKS in `calculate_targets_for_host()`
1163
-
1163
+
1164
1164
if [[ $( is_cross_tools_host $1 ) ]] ; then
1165
1165
echo " $1 "
1166
1166
else
@@ -1299,7 +1299,7 @@ function get_host_specific_variable() {
1299
1299
1300
1300
function calculate_targets_for_host() {
1301
1301
local host=$1
1302
-
1302
+
1303
1303
SWIFT_STDLIB_TARGETS=()
1304
1304
SWIFT_SDKS=()
1305
1305
SWIFT_BENCHMARK_TARGETS=()
@@ -1696,7 +1696,7 @@ function cmake_config_opt() {
1696
1696
;;
1697
1697
foundation)
1698
1698
echo " --config ${FOUNDATION_BUILD_TYPE} "
1699
- ;;
1699
+ ;;
1700
1700
libdispatch)
1701
1701
;;
1702
1702
libicu)
@@ -2019,7 +2019,7 @@ for host in "${ALL_HOSTS[@]}"; do
2019
2019
-DCLANG_TOOL_CLANG_FORMAT_BUILD=NO
2020
2020
)
2021
2021
fi
2022
-
2022
+
2023
2023
if [[ $( true_false " ${LLVM_INCLUDE_TESTS} " ) == " FALSE" ]]; then
2024
2024
cmake_options+=(
2025
2025
-DLLVM_INCLUDE_TESTS=NO
@@ -2362,21 +2362,21 @@ for host in "${ALL_HOSTS[@]}"; do
2362
2362
swiftpm)
2363
2363
set_swiftpm_bootstrap_command
2364
2364
call " ${swiftpm_bootstrap_command[@]} "
2365
-
2365
+
2366
2366
# swiftpm installs itself with a bootstrap method. No further cmake building is performed.
2367
2367
continue
2368
2368
;;
2369
2369
xctest)
2370
2370
SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2371
2371
XCTEST_BUILD_DIR=$( build_directory ${host} xctest)
2372
2372
FOUNDATION_BUILD_DIR=$( build_directory ${host} foundation)
2373
-
2373
+
2374
2374
# Staging: require opt-in for building with dispatch
2375
2375
if [[ ! " ${SKIP_BUILD_LIBDISPATCH} " ]] ; then
2376
2376
LIBDISPATCH_BUILD_DIR=" $( build_directory ${host} libdispatch) "
2377
2377
LIBDISPATCH_BUILD_ARGS=" --libdispatch-src-dir=${LIBDISPATCH_SOURCE_DIR} --libdispatch-build-dir=${LIBDISPATCH_BUILD_DIR} "
2378
2378
fi
2379
-
2379
+
2380
2380
# Use XCTEST_BUILD_TYPE to build either --debug or --release.
2381
2381
if [[ " ${XCTEST_BUILD_TYPE} " == " Debug" ]] ; then
2382
2382
XCTEST_BUILD_ARGS=" --debug"
@@ -2414,7 +2414,7 @@ for host in "${ALL_HOSTS[@]}"; do
2414
2414
SWIFT_USE_LINKER=" -fuse-ld=gold"
2415
2415
fi
2416
2416
2417
- # FIXME CROSSCOMPILING:
2417
+ # FIXME CROSSCOMPILING:
2418
2418
# Foundation is a target library (like the Swift standard library),
2419
2419
# so technically we should build it for all stdlib_targets, not just for the host.
2420
2420
# However, we only have the triple and sysroot for the host.
@@ -2431,7 +2431,7 @@ for host in "${ALL_HOSTS[@]}"; do
2431
2431
echo " Skipping Foundation on OS X -- use the Xcode project instead"
2432
2432
continue
2433
2433
fi
2434
-
2434
+
2435
2435
with_pushd " ${FOUNDATION_SOURCE_DIR} " \
2436
2436
call env SWIFTC=" ${SWIFTC_BIN} " CLANG=" ${LLVM_BIN} " /clang SWIFT=" ${SWIFT_BIN} " \
2437
2437
SDKROOT=" ${SWIFT_BUILD_PATH} " BUILD_DIR=" ${build_dir} " DSTROOT=" $( get_host_install_destdir ${host} ) " PREFIX=" $( get_host_install_prefix ${host} ) " ./configure " ${FOUNDATION_BUILD_TYPE} " ${FOUNDATION_BUILD_ARGS[@]} -DXCTEST_BUILD_DIR=${XCTEST_BUILD_DIR} $LIBDISPATCH_BUILD_ARGS
@@ -2762,7 +2762,7 @@ for host in "${ALL_HOSTS[@]}"; do
2762
2762
# Use the clang that was just built in the tree.
2763
2763
LLDB_DOTEST_CC_OPTS=" -C $( build_directory $LOCAL_HOST llvm) " /bin/clang
2764
2764
fi
2765
-
2765
+
2766
2766
call mkdir -p " ${results_dir} "
2767
2767
with_pushd " ${results_dir} " \
2768
2768
call env SWIFTCC=" $( build_directory $LOCAL_HOST swift) /bin/swiftc" \
@@ -2954,7 +2954,7 @@ for host in "${ALL_HOSTS[@]}"; do
2954
2954
# Calculate the directory to install products in to.
2955
2955
host_install_destdir=$( get_host_install_destdir ${host} )
2956
2956
host_install_prefix=$( get_host_install_prefix ${host} )
2957
-
2957
+
2958
2958
if [[ $( should_include_host_in_lipo ${host} ) ]]; then
2959
2959
LIPO_SRC_DIRS+=( " ${host_install_destdir} " )
2960
2960
fi
@@ -3264,7 +3264,7 @@ function build_and_test_installable_package() {
3264
3264
3265
3265
# Get the directory where the products where installed.
3266
3266
# If INSTALL_DESTDIR not given, we couldn't have installed anything.
3267
-
3267
+
3268
3268
if [[ -z " ${INSTALL_DESTDIR} " ]] ; then
3269
3269
echo " --install-destdir required to build a package. Skipping."
3270
3270
return
@@ -3316,14 +3316,14 @@ function build_and_test_installable_package() {
3316
3316
3317
3317
if [[ " ${DARWIN_TOOLCHAIN_APPLICATION_CERT} " ]] ; then
3318
3318
echo " -- Codesign xctoolchain --"
3319
- call " ${SWIFT_SOURCE_DIR} /utils/toolchain-codesign" " ${DARWIN_TOOLCHAIN_APPLICATION_CERT} " " ${host_install_destdir}${TOOLCHAIN_PREFIX} /"
3319
+ call " ${SWIFT_SOURCE_DIR} /utils/toolchain-codesign" " ${DARWIN_TOOLCHAIN_APPLICATION_CERT} " " ${host_install_destdir}${TOOLCHAIN_PREFIX} /"
3320
3320
fi
3321
3321
if [[ " ${DARWIN_TOOLCHAIN_INSTALLER_PACKAGE} " ]] ; then
3322
3322
echo " -- Create Installer --"
3323
3323
call " ${SWIFT_SOURCE_DIR} /utils/toolchain-installer" " ${host_install_destdir}${TOOLCHAIN_PREFIX} /" " ${DARWIN_TOOLCHAIN_BUNDLE_IDENTIFIER} " \
3324
3324
" ${DARWIN_TOOLCHAIN_INSTALLER_CERT} " " ${DARWIN_TOOLCHAIN_INSTALLER_PACKAGE} " " ${DARWIN_TOOLCHAIN_INSTALL_LOCATION} " \
3325
3325
" ${DARWIN_TOOLCHAIN_VERSION} " " ${SWIFT_SOURCE_DIR} /utils/darwin-installer-scripts"
3326
- fi
3326
+ fi
3327
3327
3328
3328
# host_install_destdir contains the toolchain prefix.
3329
3329
# We want to create the package in host_install_destdir_nonprefixed.
@@ -3366,32 +3366,32 @@ function build_and_test_installable_package() {
3366
3366
3367
3367
# Build and test packages.
3368
3368
for host in " ${ALL_HOSTS[@]} " ; do
3369
-
3369
+
3370
3370
# Check if we should perform this action.
3371
3371
if ! [[ $( should_execute_action " ${host} -package" ) ]]; then
3372
3372
continue
3373
3373
fi
3374
-
3374
+
3375
3375
if [[ $( should_include_host_in_lipo ${host} ) ]]; then
3376
3376
continue
3377
- fi
3378
-
3377
+ fi
3378
+
3379
3379
build_and_test_installable_package ${host}
3380
3380
done
3381
3381
3382
3382
# Lipo those products which require it, optionally build and test an installable package.
3383
3383
if [[ ${# LIPO_SRC_DIRS[@]} -gt 0 ]]; then
3384
- # This is from multiple hosts; Which host should we say it is?
3384
+ # This is from multiple hosts; Which host should we say it is?
3385
3385
# Let's call it 'merged-hosts' so that we can identify it.
3386
3386
mergedHost=" merged-hosts"
3387
-
3387
+
3388
3388
# Check if we should perform this action.
3389
3389
if ! [[ $( should_execute_action " ${mergedHost} -lipo" ) ]]; then
3390
3390
continue
3391
3391
fi
3392
-
3392
+
3393
3393
echo " --- Merging and running lipo ---"
3394
-
3394
+
3395
3395
# Allow passing lipo with --host-lipo
3396
3396
if [[ -z " ${HOST_LIPO} " ]] ; then
3397
3397
LIPO_PATH=$( xcrun_find_tool lipo)
0 commit comments