Skip to content

Commit 93df1b9

Browse files
Revert "[WASM] Always install CoreFoundation headers in target dir"
This reverts commit 50ec5f6.
1 parent 50ec5f6 commit 93df1b9

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

utils/webassembly/build-foundation.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@ cmake -G Ninja \
2424
ninja -v
2525
ninja -v install
2626

27-
mv $DESTINATION_TOOLCHAIN/usr/lib/swift_static/CoreFoundation \
28-
$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/CoreFoundation
27+
# On macOS the target CoreFoundation shadows the CoreFoundation suppplied by Xcode.
28+
# On Linux though there's no system CoreFoundation, its headers have to be shipped
29+
# in the installable archive and serve for both host and target.
30+
if [[ "$(uname)" == "Darwin" ]]; then
31+
mv $DESTINATION_TOOLCHAIN/usr/lib/swift_static/CoreFoundation \
32+
$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/CoreFoundation
33+
else
34+
mv $DESTINATION_TOOLCHAIN/usr/lib/swift_static/CoreFoundation \
35+
$DESTINATION_TOOLCHAIN/usr/lib/swift/CoreFoundation
36+
fi
2937

3038
# .swiftdoc and .swiftmodule files should live in `swift`, not in `swift_static`
3139
mv $DESTINATION_TOOLCHAIN/usr/lib/swift_static/wasi/wasm32/Foundation.swift* \
32-
$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32
40+
$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32

0 commit comments

Comments
 (0)