File tree Expand file tree Collapse file tree 8 files changed +40
-7
lines changed
native/corehost/browserhost/sample Expand file tree Collapse file tree 8 files changed +40
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,13 @@ endif()
3636OPTION (CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF )
3737
3838if (CLR_CMAKE_TARGET_ARCH_WASM)
39- add_compile_options (-fwasm-exceptions)
39+ add_compile_options (
40+ -fwasm-exceptions
41+ -msimd128)
42+ add_link_options (
43+ -fwasm-exceptions
44+ -msimd128
45+ )
4046endif ()
4147
4248#----------------------------------------------------
Original file line number Diff line number Diff line change @@ -230,6 +230,14 @@ function(set_target_definitions_to_custom_os_and_arch)
230230 set_target_properties (${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_ARCH TRUE )
231231 set_target_properties (${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_OS TRUE )
232232
233+ if (TARGETDETAILS_OS STREQUAL "browser" )
234+ target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_UNIX)
235+ target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_BROWSER)
236+ endif ()
237+ if (TARGETDETAILS_OS STREQUAL "wasi" )
238+ target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_UNIX)
239+ target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_WASI)
240+ endif ()
233241 if ((TARGETDETAILS_OS MATCHES "^unix" ))
234242 target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_UNIX)
235243 if (TARGETDETAILS_ARCH STREQUAL "x64" )
@@ -269,6 +277,8 @@ function(set_target_definitions_to_custom_os_and_arch)
269277 target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_LOONGARCH64)
270278 elseif ((TARGETDETAILS_ARCH STREQUAL "arm" ) OR (TARGETDETAILS_ARCH STREQUAL "armel" ))
271279 target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM)
280+ elseif (TARGETDETAILS_ARCH STREQUAL "wasm" )
281+ target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_WASM)
272282 elseif ((TARGETDETAILS_ARCH STREQUAL "riscv64" ))
273283 target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT)
274284 target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_RISCV64)
Original file line number Diff line number Diff line change @@ -89,3 +89,7 @@ endif (NOT CLR_CMAKE_TARGET_ARCH_RISCV64)
8989if (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)
9090 create_gcinfo_lib(TARGET gcinfo_unix_x86 OS unix ARCH x86)
9191endif (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)
92+
93+ if (CLR_CMAKE_TARGET_ARCH_WASM)
94+ create_gcinfo_lib(TARGET gcinfo_unix_wasm OS browser ARCH wasm)
95+ endif (CLR_CMAKE_TARGET_ARCH_WASM)
Original file line number Diff line number Diff line change @@ -51,7 +51,10 @@ else(CLR_CMAKE_HOST_WIN32)
5151 System .Native.TimeZoneData)
5252 # linker options for NodeJs, link in JavaScript helper, access to local filesystem
5353 if (CLR_CMAKE_TARGET_BROWSER)
54- target_compile_options (corerun PRIVATE -fwasm-exceptions)
54+ target_compile_options (corerun PRIVATE
55+ -fwasm-exceptions
56+ -msimd128
57+ )
5558 target_link_libraries (corerun PRIVATE
5659 System .Native.Browser-Static )
5760 set (JS_SYSTEM_NATIVE_BROWSER
@@ -66,6 +69,7 @@ else(CLR_CMAKE_HOST_WIN32)
6669 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} " )
6770 target_link_options (corerun PRIVATE
6871 -fwasm-exceptions
72+ -msimd128
6973 -sEXIT_RUNTIME=1
7074 -sINITIAL_MEMORY=134217728
7175 -sENVIRONMENT=node,shell
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ target_include_directories(corewasmrun PRIVATE
1616 ../corerun
1717)
1818
19- target_compile_options (corewasmrun PRIVATE -fwasm-exceptions)
19+ target_compile_options (corewasmrun PRIVATE
20+ -fwasm-exceptions
21+ -msimd128
22+ )
2023
2124set (JS_SYSTEM_NATIVE_BROWSER
2225 "${CLR_ARTIFACTS_OBJ_DIR} /native/browser-${CMAKE_BUILD_TYPE} -wasm/System.Native.Browser/libSystem.Native.Browser.js" )
@@ -30,6 +33,7 @@ set_target_properties(corewasmrun PROPERTIES
3033 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} " )
3134target_link_options (corewasmrun PRIVATE
3235 -fwasm-exceptions
36+ -msimd128
3337 -sEXIT_RUNTIME=1
3438 -sINITIAL_MEMORY=134217728
3539 -sSTACK_SIZE=5MB
Original file line number Diff line number Diff line change 4343#define GC_STATS
4444#endif
4545
46- #if defined(TARGET_X86 ) || defined(TARGET_ARM ) || defined(TARGET_BROWSER )
46+ #if defined(TARGET_X86 ) || defined(TARGET_ARM ) || defined(TARGET_WASM )
4747 #define USE_LAZY_PREFERRED_RANGE 0
4848
4949#elif defined(TARGET_64BIT )
Original file line number Diff line number Diff line change @@ -9,8 +9,14 @@ include_directories(${COREPAL_SOURCE_DIR}/../inc)
99if (NOT CLR_CMAKE_TARGET_BROWSER)
1010 add_compile_options (-fexceptions)
1111else ()
12- add_compile_options (-fwasm-exceptions)
13- add_link_options (-fwasm-exceptions -sEXIT_RUNTIME=1)
12+ add_compile_options (
13+ -fwasm-exceptions
14+ -msimd128
15+ )
16+ add_link_options (
17+ -fwasm-exceptions
18+ -msimd128
19+ )
1420endif ()
1521
1622add_subdirectory (src)
Original file line number Diff line number Diff line change 33
44# this is just a incomplete sample app deployment
55# WASM-TODO: implement proper in-tree project via MSBuild and WASM SDK
6- # WASM-TODO: deploy *.js.map when available
76set (SAMPLE_ASSETS
87 index.html
98 main.mjs
You can’t perform that action at this time.
0 commit comments