Skip to content

Commit 7bba6af

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 3037fb7 commit 7bba6af

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
@@ -326,6 +326,8 @@ macro(configure_sdk_unix name architectures)
326326
set(SWIFT_SDK_WASM_ARCH_wasm32_PATH "${SWIFT_WASM_WASI_SDK_PATH}/share/sysroot")
327327
# fixme: Wasi is wasm32-unknown-wasi-musl. This LLVM doesn't have it yet.
328328
set(SWIFT_SDK_WASM_ARCH_wasm32_TRIPLE "wasm32-unknown-unknown-wasm")
329+
set(SWIFT_SDK_WASM_ARCH_wasm32_LIBC_INCLUDE_DIRECTORY "${SWIFT_WASM_WASI_SDK_PATH}/share/sysroot/include" CACHE STRING "Path to C library headers")
330+
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")
329331
else()
330332
message(FATAL_ERROR "unknown Unix OS: ${prefix}")
331333
endif()

0 commit comments

Comments
 (0)