@@ -30,12 +30,13 @@ umask 0022
3030# A default value of "" indicates that the corresponding variable
3131# will remain unset unless set explicitly.
3232#
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.
3637#
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).
3940#
4041# Each variable name is re-exported into this script in uppercase, where dashes
4142# are substituted by underscores. For example, `swift-install-components` is
@@ -118,6 +119,7 @@ KNOWN_SETTINGS=(
118119 swift-stdlib-build-type " Debug" " the CMake build variant for Swift"
119120
120121 # # Skip Build ...
122+ skip-build " " " set to configure as usual while skipping the build step"
121123 skip-build-android " " " set to skip building Swift stdlibs for Android"
122124 skip-build-benchmarks " " " set to skip building Swift Benchmark Suite"
123125 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
10411043 exit 1
10421044fi
10431045
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)
10481046[[ " ${SKIP_BUILD_CMARK} " ]] || PRODUCTS+=(cmark)
10491047[[ " ${SKIP_BUILD_LIBCXX} " ]] || PRODUCTS+=(libcxx)
10501048[[ " ${SKIP_BUILD_LIBICU} " ]] || PRODUCTS+=(libicu)
1049+ [[ " ${SKIP_BUILD_LLVM} " ]] || PRODUCTS+=(llvm)
10511050[[ " ${SKIP_BUILD_SWIFT} " ]] || PRODUCTS+=(swift)
10521051[[ " ${SKIP_BUILD_LLDB} " ]] || PRODUCTS+=(lldb)
10531052[[ " ${SKIP_BUILD_LIBDISPATCH} " ]] || PRODUCTS+=(libdispatch)
@@ -1406,7 +1405,6 @@ for host in "${ALL_HOSTS[@]}"; do
14061405 for product in " ${PRODUCTS[@]} " ; do
14071406 [[ $( should_execute_action " ${host} -${product/ _static} -build" ) ]] || continue
14081407
1409- unset skip_build
14101408 source_dir_var=" $( toupper ${product} ) _SOURCE_DIR"
14111409 source_dir=${! source_dir_var}
14121410 build_dir=$( build_directory ${host} ${product} )
@@ -1436,7 +1434,7 @@ for host in "${ALL_HOSTS[@]}"; do
14361434 if [ " ${BUILD_LLVM} " == " 0" ] ; then
14371435 build_targets=(clean)
14381436 fi
1439- if [ " ${SKIP_BUILD_LLVM } " ] ; then
1437+ if [ " ${SKIP_BUILD } " ] ; then
14401438 # We can't skip the build completely because the standalone
14411439 # build of Swift depend on these for building and testing.
14421440 build_targets=(llvm-tblgen clang-resource-headers intrinsics_gen clang-tablegen-targets)
@@ -2207,18 +2205,25 @@ for host in "${ALL_HOSTS[@]}"; do
22072205 fi
22082206
22092207 # 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
22202224
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
22222227
22232228 # When we are building LLVM copy over the compiler-rt
22242229 # builtins for iOS/tvOS/watchOS to ensure that Swift's
0 commit comments