File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ file(TOUCH "${PROJECTM_DUMMY_SOURCE_FILE}")
6060
6161if (CMAKE_SYSTEM_NAME STREQUAL Emscripten)
6262 set (ENABLE_EMSCRIPTEN ON CACHE BOOL "Build for web with emscripten. Will also build the SDL2-based entrypoint." FORCE)
63+ option (USE_PTHREADS "Enable multithreading support" OFF )
6364else ()
6465 set (ENABLE_EMSCRIPTEN OFF CACHE BOOL "Build for web with emscripten. Requires emscripten toolset for building." FORCE)
6566endif ()
@@ -122,6 +123,11 @@ if(ENABLE_EMSCRIPTEN)
122123 "SHELL:-s NO_DISABLE_EXCEPTION_CATCHING"
123124 )
124125
126+ if (USE_PTHREADS)
127+ add_compile_options ("SHELL:-s USE_PTHREADS=1" )
128+ add_link_options ("SHELL:-s USE_PTHREADS=1" )
129+ endif ()
130+
125131 set (USE_GLES ON )
126132else ()
127133 if (ENABLE_SDL_UI)
@@ -242,6 +248,9 @@ if(ENABLE_SDL_UI)
242248endif ()
243249message (STATUS " OpenGL ES: ${ENABLE_GLES} " )
244250message (STATUS " Emscripten: ${ENABLE_EMSCRIPTEN} " )
251+ if (CMAKE_SYSTEM_NAME STREQUAL Emscripten)
252+ message (STATUS " - PThreads: ${USE_PTHREADS} " )
253+ endif ()
245254message (STATUS " Use system GLM: ${ENABLE_SYSTEM_GLM} " )
246255message (STATUS " Link UI with shared lib: ${ENABLE_SHARED_LINKING} " )
247256message (STATUS "" )
You can’t perform that action at this time.
0 commit comments