@@ -123,6 +123,7 @@ KNOWN_SETTINGS=(
123
123
skip-build-android " " " set to skip building Swift stdlibs for Android"
124
124
skip-build-lldb " " " set to skip building LLDB"
125
125
skip-build-llbuild " " " set to skip building llbuild"
126
+ skip-build-libcxx " " " set to skip building libcxx"
126
127
skip-build-swiftpm " " " set to skip building swiftpm"
127
128
skip-build-swiftsyntax " " " set to skip building swiftSyntax"
128
129
skip-build-skstresstester " " " set to skip building the SourceKit stress tester"
@@ -199,6 +200,7 @@ KNOWN_SETTINGS=(
199
200
install-skstresstester " " " whether to install the SourceKit stress tester"
200
201
install-xctest " " " whether to install xctest"
201
202
install-foundation " " " whether to install foundation"
203
+ install-libcxx " " " whether to install libc++"
202
204
install-libdispatch " " " whether to install libdispatch"
203
205
install-libicu " " " whether to install libicu"
204
206
install-playgroundsupport " " " whether to install PlaygroundSupport"
@@ -255,6 +257,7 @@ KNOWN_SETTINGS=(
255
257
swiftpm-cmake-options " " " CMake options used for all swiftpm targets"
256
258
xctest-cmake-options " " " CMake options used for all xctest targets"
257
259
playgroundsupport-cmake-options " " " CMake options used for all playgroundsupport targets"
260
+ libcxx-cmake-options " " " CMake options used for all libcxx targets"
258
261
# TODO: Remove this some time later.
259
262
user-config-args " " " **Renamed to --extra-cmake-options**: User-supplied arguments to cmake when used to do configuration."
260
263
only-execute " all" " Only execute the named action (see implementation)"
@@ -1180,6 +1183,7 @@ XCTEST_SOURCE_DIR="${WORKSPACE}/swift-corelibs-xctest"
1180
1183
FOUNDATION_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-foundation"
1181
1184
LIBDISPATCH_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-libdispatch"
1182
1185
LIBICU_SOURCE_DIR=" ${WORKSPACE} /icu"
1186
+ LIBCXX_SOURCE_DIR=" ${WORKSPACE} /libcxx"
1183
1187
PLAYGROUNDSUPPORT_SOURCE_DIR=" ${WORKSPACE} /swift-xcode-playground-support"
1184
1188
1185
1189
if [[ ! " ${SKIP_BUILD_PLAYGROUNDSUPPORT} " && ! -d ${PLAYGROUNDSUPPORT_SOURCE_DIR} ]]; then
@@ -1200,6 +1204,12 @@ if [ ! -d "${CLANG_SOURCE_DIR}" ] ; then
1200
1204
make_relative_symlink " ${WORKSPACE} /clang" " ${CLANG_SOURCE_DIR} "
1201
1205
fi
1202
1206
1207
+ # Don't symlink clang-tools-extra into the tree as the 'clang' symlink prevents
1208
+ # make_relative_symlink from working correctly.
1209
+ if [ -e " ${WORKSPACE} /clang-tools-extra" ] ; then
1210
+ CLANG_TOOLS_EXTRA_SOURCE_DIR=" ${WORKSPACE} /clang-tools-extra"
1211
+ fi
1212
+
1203
1213
# Symlink compiler-rt into the llvm tree, if it exists.
1204
1214
COMPILER_RT_SOURCE_DIR=" ${LLVM_SOURCE_DIR} /projects/compiler-rt"
1205
1215
if [ -e " ${WORKSPACE} /compiler-rt" ] ; then
@@ -1209,6 +1219,9 @@ if [ -e "${WORKSPACE}/compiler-rt" ] ; then
1209
1219
fi
1210
1220
1211
1221
PRODUCTS=(cmark llvm)
1222
+ if [[ ! " ${SKIP_BUILD_LIBCXX} " ]] ; then
1223
+ PRODUCTS=(" ${PRODUCTS[@]} " libcxx)
1224
+ fi
1212
1225
if [[ ! " ${SKIP_BUILD_LIBICU} " ]] ; then
1213
1226
PRODUCTS=(" ${PRODUCTS[@]} " libicu)
1214
1227
fi
@@ -1545,6 +1558,10 @@ function build_directory_bin() {
1545
1558
llvm)
1546
1559
echo " ${root} /${LLVM_BUILD_TYPE} /bin"
1547
1560
;;
1561
+ libcxx)
1562
+ # Reuse LLVM's build type.
1563
+ echo " ${root} /${LLVM_BUILD_TYPE} /bin"
1564
+ ;;
1548
1565
swift)
1549
1566
echo " ${root} /${SWIFT_BUILD_TYPE} /bin"
1550
1567
;;
@@ -1687,6 +1704,10 @@ function cmake_config_opt() {
1687
1704
llvm)
1688
1705
echo " --config ${LLVM_BUILD_TYPE} "
1689
1706
;;
1707
+ libcxx)
1708
+ # Reuse LLVM's build type.
1709
+ echo " --config ${LLVM_BUILD_TYPE} "
1710
+ ;;
1690
1711
swift)
1691
1712
echo " --config ${SWIFT_BUILD_TYPE} "
1692
1713
;;
@@ -2097,6 +2118,12 @@ for host in "${ALL_HOSTS[@]}"; do
2097
2118
" ${llvm_cmake_options[@]} "
2098
2119
)
2099
2120
2121
+ if [[ ! -z " ${CLANG_TOOLS_EXTRA_SOURCE_DIR} " ]] ; then
2122
+ cmake_options+=(
2123
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=" ${CLANG_TOOLS_EXTRA_SOURCE_DIR} "
2124
+ )
2125
+ fi
2126
+
2100
2127
if [[ " ${BUILD_TOOLCHAIN_ONLY} " ]]; then
2101
2128
cmake_options+=(
2102
2129
-DLLVM_BUILD_TOOLS=NO
@@ -2136,6 +2163,22 @@ for host in "${ALL_HOSTS[@]}"; do
2136
2163
2137
2164
;;
2138
2165
2166
+ libcxx)
2167
+ build_targets=(cxx-headers)
2168
+ cmake_options=(
2169
+ " ${cmake_options[@]} "
2170
+ -DCMAKE_C_FLAGS=" $( llvm_c_flags ${host} ) "
2171
+ -DCMAKE_CXX_FLAGS=" $( llvm_c_flags ${host} ) "
2172
+ -DCMAKE_C_FLAGS_RELWITHDEBINFO=" -O2 -DNDEBUG"
2173
+ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO=" -O2 -DNDEBUG"
2174
+ -DCMAKE_BUILD_TYPE:STRING=" ${LLVM_BUILD_TYPE} "
2175
+ -DLLVM_INCLUDE_DOCS:BOOL=TRUE
2176
+ -DLLVM_CONFIG_PATH=" $( build_directory " ${LOCAL_HOST} " llvm) /bin/llvm-config"
2177
+ " ${llvm_cmake_options[@]} "
2178
+ )
2179
+
2180
+ ;;
2181
+
2139
2182
swift)
2140
2183
2141
2184
if [[ ! " ${SKIP_BUILD_ANDROID} " ]]; then
@@ -2934,6 +2977,9 @@ for host in "${ALL_HOSTS[@]}"; do
2934
2977
llvm)
2935
2978
continue # We don't test LLVM
2936
2979
;;
2980
+ libcxx)
2981
+ continue # We don't test libc++
2982
+ ;;
2937
2983
swift)
2938
2984
executable_target=
2939
2985
results_targets=
@@ -3397,6 +3443,12 @@ for host in "${ALL_HOSTS[@]}"; do
3397
3443
fi
3398
3444
INSTALL_TARGETS=install-$( echo ${LLVM_INSTALL_COMPONENTS} | sed -E ' s/;/ install-/g' )
3399
3445
;;
3446
+ libcxx)
3447
+ if [[ -z " ${INSTALL_LIBCXX} " ]] ; then
3448
+ continue
3449
+ fi
3450
+ INSTALL_TARGETS=install-cxx-headers
3451
+ ;;
3400
3452
swift)
3401
3453
if [[ -z " ${INSTALL_SWIFT} " ]] ; then
3402
3454
continue
0 commit comments