Skip to content

Commit 4ac6cb7

Browse files
committed
[build-script] Remove extra "cross tools" variable
We can use one variable here instead of two, in order to make the build script a little easier to read.
1 parent 5373ab2 commit 4ac6cb7

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

utils/build-script-impl

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ KNOWN_SETTINGS=(
187187
darwin-install-extract-symbols "" "whether to extract symbols with dsymutil during installations"
188188
host-target "" "The host target. LLVM, Clang, and Swift will be built for this target. The built LLVM and Clang will be used to compile Swift for the cross-compilation targets. **This argument is required**"
189189
stdlib-deployment-targets "" "space-separated list of targets to compile or cross-compile the Swift standard library for"
190-
cross-compile-tools-deployment-targets "" "space-separated list of targets to cross-compile host Swift tools for"
190+
cross-compile-tools-deployment-targets "" "space-separated list of targets to cross-compile host Swift tools for. We can't run the resulting binaries on the build machine"
191191
skip-merge-lipo-cross-compile-tools "" "set to skip running merge-lipo after installing cross-compiled host Swift tools"
192192
darwin-deployment-version-osx "10.9" "minimum deployment target version for OS X"
193193
darwin-deployment-version-ios "7.0" "minimum deployment target version for iOS"
@@ -493,7 +493,7 @@ function set_deployment_target_based_options() {
493493
)
494494
;;
495495
*)
496-
echo "Unknown deployment target"
496+
echo "Unknown deployment target: ${deployment_target}"
497497
exit 1
498498
;;
499499
esac
@@ -866,21 +866,14 @@ function make_relative_symlink() {
866866
ln -sf "${RELATIVE_SOURCE}" "${TARGET}"
867867
}
868868

869-
# A list of deployment targets to cross-compile the Swift host tools for.
870-
# We can't run the resulting binaries on the build machine.
871-
CROSS_TOOLS_DEPLOYMENT_TARGETS=()
872-
873869
# Sanitize the list of cross-compilation targets.
870+
CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS=($CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS)
874871
for t in ${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS} ; do
875872
case ${t} in
876873
iphonesimulator-i386 | iphonesimulator-x86_64 | \
877874
iphoneos-arm64 | iphoneos-armv7 | iphoneos-armv7s | \
878875
appletvos-arm64 | appletvsimulator-x86_64 | \
879876
watchos-armv7k | watchsimulator-i386)
880-
CROSS_TOOLS_DEPLOYMENT_TARGETS=(
881-
"${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
882-
"${t}"
883-
)
884877
;;
885878
*)
886879
echo "Unknown deployment target: ${t}"
@@ -891,7 +884,7 @@ done
891884

892885
function is_cross_tools_deployment_target() {
893886
local deployment_target="$1"
894-
for t in "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}" ; do
887+
for t in "${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS[@]}" ; do
895888
if [ "${deployment_target}" == "${t}" ] ; then
896889
echo 1
897890
fi
@@ -1453,7 +1446,7 @@ fi
14531446
# Configure and build each product
14541447
#
14551448
# Start with native deployment targets because the resulting tools are used during cross-compilation.
1456-
for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"; do
1449+
for deployment_target in "${HOST_TARGET}" "${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS[@]}"; do
14571450
set_deployment_target_based_options
14581451

14591452
case "${COMPILER_VENDOR}" in
@@ -2334,7 +2327,7 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
23342327
done
23352328
done
23362329

2337-
for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"; do
2330+
for deployment_target in "${HOST_TARGET}" "${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS[@]}"; do
23382331
set_deployment_target_based_options
23392332

23402333
for product in "${PRODUCTS[@]}"; do
@@ -2503,9 +2496,9 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"
25032496
done
25042497

25052498
if [[ "${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS}" ]] && [[ ! "${SKIP_MERGE_LIPO_CROSS_COMPILE_TOOLS}" ]] ; then
2506-
echo "--- Merging and running lipo for ${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]} ---"
2499+
echo "--- Merging and running lipo for ${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS[@]} ---"
25072500
lipo_src_dirs=()
2508-
for deployment_target in "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}"; do
2501+
for deployment_target in "${CROSS_COMPILE_TOOLS_DEPLOYMENT_TARGETS[@]}"; do
25092502
lipo_src_dirs=(
25102503
"${lipo_src_dirs[@]}"
25112504
"${BUILD_DIR}"/intermediate-install/"${deployment_target}"

0 commit comments

Comments
 (0)