File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,18 @@ target_include_directories(qjs PUBLIC
172172
173173if (EMSCRIPTEN)
174174 add_executable (qjs_wasm ${qjs_sources} )
175+ target_link_options (qjs_wasm PRIVATE
176+ # in emscripten 3.x, this will be set to 16k which is too small for quickjs. #write sth. to force github rebuild
177+ -sSTACK_SIZE=2097152 # let it be 2m = 2 * 1024 * 1024 = 2097152, otherwise, stack overflow may be occured at bootstrap
178+ -sNO_INVOKE_RUN
179+ -sNO_EXIT_RUNTIME
180+ -sMODULARIZE # do not mess the global
181+ -sEXPORT_ES6 # export js file to morden es module
182+ -sEXPORT_NAME=getQuickJs # give a name
183+ -sTEXTDECODER=1 # it will be 2 if we use -Oz, and that will cause js -> c string convertion fail
184+ -sNO_DEFAULT_TO_CXX # this project is pure c project, no need for c plus plus handle
185+ -sEXPORTED_RUNTIME_METHODS=ccall,cwrap
186+ )
175187 target_compile_definitions (qjs_wasm PRIVATE ${qjs_defines} )
176188 target_link_libraries (qjs_wasm m)
177189endif ()
You can’t perform that action at this time.
0 commit comments