Skip to content

Commit dfa5480

Browse files
committed
Avoid request Foundation/Dispatch/XCTest on macOS
1 parent 6b6c945 commit dfa5480

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

utils/build-presets.ini

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,18 +2451,23 @@ install-prefix=/%(TOOLCHAIN_NAME)s/usr
24512451
[preset: webassembly-host]
24522452

24532453
mixin-preset=webassembly
2454-
xctest
24552454
llbuild
24562455
swiftpm
2457-
install-foundation
2458-
install-libdispatch
24592456
install-swiftpm
2460-
install-xctest
24612457
extra-cmake-options=
24622458
-DSWIFT_BUILD_SOURCEKIT=FALSE
24632459
-DSWIFT_ENABLE_SOURCEKIT_TESTS=FALSE
24642460
-DSWIFT_BUILD_SYNTAXPARSERLIB=FALSE
24652461

2462+
[preset: webassembly-linux-host]
2463+
2464+
mixin-preset=webassembly-host
2465+
libicu
2466+
xctest
2467+
install-foundation
2468+
install-libdispatch
2469+
install-xctest
2470+
24662471
[preset: webassembly-target]
24672472

24682473
mixin-preset=webassembly
@@ -2476,7 +2481,7 @@ build-swift-static-stdlib
24762481
stdlib-deployment-targets=wasi-wasm32
24772482
wasi-sdk=%(SOURCE_PATH)s/wasi-sdk
24782483

2479-
[preset: webassembly-linux]
2484+
[preset: webassembly-linux-target]
24802485

24812486
mixin-preset=webassembly-target
24822487
extra-cmake-options=
@@ -2491,7 +2496,7 @@ extra-cmake-options=
24912496
-DCMAKE_AR="%(SOURCE_PATH)s/wasi-sdk/bin/llvm-ar"
24922497
-DCMAKE_RANLIB="%(SOURCE_PATH)s/wasi-sdk/bin/llvm-ranlib"
24932498

2494-
[preset: webassembly-macos]
2499+
[preset: webassembly-macos-target]
24952500

24962501
mixin-preset=webassembly-target
24972502
extra-cmake-options=

utils/webassembly/build-toolchain.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ WASI_SDK_PATH=$SOURCE_PATH/wasi-sdk
99
case $(uname -s) in
1010
Darwin)
1111
OS_SUFFIX=osx
12-
PRESET_NAME=webassembly-macos
12+
HOST_PRESET=webassembly-host
13+
TARGET_PRESET=webassembly-macos-target
1314
;;
1415
Linux)
1516
OS_SUFFIX=linux
16-
PRESET_NAME=webassembly-linux
17+
HOST_PRESET=webassembly-linux-host
18+
TARGET_PRESET=webassembly-linux-target
1719
;;
1820
*)
1921
echo "Unrecognised platform $(uname -s)"
@@ -43,7 +45,7 @@ mkdir -p $HOST_TOOLCHAIN_SDK/usr/lib/clang/10.0.0
4345

4446
# Build the host toolchain and SDK first.
4547
$SOURCE_PATH/swift/utils/build-script \
46-
--preset=webassembly-host \
48+
--preset=$HOST_PRESET \
4749
INSTALL_DESTDIR="$HOST_TOOLCHAIN_DESTDIR" \
4850
TOOLCHAIN_NAME="$TOOLCHAIN_NAME" \
4951
C_CXX_LAUNCHER="$(which sccache)"
@@ -55,7 +57,7 @@ rm -rf $SOURCE_PATH/build/Ninja-ReleaseAssert/swift-macosx-x86_64
5557

5658
# build the cross-compilled toolchain
5759
$SOURCE_PATH/swift/utils/build-script \
58-
--preset=$PRESET_NAME \
60+
--preset=$TARGET_PRESET \
5961
INSTALL_DESTDIR="$SOURCE_PATH/install" \
6062
SOURCE_PATH="$SOURCE_PATH" \
6163
BUNDLE_IDENTIFIER="${BUNDLE_IDENTIFIER}" \

0 commit comments

Comments
 (0)