@@ -1041,10 +1041,14 @@ if [[ ! "${SKIP_BUILD_PLAYGROUNDSUPPORT}" && ! -d ${PLAYGROUNDSUPPORT_SOURCE_DIR
1041
1041
exit 1
1042
1042
fi
1043
1043
1044
- PRODUCTS=(cmark llvm)
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
+ [[ " ${SKIP_BUILD_CMARK} " ]] || PRODUCTS+=(cmark)
1045
1049
[[ " ${SKIP_BUILD_LIBCXX} " ]] || PRODUCTS+=(libcxx)
1046
1050
[[ " ${SKIP_BUILD_LIBICU} " ]] || PRODUCTS+=(libicu)
1047
- PRODUCTS+=(swift)
1051
+ [[ " ${SKIP_BUILD_SWIFT} " ]] || PRODUCTS+=(swift)
1048
1052
[[ " ${SKIP_BUILD_LLDB} " ]] || PRODUCTS+=(lldb)
1049
1053
[[ " ${SKIP_BUILD_LIBDISPATCH} " ]] || PRODUCTS+=(libdispatch)
1050
1054
[[ " ${SKIP_BUILD_STATIC_LIBDISPATCH} " ]] || PRODUCTS+=(libdispatch_static)
@@ -1436,7 +1440,6 @@ for host in "${ALL_HOSTS[@]}"; do
1436
1440
-DCMAKE_BUILD_TYPE:STRING=" ${CMARK_BUILD_TYPE} "
1437
1441
" ${cmark_cmake_options[@]} "
1438
1442
)
1439
- skip_build=${SKIP_BUILD_CMARK}
1440
1443
build_targets=(all)
1441
1444
;;
1442
1445
@@ -1749,7 +1752,6 @@ for host in "${ALL_HOSTS[@]}"; do
1749
1752
build_targets=(" ${build_targets[@]} "
1750
1753
" ${SWIFT_BENCHMARK_TARGETS[@]} " )
1751
1754
fi
1752
- skip_build=${SKIP_BUILD_SWIFT}
1753
1755
;;
1754
1756
lldb)
1755
1757
if [ ! -d " ${LLDB_SOURCE_DIR} " ]; then
@@ -2216,48 +2218,46 @@ for host in "${ALL_HOSTS[@]}"; do
2216
2218
fi
2217
2219
2218
2220
# Build.
2219
- if [[ ! " ${skip_build} " ]]; then
2220
- if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
2221
- # Xcode generator uses "ALL_BUILD" instead of "all".
2222
- # Also, xcodebuild uses -target instead of bare names.
2223
- build_targets=(" ${build_targets[@]/ all/ ALL_BUILD} " )
2224
- build_targets=(" ${build_targets[@]/#/ ${BUILD_TARGET_FLAG} } " )
2225
-
2226
- # Xcode can't restart itself if it turns out we need to reconfigure.
2227
- # Do an advance build to handle that.
2228
- call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} )
2229
- fi
2221
+ if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
2222
+ # Xcode generator uses "ALL_BUILD" instead of "all".
2223
+ # Also, xcodebuild uses -target instead of bare names.
2224
+ build_targets=(" ${build_targets[@]/ all/ ALL_BUILD} " )
2225
+ build_targets=(" ${build_targets[@]/#/ ${BUILD_TARGET_FLAG} } " )
2226
+
2227
+ # Xcode can't restart itself if it turns out we need to reconfigure.
2228
+ # Do an advance build to handle that.
2229
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} )
2230
+ fi
2230
2231
2231
- call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2232
-
2233
- # When we are building LLVM copy over the compiler-rt
2234
- # builtins for iOS/tvOS/watchOS to ensure that Swift's
2235
- # stdlib can use compiler-rt builtins when targetting iOS/tvOS/watchOS.
2236
- if [[ " ${product} " = " llvm" ]] && [[ " ${BUILD_LLVM} " = " 1" ]] && [[ " $( uname -s) " = " Darwin" ]]; then
2237
- HOST_CXX_DIR=$( dirname " ${HOST_CXX} " )
2238
- HOST_LIB_CLANG_DIR=" ${HOST_CXX_DIR} /../lib/clang"
2239
- DEST_LIB_CLANG_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang"
2240
-
2241
- if [[ -d " ${HOST_LIB_CLANG_DIR} " ]] && [[ -d " ${DEST_LIB_CLANG_DIR} " ]]; then
2242
- DEST_CXX_BUILTINS_VERSION=$( ls " ${DEST_LIB_CLANG_DIR} " | awk ' {print $0}' )
2243
- DEST_BUILTINS_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang/$DEST_CXX_BUILTINS_VERSION /lib/darwin"
2244
-
2245
- if [[ -d " ${DEST_BUILTINS_DIR} " ]]; then
2246
- for HOST_CXX_BUILTINS_PATH in " ${HOST_LIB_CLANG_DIR} " /* ; do
2247
- HOST_CXX_BUILTINS_DIR=" ${HOST_CXX_BUILTINS_PATH} /lib/darwin"
2248
- echo " copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR} ."
2249
-
2250
- for OS in ios watchos tvos; do
2251
- LIB_NAME=" libclang_rt.$OS .a"
2252
- HOST_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$LIB_NAME "
2253
- if [[ -f " ${HOST_LIB_PATH} " ]]; then
2254
- call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${LIB_NAME} "
2255
- elif [[ " ${VERBOSE_BUILD} " ]]; then
2256
- echo " no file exists at ${HOST_LIB_PATH} "
2257
- fi
2258
- done
2232
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2233
+
2234
+ # When we are building LLVM copy over the compiler-rt
2235
+ # builtins for iOS/tvOS/watchOS to ensure that Swift's
2236
+ # stdlib can use compiler-rt builtins when targetting iOS/tvOS/watchOS.
2237
+ if [[ " ${product} " = " llvm" ]] && [[ " ${BUILD_LLVM} " = " 1" ]] && [[ " $( uname -s) " = " Darwin" ]]; then
2238
+ HOST_CXX_DIR=$( dirname " ${HOST_CXX} " )
2239
+ HOST_LIB_CLANG_DIR=" ${HOST_CXX_DIR} /../lib/clang"
2240
+ DEST_LIB_CLANG_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang"
2241
+
2242
+ if [[ -d " ${HOST_LIB_CLANG_DIR} " ]] && [[ -d " ${DEST_LIB_CLANG_DIR} " ]]; then
2243
+ DEST_CXX_BUILTINS_VERSION=$( ls " ${DEST_LIB_CLANG_DIR} " | awk ' {print $0}' )
2244
+ DEST_BUILTINS_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang/$DEST_CXX_BUILTINS_VERSION /lib/darwin"
2245
+
2246
+ if [[ -d " ${DEST_BUILTINS_DIR} " ]]; then
2247
+ for HOST_CXX_BUILTINS_PATH in " ${HOST_LIB_CLANG_DIR} " /* ; do
2248
+ HOST_CXX_BUILTINS_DIR=" ${HOST_CXX_BUILTINS_PATH} /lib/darwin"
2249
+ echo " copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR} ."
2250
+
2251
+ for OS in ios watchos tvos; do
2252
+ LIB_NAME=" libclang_rt.$OS .a"
2253
+ HOST_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$LIB_NAME "
2254
+ if [[ -f " ${HOST_LIB_PATH} " ]]; then
2255
+ call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${LIB_NAME} "
2256
+ elif [[ " ${VERBOSE_BUILD} " ]]; then
2257
+ echo " no file exists at ${HOST_LIB_PATH} "
2258
+ fi
2259
2259
done
2260
- fi
2260
+ done
2261
2261
fi
2262
2262
fi
2263
2263
fi
0 commit comments