Skip to content

Commit 50fd94f

Browse files
committed
More emscripten tests fixes
1 parent d2a27cf commit 50fd94f

1 file changed

Lines changed: 24 additions & 14 deletions

File tree

test/CMakeLists.txt

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,19 @@ foreach(LIB_SUFFIX ${LIB_TYPES})
217217
)
218218
endif()
219219

220-
if (EMSCRIPTEN AND STORAGE_SUFFIX STREQUAL "emscr")
221-
target_compile_definitions(test-${TEST_SUFFIX} PRIVATE
222-
SYS_STRING_USE_WASM_JS_STRING=$<IF:$<BOOL:${NODE_JS_HAS_WASM_JS_STRING}>,1,0>
223-
)
220+
if (EMSCRIPTEN)
224221
target_compile_options(test-${TEST_SUFFIX} PRIVATE
225-
-sMAIN_MODULE=2 -sSTRICT -sNO_DISABLE_EXCEPTION_CATCHING
222+
-sSTRICT -sNO_DISABLE_EXCEPTION_CATCHING
226223
)
224+
225+
if (STORAGE_SUFFIX STREQUAL "emscr")
226+
target_compile_definitions(test-${TEST_SUFFIX} PRIVATE
227+
SYS_STRING_USE_WASM_JS_STRING=$<IF:$<BOOL:${NODE_JS_HAS_WASM_JS_STRING}>,1,0>
228+
)
229+
target_compile_options(test-${TEST_SUFFIX} PRIVATE
230+
-sMAIN_MODULE=2
231+
)
232+
endif()
227233
endif()
228234

229235
target_compile_definitions(test-${TEST_SUFFIX} PRIVATE
@@ -247,17 +253,21 @@ foreach(LIB_SUFFIX ${LIB_TYPES})
247253
$<$<PLATFORM_ID:Android>:-Wl,--export-dynamic>
248254
)
249255

250-
if (EMSCRIPTEN AND STORAGE_SUFFIX STREQUAL "emscr")
256+
if (EMSCRIPTEN)
251257
target_link_options(test-${TEST_SUFFIX} PRIVATE
252-
-sMAIN_MODULE=2
253-
-sSTRICT
254-
-sERROR_ON_UNDEFINED_SYMBOLS=0
255-
-sWARN_ON_UNDEFINED_SYMBOLS=0
256-
-sNO_DISABLE_EXCEPTION_CATCHING
257-
--pre-js ${CMAKE_CURRENT_LIST_DIR}/prefix.js
258-
-sINCOMING_MODULE_JS_API=arguments,canvas,monitorRunDependencies,print,setStatus>
258+
-sSTRICT -sNO_DISABLE_EXCEPTION_CATCHING
259259
)
260-
set_target_properties(test-${TEST_SUFFIX} PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/prefix.js)
260+
261+
if (STORAGE_SUFFIX STREQUAL "emscr")
262+
target_link_options(test-${TEST_SUFFIX} PRIVATE
263+
-sMAIN_MODULE=2
264+
-sERROR_ON_UNDEFINED_SYMBOLS=0
265+
-sWARN_ON_UNDEFINED_SYMBOLS=0
266+
--pre-js ${CMAKE_CURRENT_LIST_DIR}/prefix.js
267+
-sINCOMING_MODULE_JS_API=arguments,canvas,monitorRunDependencies,print,setStatus>
268+
)
269+
set_target_properties(test-${TEST_SUFFIX} PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/prefix.js)
270+
endif()
261271
endif()
262272

263273
if (SYS_STRING_COLLECT_COVERAGE)

0 commit comments

Comments
 (0)