@@ -30,12 +30,13 @@ umask 0022
30
30
# A default value of "" indicates that the corresponding variable
31
31
# will remain unset unless set explicitly.
32
32
#
33
- # skip-* parameters do not affect the configuration (CMake parameters).
34
- # You can turn them on and off in different invocations of the script for the
35
- # same build directory.
33
+ # The --skip-build parameter, with no product name, does not affect the
34
+ # configuration (CMake parameters). You can turn this option on and
35
+ # off in different invocations of the script for the same build
36
+ # directory without affecting configutation.
36
37
#
37
- # build-* parameters affect the CMake configuration (enable/disable those
38
- # components).
38
+ # skip- build-* and build-* parameters affect the CMake configuration
39
+ # (enable/disable those components).
39
40
#
40
41
# Each variable name is re-exported into this script in uppercase, where dashes
41
42
# are substituted by underscores. For example, `swift-install-components` is
@@ -118,6 +119,7 @@ KNOWN_SETTINGS=(
118
119
swift-stdlib-build-type " Debug" " the CMake build variant for Swift"
119
120
120
121
# # Skip Build ...
122
+ skip-build " " " set to configure as usual while skipping the build step"
121
123
skip-build-android " " " set to skip building Swift stdlibs for Android"
122
124
skip-build-benchmarks " " " set to skip building Swift Benchmark Suite"
123
125
skip-build-clang-tools-extra " " " set to skip building clang-tools-extra as part of llvm"
@@ -1041,13 +1043,10 @@ if [[ ! "${SKIP_BUILD_PLAYGROUNDSUPPORT}" && ! -d ${PLAYGROUNDSUPPORT_SOURCE_DIR
1041
1043
exit 1
1042
1044
fi
1043
1045
1044
- # We cannot currently apply the normal rules of skipping here for LLVM. Even if
1045
- # we are skipping building LLVM, we still need to at least build several tools
1046
- # that swift relies on for building and testing. See the LLVM configure rules.
1047
- PRODUCTS=(llvm)
1048
1046
[[ " ${SKIP_BUILD_CMARK} " ]] || PRODUCTS+=(cmark)
1049
1047
[[ " ${SKIP_BUILD_LIBCXX} " ]] || PRODUCTS+=(libcxx)
1050
1048
[[ " ${SKIP_BUILD_LIBICU} " ]] || PRODUCTS+=(libicu)
1049
+ [[ " ${SKIP_BUILD_LLVM} " ]] || PRODUCTS+=(llvm)
1051
1050
[[ " ${SKIP_BUILD_SWIFT} " ]] || PRODUCTS+=(swift)
1052
1051
[[ " ${SKIP_BUILD_LLDB} " ]] || PRODUCTS+=(lldb)
1053
1052
[[ " ${SKIP_BUILD_LIBDISPATCH} " ]] || PRODUCTS+=(libdispatch)
@@ -1406,7 +1405,6 @@ for host in "${ALL_HOSTS[@]}"; do
1406
1405
for product in " ${PRODUCTS[@]} " ; do
1407
1406
[[ $( should_execute_action " ${host} -${product/ _static} -build" ) ]] || continue
1408
1407
1409
- unset skip_build
1410
1408
source_dir_var=" $( toupper ${product} ) _SOURCE_DIR"
1411
1409
source_dir=${! source_dir_var}
1412
1410
build_dir=$( build_directory ${host} ${product} )
@@ -1436,7 +1434,7 @@ for host in "${ALL_HOSTS[@]}"; do
1436
1434
if [ " ${BUILD_LLVM} " == " 0" ] ; then
1437
1435
build_targets=(clean)
1438
1436
fi
1439
- if [ " ${SKIP_BUILD_LLVM } " ] ; then
1437
+ if [ " ${SKIP_BUILD } " ] ; then
1440
1438
# We can't skip the build completely because the standalone
1441
1439
# build of Swift depend on these for building and testing.
1442
1440
build_targets=(llvm-tblgen clang-resource-headers intrinsics_gen clang-tablegen-targets)
@@ -2207,18 +2205,25 @@ for host in "${ALL_HOSTS[@]}"; do
2207
2205
fi
2208
2206
2209
2207
# Build.
2210
- if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
2211
- # Xcode generator uses "ALL_BUILD" instead of "all".
2212
- # Also, xcodebuild uses -target instead of bare names.
2213
- build_targets=(" ${build_targets[@]/ all/ ALL_BUILD} " )
2214
- build_targets=(" ${build_targets[@]/#/ ${BUILD_TARGET_FLAG} } " )
2215
-
2216
- # Xcode can't restart itself if it turns out we need to reconfigure.
2217
- # Do an advance build to handle that.
2218
- call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} )
2219
- fi
2208
+ #
2209
+ # Even if builds are skipped, Swift configuration relies on
2210
+ # some LLVM tools like TableGen. In the LLVM configure rules
2211
+ # above, a small subset of LLVM build_targets are selected
2212
+ # when SKIP_BUILD is set.
2213
+ if [[ $( not ${SKIP_BUILD} ) || " ${product} " == " llvm" ]]; then
2214
+ if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
2215
+ # Xcode generator uses "ALL_BUILD" instead of "all".
2216
+ # Also, xcodebuild uses -target instead of bare names.
2217
+ build_targets=(" ${build_targets[@]/ all/ ALL_BUILD} " )
2218
+ build_targets=(" ${build_targets[@]/#/ ${BUILD_TARGET_FLAG} } " )
2219
+
2220
+ # Xcode can't restart itself if it turns out we need to reconfigure.
2221
+ # Do an advance build to handle that.
2222
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} )
2223
+ fi
2220
2224
2221
- call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2225
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2226
+ fi
2222
2227
2223
2228
# When we are building LLVM copy over the compiler-rt
2224
2229
# builtins for iOS/tvOS/watchOS to ensure that Swift's
0 commit comments