Skip to content

Commit

Permalink
emscripten: if multithreading, pass -pthread to all dependers of imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Oct 20, 2023
1 parent ea654d4 commit 0666c88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hello_imgui_cmake/emscripten/hello_imgui_emscripten.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function(hello_imgui_emscripten_set_shell_file app_name)

if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/shell.emscripten.html)
set(shell_file ${CMAKE_CURRENT_SOURCE_DIR}/shell.emscripten.html)
message(WARNING "app_name=${app_name} shell_file=${shell_file}")
else()
set(shell_template_file ${HELLOIMGUI_BASEPATH}/hello_imgui_cmake/emscripten/shell.emscripten.html)
get_property(runtime_output_directory TARGET ${app_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY)
Expand Down Expand Up @@ -43,6 +42,11 @@ function(hello_imgui_emscripten_target_compile_options app_name)
if (NOT HELLOIMGUI_EMSCRIPTEN_PTHREAD OR HELLOIMGUI_EMSCRIPTEN_PTHREAD_ALLOW_MEMORY_GROWTH)
target_link_options(${app_name} PRIVATE -sALLOW_MEMORY_GROWTH)
endif()
if (HELLOIMGUI_EMSCRIPTEN_PTHREAD)
# if using multithreading, *everything* needs to be compiled with -pthread
target_compile_options(imgui PUBLIC -pthread)
target_link_options(imgui PUBLIC -pthread)
endif()
endfunction()


Expand Down

0 comments on commit 0666c88

Please sign in to comment.