Skip to content

Commit 9b4b8f8

Browse files
[WASM] Remove wasi-sdk dependency from build-script
1 parent 3b043b1 commit 9b4b8f8

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

cmake/modules/SwiftConfigureSDK.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,10 @@ macro(configure_sdk_unix name architectures)
402402
if(NOT arch STREQUAL wasm32)
403403
message(FATAL_ERROR "unsupported arch for WebAssembly: ${arch}")
404404
endif()
405-
set(SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SDK_PATH}/share/wasi-sysroot")
405+
set(SWIFT_SDK_WASI_ARCH_wasm32_PATH "${SWIFT_WASI_SYSROOT_PATH}")
406406
set(SWIFT_SDK_WASI_ARCH_wasm32_TRIPLE "wasm32-unknown-wasi")
407-
set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_INCLUDE_DIRECTORY "${SWIFT_WASI_SDK_PATH}/share/wasi-sysroot/include")
408-
set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_WASI_SDK_PATH}/share/wasi-sysroot/include")
407+
set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_INCLUDE_DIRECTORY "${SWIFT_WASI_SYSROOT_PATH}/include")
408+
set(SWIFT_SDK_WASI_ARCH_wasm32_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_WASI_SYSROOT_PATH}/include")
409409
else()
410410
message(FATAL_ERROR "unknown Unix OS: ${prefix}")
411411
endif()

test/lit.site.cfg.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ config.darwin_xcrun_toolchain = "@SWIFT_DARWIN_XCRUN_TOOLCHAIN@"
4444
config.android_ndk_path = "@SWIFT_ANDROID_NDK_PATH@"
4545
config.android_ndk_gcc_version = "@SWIFT_ANDROID_NDK_GCC_VERSION@"
4646

47-
# --- WebAssembly ---
48-
config.wasi_sdk_path = "@SWIFT_WASI_SDK_PATH@"
49-
5047
# --- Windows ---
5148
msvc_runtime_flags = {
5249
'MultiThreaded': 'MT',

utils/build-script

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ def validate_arguments(toolchain, args):
251251
"--android-icu-i18n-include, and --android-icu-data "
252252
"must be specified")
253253
if args.wasm:
254-
if args.wasi_sdk is None:
254+
if args.wasi_sysroot is None:
255255
fatal_error(
256-
"when building for WebAssembly, --wasi-sdk must be specified")
256+
"when building for WebAssembly, --wasi-sysroot must be specified")
257257

258258
targets_needing_toolchain = [
259259
'build_indexstoredb',
@@ -697,7 +697,7 @@ class BuildScriptInvocation(object):
697697

698698
if args.wasm:
699699
impl_args += [
700-
"--wasi-sdk", args.wasi_sdk,
700+
"--wasi-sysroot", args.wasi_sysroot,
701701
]
702702

703703
if platform.system() == 'Darwin':

utils/build-script-impl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ KNOWN_SETTINGS=(
119119
darwin-xcrun-toolchain "default" "the name of the toolchain to use on Darwin"
120120

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

124124
## Build Types for Components
125125
swift-stdlib-build-type "Debug" "the CMake build variant for Swift"
@@ -1786,7 +1786,7 @@ for host in "${ALL_HOSTS[@]}"; do
17861786
if [[ ! "${SKIP_BUILD_WASM}" ]]; then
17871787
cmake_options=(
17881788
"${cmake_options[@]}"
1789-
-DSWIFT_WASI_SDK_PATH:STRING="${WASI_SDK}"
1789+
-DSWIFT_WASI_SYSROOT_PATH:STRING="${WASI_SYSROOT}"
17901790
)
17911791
fi
17921792

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,8 @@ def create_argument_parser():
11301130
# -------------------------------------------------------------------------
11311131
in_group('Build settings for WebAssembly')
11321132

1133-
option('--wasi-sdk', store_path,
1134-
help='An absolute path to WASI SDK that will be used as a libc '
1133+
option('--wasi-sysroot', store_path,
1134+
help='An absolute path to wasi-sysroot that will be used as a libc '
11351135
'implementation for Wasm builds')
11361136

11371137
# -------------------------------------------------------------------------

utils/webassembly/build-toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ build_target_toolchain() {
9494
-D CMAKE_INSTALL_PREFIX="$DIST_TOOLCHAIN_SDK/usr" \
9595
-D LLVM_DIR="$HOST_BUILD_DIR/llvm-$HOST_SUFFIX/lib/cmake/llvm/" \
9696
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH="$HOST_BUILD_DIR/swift-$HOST_SUFFIX/bin" \
97-
-D SWIFT_WASI_SDK_PATH="$WASI_SDK_PATH" \
97+
-D SWIFT_WASI_SYSROOT_PATH="$WASI_SYSROOT_PATH" \
9898
-G Ninja \
9999
-S "$SOURCE_PATH/swift"
100100

0 commit comments

Comments
 (0)