Skip to content

Commit 5b1bff8

Browse files
committed
[build] Add a new --cross-compile-build-swift-tools flag to disable cross-compiling the compiler
This is useful when building cross-compilation toolchains where you want the stdlib and corelibs cross-compiled but don't want the Swift compiler cross-compiled too with '--cross-compile-hosts'.
1 parent 7ac5516 commit 5b1bff8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utils/build-script-impl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ KNOWN_SETTINGS=(
292292
cross-compile-install-prefixes "" "semicolon-separated list of install prefixes to use for the cross-compiled hosts. The list expands, so if there are more cross-compile hosts than prefixes, unmatched hosts use the last prefix in the list"
293293
cross-compile-deps-path "" "path for CMake to look for cross-compiled library dependencies, such as libXML2"
294294
cross-compile-append-host-target-to-destdir "1" "turns on appending the host target name of each cross-compiled toolchain to its install-destdir, to keep them separate from the natively-built toolchain"
295+
cross-compile-build-swift-tools "1" "set to 1 to cross-compile the Swift host tools, like the Swift compiler"
295296
skip-merge-lipo-cross-compile-tools "" "set to skip running merge-lipo after installing cross-compiled host Swift tools"
296297
coverage-db "" "If set, coverage database to use when prioritizing testing"
297298
skip-local-host-install "" "If we are cross-compiling multiple targets, skip an install pass locally if the hosts match"
@@ -1693,6 +1694,12 @@ for host in "${ALL_HOSTS[@]}"; do
16931694
"${cmake_options[@]}"
16941695
-DLLVM_TABLEGEN=$(build_directory "${LOCAL_HOST}" llvm)/bin/llvm-tblgen
16951696
-DSWIFT_INCLUDE_TEST_BINARIES:BOOL=FALSE
1697+
-DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${CROSS_COMPILE_BUILD_SWIFT_TOOLS}")
1698+
)
1699+
else
1700+
cmake_options=(
1701+
"${cmake_options[@]}"
1702+
-DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${BUILD_SWIFT_TOOLS}")
16961703
)
16971704
fi
16981705

@@ -1765,7 +1772,6 @@ for host in "${ALL_HOSTS[@]}"; do
17651772
-DSWIFT_NATIVE_LLVM_TOOLS_PATH:STRING="${native_llvm_tools_path}"
17661773
-DSWIFT_NATIVE_CLANG_TOOLS_PATH:STRING="${native_clang_tools_path}"
17671774
-DSWIFT_NATIVE_SWIFT_TOOLS_PATH:STRING="${native_swift_tools_path}"
1768-
-DSWIFT_INCLUDE_TOOLS:BOOL=$(true_false "${BUILD_SWIFT_TOOLS}")
17691775
-DSWIFT_BUILD_CLANG_OVERLAYS:BOOL=$(true_false "${BUILD_SWIFT_CLANG_OVERLAYS}")
17701776
-DSWIFT_BUILD_REMOTE_MIRROR:BOOL=$(true_false "${BUILD_SWIFT_REMOTE_MIRROR}")
17711777
-DSWIFT_STDLIB_SIL_DEBUGGING:BOOL=$(true_false "${BUILD_SIL_DEBUGGING_STDLIB}")

0 commit comments

Comments
 (0)