@@ -119,13 +119,15 @@ KNOWN_SETTINGS=(
119
119
skip-build-swiftpm " " " set to skip building swiftpm"
120
120
skip-build-xctest " " " set to skip building xctest"
121
121
skip-build-foundation " " " set to skip building foundation"
122
+ skip-build-libdispatch " " " set to skip building libdispatch"
122
123
skip-test-cmark " " " set to skip testing CommonMark"
123
124
skip-test-lldb " " " set to skip testing lldb"
124
125
skip-test-swift " " " set to skip testing Swift"
125
126
skip-test-llbuild " " " set to skip testing llbuild"
126
127
skip-test-swiftpm " " " set to skip testing swiftpm"
127
128
skip-test-xctest " " " set to skip testing xctest"
128
129
skip-test-foundation " " " set to skip testing foundation"
130
+ skip-test-libdispatch " " " set to skip testing libdispatch"
129
131
skip-test-osx " " " set to skip testing Swift stdlibs for OSX"
130
132
skip-test-ios " " " set to skip testing Swift stdlibs for iOS"
131
133
skip-test-ios-simulator " " " set to skip testing Swift stdlibs for iOS simulators (i.e. test devices only)"
@@ -165,6 +167,7 @@ KNOWN_SETTINGS=(
165
167
install-swiftpm " " " whether to install swiftpm"
166
168
install-xctest " " " whether to install xctest"
167
169
install-foundation " " " whether to install foundation"
170
+ install-libdispatch " " " whether to install libdispatch"
168
171
darwin-install-extract-symbols " " " whether to extract symbols with dsymutil during installations"
169
172
cross-compile-tools-deployment-targets " " " space-separated list of targets to cross-compile host Swift tools for"
170
173
skip-merge-lipo-cross-compile-tools " " " set to skip running merge-lipo after installing cross-compiled host Swift tools"
@@ -542,6 +545,7 @@ if [[ "${SKIP_BUILD}" ]]; then
542
545
SKIP_BUILD_SWIFTPM=1
543
546
SKIP_BUILD_XCTEST=1
544
547
SKIP_BUILD_FOUNDATION=1
548
+ SKIP_BUILD_LIBDISPATCH=1
545
549
fi
546
550
547
551
if [[ " ${SKIP_IOS} " ]] ; then
@@ -886,6 +890,7 @@ LLBUILD_SOURCE_DIR="${WORKSPACE}/llbuild"
886
890
SWIFTPM_SOURCE_DIR=" ${WORKSPACE} /swiftpm"
887
891
XCTEST_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-xctest"
888
892
FOUNDATION_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-foundation"
893
+ LIBDISPATCH_SOURCE_DIR=" ${WORKSPACE} /swift-corelibs-libdispatch"
889
894
890
895
if [[ ! -d ${CMARK_SOURCE_DIR} ]]; then
891
896
echo " Couldn't find cmark source directory."
@@ -926,6 +931,11 @@ if [[ ! "${SKIP_BUILD_FOUNDATION}" && ! -d ${FOUNDATION_SOURCE_DIR} ]]; then
926
931
exit 1
927
932
fi
928
933
934
+ if [[ ! " ${SKIP_BUILD_LIBDISPATCH} " && ! -d ${LIBDISPATCH_SOURCE_DIR} ]]; then
935
+ echo " Couldn't find libdispatch source directory."
936
+ exit 1
937
+ fi
938
+
929
939
# Symlink clang into the llvm tree.
930
940
CLANG_SOURCE_DIR=" ${LLVM_SOURCE_DIR} /tools/clang"
931
941
if [ ! -e " ${WORKSPACE} /clang" ] ; then
955
965
if [[ ! " ${SKIP_BUILD_FOUNDATION} " ]] ; then
956
966
PRODUCTS=(" ${PRODUCTS[@]} " foundation)
957
967
fi
968
+ if [[ ! " ${SKIP_BUILD_LIBDISPATCH} " ]] ; then
969
+ PRODUCTS=(" ${PRODUCTS[@]} " libdispatch)
970
+ fi
958
971
959
972
SWIFT_STDLIB_TARGETS=()
960
973
SWIFT_PERFTEST_TARGETS=()
@@ -1184,6 +1197,9 @@ function build_directory_bin() {
1184
1197
foundation)
1185
1198
echo " ${root} /${FOUNDATION_BUILD_TYPE} /bin"
1186
1199
;;
1200
+ libdispatch)
1201
+ echo " ${root} /bin"
1202
+ ;;
1187
1203
* )
1188
1204
echo " error: unknown product: ${product} "
1189
1205
exit 1
@@ -1284,6 +1300,8 @@ function cmake_config_opt() {
1284
1300
foundation)
1285
1301
echo " --config ${FOUNDATION_BUILD_TYPE} "
1286
1302
;;
1303
+ libdispatch)
1304
+ ;;
1287
1305
* )
1288
1306
echo " error: unknown product: ${product} "
1289
1307
exit 1
@@ -1826,6 +1844,28 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
1826
1844
# Foundation builds itself and doesn't use cmake
1827
1845
continue
1828
1846
;;
1847
+ libdispatch)
1848
+ LIBDISPATCH_BUILD_DIR=$( build_directory ${deployment_target} ${product} )
1849
+
1850
+ set -x
1851
+ if [[ ! -f " ${LIBDISPATCH_BUILD_DIR} " /config.status ]]; then
1852
+ # First time building; need to run autotools and configure
1853
+ mkdir -p " ${LIBDISPATCH_BUILD_DIR} "
1854
+ pushd " ${LIBDISPATCH_SOURCE_DIR} "
1855
+ autoreconf -fvi
1856
+ popd
1857
+ pushd " ${LIBDISPATCH_BUILD_DIR} "
1858
+ " ${LIBDISPATCH_SOURCE_DIR} " /configure --prefix=" ${INSTALL_DESTDIR} " /" ${INSTALL_PREFIX} "
1859
+ popd
1860
+ fi
1861
+ pushd " ${LIBDISPATCH_BUILD_DIR} "
1862
+ make
1863
+ popd
1864
+ { set +x; } 2> /dev/null
1865
+
1866
+ # libdispatch builds itself and doesn't use cmake
1867
+ continue
1868
+ ;;
1829
1869
* )
1830
1870
echo " error: unknown product: ${product} "
1831
1871
exit 1
@@ -2013,6 +2053,20 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
2013
2053
echo " --- Finished tests for ${product} ---"
2014
2054
continue
2015
2055
;;
2056
+ libdispatch)
2057
+ if [[ " ${SKIP_TEST_LIBDISPATCH} " ]]; then
2058
+ continue
2059
+ fi
2060
+ LIBDISPATCH_BUILD_DIR=$( build_directory ${deployment_target} ${product} )
2061
+ echo " --- Running tests for ${product} ---"
2062
+ set -x
2063
+ pushd " ${LIBDISPATCH_BUILD_DIR} "
2064
+ make check
2065
+ popd
2066
+ { set +x; } 2> /dev/null
2067
+ echo " --- Finished tests for ${product} ---"
2068
+ continue
2069
+ ;;
2016
2070
* )
2017
2071
echo " error: unknown product: ${product} "
2018
2072
exit 1
@@ -2158,6 +2212,21 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
2158
2212
# As foundation installation is self-contained, we break early here.
2159
2213
continue
2160
2214
;;
2215
+ libdispatch)
2216
+ if [[ -z " ${INSTALL_LIBDISPATCH} " ]] ; then
2217
+ continue
2218
+ fi
2219
+ echo " --- Installing ${product} ---"
2220
+ LIBDISPATCH_BUILD_DIR=$( build_directory ${deployment_target} ${product} )
2221
+ set -x
2222
+ pushd " ${LIBDISPATCH_BUILD_DIR} "
2223
+ make install
2224
+ popd
2225
+ { set +x; } 2> /dev/null
2226
+
2227
+ # As libdispatch installation is self-contained, we break early here.
2228
+ continue
2229
+ ;;
2161
2230
* )
2162
2231
echo " error: unknown product: ${product} "
2163
2232
exit 1
0 commit comments