diff --git a/cmake/compilers/Clang.cmake b/cmake/compilers/Clang.cmake index 15f2a39684..1b81540e84 100644 --- a/cmake/compilers/Clang.cmake +++ b/cmake/compilers/Clang.cmake @@ -52,8 +52,10 @@ if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag) endif() # Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors -if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)") - set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$>:-mwaitpkg>) +if(NOT EMSCRIPTEN) + if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)") + set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$>:-mwaitpkg>) + endif() endif() # Clang flags to prevent compiler from optimizing out security checks