Skip to content

Commit d62abee

Browse files
[WASM] Set LIBC_INCLUDE_DIRECTORY for WASM to build SwiftGlibc properly (#9)
`LIBC_INCLUDE_DIRECTORY` is used to generate `glibc.modulemap`. Currently the directory is set `/usr/include` but it's system header path and we should use `wasi-sdk` version.
1 parent c009468 commit d62abee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: cmake/modules/SwiftConfigureSDK.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ macro(configure_sdk_unix name architectures)
340340
set(SWIFT_SDK_WASM_ARCH_wasm32_PATH "${SWIFT_WASM_WASI_SDK_PATH}/share/sysroot")
341341
# fixme: Wasi is wasm32-unknown-wasi-musl. This LLVM doesn't have it yet.
342342
set(SWIFT_SDK_WASM_ARCH_wasm32_TRIPLE "wasm32-unknown-unknown-wasm")
343+
set(SWIFT_SDK_WASM_ARCH_wasm32_LIBC_INCLUDE_DIRECTORY "${SWIFT_WASM_WASI_SDK_PATH}/share/sysroot/include" CACHE STRING "Path to C library headers")
344+
set(SWIFT_SDK_WASM_ARCH_wasm32_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "${SWIFT_WASM_WASI_SDK_PATH}/sysroot/include" CACHE STRING "Path to C library architecture headers")
343345
else()
344346
message(FATAL_ERROR "unknown Unix OS: ${prefix}")
345347
endif()

0 commit comments

Comments
 (0)