forked from apple/swift
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apple#1398 from swiftwasm/maxd/5.3-build-host
Build both host and target toolchains in 5.3 branch
- Loading branch information
Showing
18 changed files
with
304 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -ex | ||
DESTINATION_TOOLCHAIN=$1 | ||
SOURCE_PATH="$(cd "$(dirname $0)/../../.." && pwd)" | ||
|
||
# Remove host CoreFoundation (which can be different from the target) headers | ||
# to avoid shadowing the wasm32 target CoreFoundation | ||
rm -rf $DESTINATION_TOOLCHAIN/usr/lib/swift/CoreFoundation | ||
|
||
FOUNDATION_BUILD="$SOURCE_PATH/build/Ninja-ReleaseAssert/foundation-wasi-wasm32" | ||
|
||
mkdir -p $FOUNDATION_BUILD | ||
cd $FOUNDATION_BUILD | ||
|
||
cmake -G Ninja \ | ||
-DCMAKE_Swift_COMPILER="$DESTINATION_TOOLCHAIN/usr/bin/swiftc" \ | ||
-DCMAKE_STAGING_PREFIX="$DESTINATION_TOOLCHAIN/usr" \ | ||
-DCMAKE_TOOLCHAIN_FILE="$SOURCE_PATH/swift/utils/webassembly/toolchain-wasi.cmake" \ | ||
-DWASI_SDK_PATH="$SOURCE_PATH/wasi-sdk" \ | ||
-DICU_ROOT="$SOURCE_PATH/icu_out" \ | ||
-DBUILD_SHARED_LIBS=OFF \ | ||
"${SOURCE_PATH}/swift-corelibs-foundation" | ||
|
||
ninja -v | ||
ninja -v install | ||
|
||
# On macOS the target CoreFoundation shadows the CoreFoundation suppplied by Xcode. | ||
# On Linux though there's no system CoreFoundation, its headers have to be shipped | ||
# in the installable archive and serve for both host and target. | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
mv $DESTINATION_TOOLCHAIN/usr/lib/swift/CoreFoundation \ | ||
$DESTINATION_TOOLCHAIN/usr/lib/swift/wasi/wasm32/CoreFoundation | ||
fi |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.