Skip to content

build: Add support for wasi-sysroot option in build-script #67468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@ KNOWN_SETTINGS=(
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"
darwin-xcrun-toolchain "default" "the name of the toolchain to use on Darwin"

## WebAssembly/WASI Options
wasi-sysroot "" "An absolute path to the wasi-sysroot that will be used as a libc implementation for Wasm builds"

## Build Types for Components
swift-stdlib-build-type "Debug" "the CMake build variant for Swift"

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

if [[ ! "${SKIP_BUILD_WASM}" ]]; then
cmake_options=(
"${cmake_options[@]}"
-DSWIFT_WASI_SYSROOT_PATH:STRING="${WASI_SYSROOT}"
)
fi

if [[ $(is_cross_tools_host ${host}) && "${host}" == "openbsd-"* && -n "${OPENBSD_USE_TOOLCHAIN_FILE}" ]]; then
cmake_options=(
"${cmake_options[@]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def __platforms_to_skip_build(self, args, stage_dependent_args):
StdlibDeploymentTarget.AppleWatchSimulator)
if not stage_dependent_args.build_android:
platforms_to_skip_build.add(StdlibDeploymentTarget.Android)
if not args.build_wasm:
platforms_to_skip_build.add(StdlibDeploymentTarget.WASI)
return platforms_to_skip_build

def __platforms_to_skip_test(self, args, stage_dependent_args):
Expand Down