File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ set (CMAKE_SYSTEM_NAME Generic)
2
+ set (CMAKE_SYSTEM_VERSION 1)
3
+ set (CMAKE_SYSTEM_PROCESSOR wasm32)
4
+ set (triple wasm32-unknown-wasi)
5
+
6
+ set (WASI_SDK_PREFIX "${SWIFT_SOURCE_PREFIX} /wasi-sdk" )
7
+
8
+ set (CMAKE_C_COMPILER ${WASI_SDK_PREFIX} /bin/clang)
9
+ set (CMAKE_CXX_COMPILER ${WASI_SDK_PREFIX} /bin/clang++)
10
+ set (CMAKE_AR ${WASI_SDK_PREFIX} /bin/llvm-ar CACHE STRING "wasi-sdk build" )
11
+ set (CMAKE_RANLIB ${WASI_SDK_PREFIX} /bin/llvm-ranlib CACHE STRING "wasi-sdk build" )
12
+ set (CMAKE_C_COMPILER_TARGET ${triple} CACHE STRING "wasi-sdk build" )
13
+ set (CMAKE_CXX_COMPILER_TARGET ${triple} CACHE STRING "wasi-sdk build" )
14
+ set (CMAKE_EXE_LINKER_FLAGS "-Wl,--no-threads" CACHE STRING "wasi-sdk build" )
15
+
16
+ set (CMAKE_SYSROOT ${WASI_SDK_PREFIX} /share/wasi-sysroot CACHE STRING "wasi-sdk build" )
17
+ set (CMAKE_STAGING_PREFIX ${WASI_SDK_PREFIX} /share/wasi-sysroot CACHE STRING "wasi-sdk build" )
18
+
19
+ # Don't look in the sysroot for executables to run during the build
20
+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
21
+ # Only look in the sysroot (not in the host paths) for the rest
22
+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
23
+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
24
+ set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
25
+
26
+ # Some other hacks
27
+ set (CMAKE_C_COMPILER_WORKS ON )
28
+ set (CMAKE_CXX_COMPILER_WORKS ON )
You can’t perform that action at this time.
0 commit comments