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()
36
36
OPTION (CLR_CMAKE_ENABLE_CODE_COVERAGE "Enable code coverage" OFF )
37
37
38
38
if (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
+ )
40
46
endif ()
41
47
42
48
#----------------------------------------------------
Original file line number Diff line number Diff line change @@ -230,6 +230,14 @@ function(set_target_definitions_to_custom_os_and_arch)
230
230
set_target_properties (${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_ARCH TRUE )
231
231
set_target_properties (${TARGETDETAILS_TARGET} PROPERTIES IGNORE_DEFAULT_TARGET_OS TRUE )
232
232
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 ()
233
241
if ((TARGETDETAILS_OS MATCHES "^unix" ))
234
242
target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_UNIX)
235
243
if (TARGETDETAILS_ARCH STREQUAL "x64" )
@@ -269,6 +277,8 @@ function(set_target_definitions_to_custom_os_and_arch)
269
277
target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_LOONGARCH64)
270
278
elseif ((TARGETDETAILS_ARCH STREQUAL "arm" ) OR (TARGETDETAILS_ARCH STREQUAL "armel" ))
271
279
target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_ARM)
280
+ elseif (TARGETDETAILS_ARCH STREQUAL "wasm" )
281
+ target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_WASM)
272
282
elseif ((TARGETDETAILS_ARCH STREQUAL "riscv64" ))
273
283
target_compile_definitions (${TARGETDETAILS_TARGET} PRIVATE TARGET_64BIT)
274
284
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)
89
89
if (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX)
90
90
create_gcinfo_lib(TARGET gcinfo_unix_x86 OS unix ARCH x86)
91
91
endif (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)
51
51
System .Native.TimeZoneData)
52
52
# linker options for NodeJs, link in JavaScript helper, access to local filesystem
53
53
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
+ )
55
58
target_link_libraries (corerun PRIVATE
56
59
System .Native.Browser-Static )
57
60
set (JS_SYSTEM_NATIVE_BROWSER
@@ -66,6 +69,7 @@ else(CLR_CMAKE_HOST_WIN32)
66
69
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} " )
67
70
target_link_options (corerun PRIVATE
68
71
-fwasm-exceptions
72
+ -msimd128
69
73
-sEXIT_RUNTIME=1
70
74
-sINITIAL_MEMORY=134217728
71
75
-sENVIRONMENT=node,shell
Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ target_include_directories(corewasmrun PRIVATE
16
16
../corerun
17
17
)
18
18
19
- target_compile_options (corewasmrun PRIVATE -fwasm-exceptions)
19
+ target_compile_options (corewasmrun PRIVATE
20
+ -fwasm-exceptions
21
+ -msimd128
22
+ )
20
23
21
24
set (JS_SYSTEM_NATIVE_BROWSER
22
25
"${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
30
33
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR} " )
31
34
target_link_options (corewasmrun PRIVATE
32
35
-fwasm-exceptions
36
+ -msimd128
33
37
-sEXIT_RUNTIME=1
34
38
-sINITIAL_MEMORY=134217728
35
39
-sSTACK_SIZE=5MB
Original file line number Diff line number Diff line change 43
43
#define GC_STATS
44
44
#endif
45
45
46
- #if defined(TARGET_X86 ) || defined(TARGET_ARM ) || defined(TARGET_BROWSER )
46
+ #if defined(TARGET_X86 ) || defined(TARGET_ARM ) || defined(TARGET_WASM )
47
47
#define USE_LAZY_PREFERRED_RANGE 0
48
48
49
49
#elif defined(TARGET_64BIT )
Original file line number Diff line number Diff line change @@ -9,8 +9,14 @@ include_directories(${COREPAL_SOURCE_DIR}/../inc)
9
9
if (NOT CLR_CMAKE_TARGET_BROWSER)
10
10
add_compile_options (-fexceptions)
11
11
else ()
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
+ )
14
20
endif ()
15
21
16
22
add_subdirectory (src)
Original file line number Diff line number Diff line change 3
3
4
4
# this is just a incomplete sample app deployment
5
5
# WASM-TODO: implement proper in-tree project via MSBuild and WASM SDK
6
- # WASM-TODO: deploy *.js.map when available
7
6
set (SAMPLE_ASSETS
8
7
index.html
9
8
main.mjs
You can’t perform that action at this time.
0 commit comments