@@ -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
@@ -1761,7 +1764,6 @@ for host in "${ALL_HOSTS[@]}"; do
1761
1764
build_targets=(" ${build_targets[@]} "
1762
1765
" ${SWIFT_BENCHMARK_TARGETS[@]} " )
1763
1766
fi
1764
- skip_build=${SKIP_BUILD_SWIFT}
1765
1767
;;
1766
1768
lldb)
1767
1769
if [ ! -d " ${LLDB_SOURCE_DIR} " ]; then
@@ -2228,48 +2230,46 @@ for host in "${ALL_HOSTS[@]}"; do
2228
2230
fi
2229
2231
2230
2232
# Build.
2231
- if [[ ! " ${skip_build} " ]]; then
2232
- if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
2233
- # Xcode generator uses "ALL_BUILD" instead of "all".
2234
- # Also, xcodebuild uses -target instead of bare names.
2235
- build_targets=(" ${build_targets[@]/ all/ ALL_BUILD} " )
2236
- build_targets=(" ${build_targets[@]/#/ ${BUILD_TARGET_FLAG} } " )
2237
-
2238
- # Xcode can't restart itself if it turns out we need to reconfigure.
2239
- # Do an advance build to handle that.
2240
- call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} )
2241
- fi
2233
+ if [[ " ${CMAKE_GENERATOR} " == " Xcode" ]] ; then
2234
+ # Xcode generator uses "ALL_BUILD" instead of "all".
2235
+ # Also, xcodebuild uses -target instead of bare names.
2236
+ build_targets=(" ${build_targets[@]/ all/ ALL_BUILD} " )
2237
+ build_targets=(" ${build_targets[@]/#/ ${BUILD_TARGET_FLAG} } " )
2238
+
2239
+ # Xcode can't restart itself if it turns out we need to reconfigure.
2240
+ # Do an advance build to handle that.
2241
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} )
2242
+ fi
2242
2243
2243
- call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2244
-
2245
- # When we are building LLVM copy over the compiler-rt
2246
- # builtins for iOS/tvOS/watchOS to ensure that Swift's
2247
- # stdlib can use compiler-rt builtins when targetting iOS/tvOS/watchOS.
2248
- if [[ " ${product} " = " llvm" ]] && [[ " ${BUILD_LLVM} " = " 1" ]] && [[ " $( uname -s) " = " Darwin" ]]; then
2249
- HOST_CXX_DIR=$( dirname " ${HOST_CXX} " )
2250
- HOST_LIB_CLANG_DIR=" ${HOST_CXX_DIR} /../lib/clang"
2251
- DEST_LIB_CLANG_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang"
2252
-
2253
- if [[ -d " ${HOST_LIB_CLANG_DIR} " ]] && [[ -d " ${DEST_LIB_CLANG_DIR} " ]]; then
2254
- DEST_CXX_BUILTINS_VERSION=$( ls " ${DEST_LIB_CLANG_DIR} " | awk ' {print $0}' )
2255
- DEST_BUILTINS_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang/$DEST_CXX_BUILTINS_VERSION /lib/darwin"
2256
-
2257
- if [[ -d " ${DEST_BUILTINS_DIR} " ]]; then
2258
- for HOST_CXX_BUILTINS_PATH in " ${HOST_LIB_CLANG_DIR} " /* ; do
2259
- HOST_CXX_BUILTINS_DIR=" ${HOST_CXX_BUILTINS_PATH} /lib/darwin"
2260
- echo " copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR} ."
2261
-
2262
- for OS in ios watchos tvos; do
2263
- LIB_NAME=" libclang_rt.$OS .a"
2264
- HOST_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$LIB_NAME "
2265
- if [[ -f " ${HOST_LIB_PATH} " ]]; then
2266
- call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${LIB_NAME} "
2267
- elif [[ " ${VERBOSE_BUILD} " ]]; then
2268
- echo " no file exists at ${HOST_LIB_PATH} "
2269
- fi
2270
- done
2244
+ call " ${CMAKE_BUILD[@]} " " ${build_dir} " $( cmake_config_opt ${product} ) -- " ${BUILD_ARGS[@]} " ${build_targets[@]}
2245
+
2246
+ # When we are building LLVM copy over the compiler-rt
2247
+ # builtins for iOS/tvOS/watchOS to ensure that Swift's
2248
+ # stdlib can use compiler-rt builtins when targetting iOS/tvOS/watchOS.
2249
+ if [[ " ${product} " = " llvm" ]] && [[ " ${BUILD_LLVM} " = " 1" ]] && [[ " $( uname -s) " = " Darwin" ]]; then
2250
+ HOST_CXX_DIR=$( dirname " ${HOST_CXX} " )
2251
+ HOST_LIB_CLANG_DIR=" ${HOST_CXX_DIR} /../lib/clang"
2252
+ DEST_LIB_CLANG_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang"
2253
+
2254
+ if [[ -d " ${HOST_LIB_CLANG_DIR} " ]] && [[ -d " ${DEST_LIB_CLANG_DIR} " ]]; then
2255
+ DEST_CXX_BUILTINS_VERSION=$( ls " ${DEST_LIB_CLANG_DIR} " | awk ' {print $0}' )
2256
+ DEST_BUILTINS_DIR=" $( build_directory_bin ${host} llvm) /../lib/clang/$DEST_CXX_BUILTINS_VERSION /lib/darwin"
2257
+
2258
+ if [[ -d " ${DEST_BUILTINS_DIR} " ]]; then
2259
+ for HOST_CXX_BUILTINS_PATH in " ${HOST_LIB_CLANG_DIR} " /* ; do
2260
+ HOST_CXX_BUILTINS_DIR=" ${HOST_CXX_BUILTINS_PATH} /lib/darwin"
2261
+ echo " copying compiler-rt embedded builtins from ${HOST_CXX_BUILTINS_DIR} into the local clang build directory ${DEST_BUILTINS_DIR} ."
2262
+
2263
+ for OS in ios watchos tvos; do
2264
+ LIB_NAME=" libclang_rt.$OS .a"
2265
+ HOST_LIB_PATH=" $HOST_CXX_BUILTINS_DIR /$LIB_NAME "
2266
+ if [[ -f " ${HOST_LIB_PATH} " ]]; then
2267
+ call cp " ${HOST_LIB_PATH} " " ${DEST_BUILTINS_DIR} /${LIB_NAME} "
2268
+ elif [[ " ${VERBOSE_BUILD} " ]]; then
2269
+ echo " no file exists at ${HOST_LIB_PATH} "
2270
+ fi
2271
2271
done
2272
- fi
2272
+ done
2273
2273
fi
2274
2274
fi
2275
2275
fi
0 commit comments