@@ -1698,6 +1698,7 @@ function cmake_config_opt() {
1698
1698
echo " --config ${FOUNDATION_BUILD_TYPE} "
1699
1699
;;
1700
1700
libdispatch)
1701
+ echo " --config ${LIBDISPATCH_BUILD_TYPE} "
1701
1702
;;
1702
1703
libicu)
1703
1704
;;
@@ -2447,41 +2448,61 @@ for host in "${ALL_HOSTS[@]}"; do
2447
2448
SWIFTC_BIN=" $( build_directory_bin ${LOCAL_HOST} swift) /swiftc"
2448
2449
LLVM_BIN=" $( build_directory_bin ${LOCAL_HOST} llvm) "
2449
2450
2450
- if [[ " ${RECONFIGURE} " || ! -f " ${LIBDISPATCH_BUILD_DIR} " /config.status ]]; then
2451
- echo " Reconfiguring libdispatch"
2452
- # First time building; need to run autotools and configure
2453
- if [[ " $LIBDISPATCH_BUILD_TYPE " == " Release" ]] ; then
2454
- dispatch_build_variant_arg=" release"
2455
- elif [[ " $LIBDISPATCH_BUILD_TYPE " == " RelWithDebInfo" ]]; then
2456
- dispatch_build_variant_arg=" releasedebuginfo"
2457
- else
2458
- dispatch_build_variant_arg=" debug"
2459
- fi
2451
+ case " ${host} " in
2452
+ macosx-* )
2453
+ if [[ " ${RECONFIGURE} " || ! -f " ${LIBDISPATCH_BUILD_DIR} " /config.status ]]; then
2454
+ echo " Reconfiguring libdispatch"
2455
+ # First time building; need to run autotools and configure
2456
+ if [[ " $LIBDISPATCH_BUILD_TYPE " == " Release" ]] ; then
2457
+ dispatch_build_variant_arg=" release"
2458
+ elif [[ " $LIBDISPATCH_BUILD_TYPE " == " RelWithDebInfo" ]]; then
2459
+ dispatch_build_variant_arg=" releasedebuginfo"
2460
+ else
2461
+ dispatch_build_variant_arg=" debug"
2462
+ fi
2463
+
2464
+ if [ $( true_false " ${BUILD_SWIFT_STATIC_STDLIB} " ) == " TRUE" ]; then
2465
+ libdispatch_enable_static=" --enable-static=yes"
2466
+ else
2467
+ libdispatch_enable_static=" "
2468
+ fi
2469
+
2470
+ call mkdir -p " ${LIBDISPATCH_BUILD_DIR} "
2471
+ with_pushd " ${LIBDISPATCH_SOURCE_DIR} " \
2472
+ call autoreconf -fvi
2473
+ with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
2474
+ call env CC=" ${LLVM_BIN} /clang" CXX=" ${LLVM_BIN} /clang++" SWIFTC=" ${SWIFTC_BIN} " \
2475
+ " ${LIBDISPATCH_SOURCE_DIR} " /configure --with-swift-toolchain=" ${SWIFT_BUILD_PATH} " \
2476
+ --with-build-variant=$dispatch_build_variant_arg \
2477
+ --prefix=" $( get_host_install_destdir ${host} ) $( get_host_install_prefix ${host} ) " ${libdispatch_enable_static}
2478
+ else
2479
+ echo " Skipping reconfiguration of libdispatch"
2480
+ fi
2481
+ with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
2482
+ call make
2483
+ with_pushd " ${LIBDISPATCH_BUILD_DIR} /tests" \
2484
+ call make build-tests
2485
+
2486
+ # libdispatch builds itself and doesn't use cmake
2487
+ continue
2488
+ ;;
2489
+ * )
2490
+ cmake_options=(
2491
+ ${cmake_options[@]}
2492
+ -DCMAKE_BUILD_TYPE:STRING=" ${LIBDISPATCH_BUILD_TYPE} "
2493
+ -DCMAKE_C_COMPILER:PATH=" ${LLVM_BIN} /clang"
2494
+ -DCMAKE_CXX_COMPILER:PATH=" ${LLVM_BIN} /clang++"
2495
+ -DCMAKE_SWIFT_COMPILER:PATH=" ${SWIFTC_BIN} "
2496
+ -DCMAKE_INSTALL_PREFIX:PATH=" $( get_host_install_destdir ${host} ) $( get_host_install_prefix ${host} ) "
2460
2497
2461
- if [ $( true_false " ${BUILD_SWIFT_STATIC_STDLIB} " ) == " TRUE" ]; then
2462
- libdispatch_enable_static=" --enable-static=yes"
2463
- else
2464
- libdispatch_enable_static=" "
2465
- fi
2498
+ -DENABLE_SWIFT=YES
2499
+ -DSWIFT_RUNTIME_LIBDIR:PATH=" ${SWIFT_BUILD_PATH} /lib/swift/${SWIFT_HOST_VARIANT} /${SWIFT_HOST_VARIANT_ARCH} "
2466
2500
2467
- call mkdir -p " ${LIBDISPATCH_BUILD_DIR} "
2468
- with_pushd " ${LIBDISPATCH_SOURCE_DIR} " \
2469
- call autoreconf -fvi
2470
- with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
2471
- call env CC=" ${LLVM_BIN} /clang" CXX=" ${LLVM_BIN} /clang++" SWIFTC=" ${SWIFTC_BIN} " \
2472
- " ${LIBDISPATCH_SOURCE_DIR} " /configure --with-swift-toolchain=" ${SWIFT_BUILD_PATH} " \
2473
- --with-build-variant=$dispatch_build_variant_arg \
2474
- --prefix=" $( get_host_install_destdir ${host} ) $( get_host_install_prefix ${host} ) " ${libdispatch_enable_static}
2475
- else
2476
- echo " Skipping reconfiguration of libdispatch"
2477
- fi
2478
- with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
2479
- call make
2480
- with_pushd " ${LIBDISPATCH_BUILD_DIR} /tests" \
2481
- call make build-tests
2501
+ -DENABLE_TESTING=YES
2502
+ )
2503
+ ;;
2504
+ esac
2482
2505
2483
- # libdispatch builds itself and doesn't use cmake
2484
- continue
2485
2506
;;
2486
2507
libicu)
2487
2508
SWIFT_BUILD_PATH=$( build_directory ${host} swift)
@@ -2846,15 +2867,23 @@ for host in "${ALL_HOSTS[@]}"; do
2846
2867
continue
2847
2868
;;
2848
2869
libdispatch)
2849
- if [[ " ${SKIP_TEST_LIBDISPATCH} " ]]; then
2850
- continue
2851
- fi
2852
- LIBDISPATCH_BUILD_DIR=$( build_directory ${host} ${product} )
2853
- echo " --- Running tests for ${product} ---"
2854
- with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
2855
- call env VERBOSE=1 make check
2856
- echo " --- Finished tests for ${product} ---"
2857
- continue
2870
+ case " ${host} " in
2871
+ macosx-* )
2872
+ if [[ " ${SKIP_TEST_LIBDISPATCH} " ]]; then
2873
+ continue
2874
+ fi
2875
+ LIBDISPATCH_BUILD_DIR=$( build_directory ${host} ${product} )
2876
+ echo " --- Running tests for ${product} ---"
2877
+ with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
2878
+ call env VERBOSE=1 make check
2879
+ echo " --- Finished tests for ${product} ---"
2880
+ continue
2881
+ ;;
2882
+ * )
2883
+ results_targets=( " test" )
2884
+ executable_target=" "
2885
+ ;;
2886
+ esac
2858
2887
;;
2859
2888
libicu)
2860
2889
if [[ " ${SKIP_TEST_LIBICU} " ]]; then
@@ -3098,25 +3127,31 @@ for host in "${ALL_HOSTS[@]}"; do
3098
3127
continue
3099
3128
;;
3100
3129
libdispatch)
3101
- if [[ -z " ${INSTALL_LIBDISPATCH} " ]] ; then
3102
- continue
3103
- fi
3104
- if [[ -z " ${INSTALL_DESTDIR} " ]] ; then
3105
- echo " --install-destdir is required to install products."
3106
- exit 1
3107
- fi
3108
- echo " --- Installing ${product} ---"
3109
- LIBDISPATCH_BUILD_DIR=$( build_directory ${host} ${product} )
3110
- with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
3111
- call make install
3112
- DISPATCH_LIBDIR=" ${host_install_destdir}${host_install_prefix} /lib/swift/${SWIFT_HOST_VARIANT} "
3113
- DISPATCH_LIBDIR_STATIC=" ${host_install_destdir}${host_install_prefix} /lib/swift_static/${SWIFT_HOST_VARIANT} "
3114
- if [ -f " $DISPATCH_LIBDIR /libdispatch.a" ]; then
3115
- mv " $DISPATCH_LIBDIR /libdispatch.a" " $DISPATCH_LIBDIR_STATIC "
3116
- fi
3117
-
3118
- # As libdispatch installation is self-contained, we break early here.
3119
- continue
3130
+ case " ${host} " in
3131
+ macosx-* )
3132
+ if [[ -z " ${INSTALL_LIBDISPATCH} " ]] ; then
3133
+ continue
3134
+ fi
3135
+ if [[ -z " ${INSTALL_DESTDIR} " ]] ; then
3136
+ echo " --install-destdir is required to install products."
3137
+ exit 1
3138
+ fi
3139
+ echo " --- Installing ${product} ---"
3140
+ LIBDISPATCH_BUILD_DIR=$( build_directory ${host} ${product} )
3141
+ with_pushd " ${LIBDISPATCH_BUILD_DIR} " \
3142
+ call make install
3143
+ DISPATCH_LIBDIR=" ${host_install_destdir}${host_install_prefix} /lib/swift/${SWIFT_HOST_VARIANT} "
3144
+ DISPATCH_LIBDIR_STATIC=" ${host_install_destdir}${host_install_prefix} /lib/swift_static/${SWIFT_HOST_VARIANT} "
3145
+ if [ -f " $DISPATCH_LIBDIR /libdispatch.a" ]; then
3146
+ mv " $DISPATCH_LIBDIR /libdispatch.a" " $DISPATCH_LIBDIR_STATIC "
3147
+ fi
3148
+
3149
+ # As libdispatch installation is self-contained, we break early here.
3150
+ continue
3151
+ ;;
3152
+ * )
3153
+ ;;
3154
+ esac
3120
3155
;;
3121
3156
libicu)
3122
3157
if [[ -z " ${INSTALL_LIBICU} " ]]; then
0 commit comments