File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,18 @@ elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
225225 target_link_options (Foundation PRIVATE "SHELL:-no-toolchain-stdlib-rpath" )
226226endif ()
227227
228+ if (CMAKE_SYSTEM_NAME STREQUAL WASI)
229+ target_compile_options (Foundation PRIVATE
230+ "SHELL:-Xcc -D_WASI_EMULATED_MMAN
231+ -Xcc -D_WASI_EMULATED_SIGNAL
232+ -Xcc -D_WASI_EMULATED_PROCESS_CLOCKS
233+ -Xcc -D_WASI_EMULATED_GETPID" )
234+ # Link wasi-libc emulation libraries. Other emulation libs are also used in stdlib
235+ target_compile_options (Foundation
236+ PRIVATE
237+ "SHELL:-Xfrontend -public-autolink-library -Xfrontend wasi-emulated-getpid" )
238+ endif ()
239+
228240
229241set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS Foundation)
230242_install_target(Foundation)
Original file line number Diff line number Diff line change @@ -43,6 +43,12 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
4343 target_link_options (FoundationXML PRIVATE "SHELL:-no-toolchain-stdlib-rpath" )
4444endif ()
4545
46+ if (CMAKE_SYSTEM_NAME STREQUAL WASI)
47+ target_compile_options (FoundationXML PRIVATE
48+ "SHELL:-Xcc -D_WASI_EMULATED_SIGNAL
49+ -Xcc -D_WASI_EMULATED_PROCESS_CLOCKS
50+ -Xcc -D_WASI_EMULATED_MMAN" )
51+ endif ()
4652
4753set_property (GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML)
4854_install_target(FoundationXML)
You can’t perform that action at this time.
0 commit comments