diff --git a/CMakeLists.txt b/CMakeLists.txt index 692807a55f..34e36749c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,11 +194,8 @@ endif() # ------------------------------------------------------------------- # Common dependencies #force -pthread during compilation for Emscripten -if (EMSCRIPTEN) +if (EMSCRIPTEN AND NOT EMSCRIPTEN_WITHOUT_PTHREAD) set(THREADS_HAVE_PTHREAD_ARG TRUE) - if(EMSCRIPTEN_NO_PTHREAD) - set(THREADS_HAVE_PTHREAD_ARG FALSE) - endif() endif() set(THREADS_PREFER_PTHREAD_FLAG TRUE) diff --git a/cmake/compilers/Clang.cmake b/cmake/compilers/Clang.cmake index 366428f575..d2980836f7 100644 --- a/cmake/compilers/Clang.cmake +++ b/cmake/compilers/Clang.cmake @@ -16,9 +16,7 @@ if (EMSCRIPTEN) set(TBB_EMSCRIPTEN 1) set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fexceptions) set(TBB_TEST_LINK_FLAGS ${TBB_COMMON_LINK_FLAGS} -fexceptions -sINITIAL_MEMORY=65536000 -sALLOW_MEMORY_GROWTH=1 -sEXIT_RUNTIME=1) - if (EMSCRIPTEN_NO_PTHREAD) - set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES) - else () + if (NOT EMSCRIPTEN_WITHOUT_PTHREAD) set_property(TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "-pthread") endif() endif()