Skip to content

Commit e82060f

Browse files
authored
build: Add support for wasi-sysroot option in build-script
`wasi-sysroot` allows providing a path to a custom libc that supports this platform.
1 parent a8fc894 commit e82060f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

utils/build-script-impl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,16 @@ KNOWN_SETTINGS=(
116116
darwin-toolchain-require-use-os-runtime "0" "When setting up a plist for a toolchain, require the users of the toolchain to link against the OS instead of the packaged toolchain runtime. 0 for false, 1 for true"
117117
darwin-xcrun-toolchain "default" "the name of the toolchain to use on Darwin"
118118

119+
## WebAssembly/WASI Options
120+
wasi-sysroot "" "An absolute path to the wasi-sysroot that will be used as a libc implementation for Wasm builds"
121+
119122
## Build Types for Components
120123
swift-stdlib-build-type "Debug" "the CMake build variant for Swift"
121124

122125
## Skip Build ...
123126
skip-build "" "set to configure as usual while skipping the build step"
124127
skip-build-android "" "set to skip building Swift stdlibs for Android"
128+
skip-build-wasm "" "set to skip building Swift stdlibs for WebAssembly"
125129
skip-build-benchmarks "" "set to skip building Swift Benchmark Suite"
126130
skip-build-clang-tools-extra "" "set to skip building clang-tools-extra as part of llvm"
127131
skip-build-compiler-rt "" "set to skip building Compiler-RT"
@@ -1741,6 +1745,13 @@ for host in "${ALL_HOSTS[@]}"; do
17411745
)
17421746
fi
17431747

1748+
if [[ ! "${SKIP_BUILD_WASM}" ]]; then
1749+
cmake_options=(
1750+
"${cmake_options[@]}"
1751+
-DSWIFT_WASI_SYSROOT_PATH:STRING="${WASI_SYSROOT}"
1752+
)
1753+
fi
1754+
17441755
if [[ $(is_cross_tools_host ${host}) && "${host}" == "openbsd-"* && -n "${OPENBSD_USE_TOOLCHAIN_FILE}" ]]; then
17451756
cmake_options=(
17461757
"${cmake_options[@]}"

0 commit comments

Comments
 (0)