From: Alexander Alekhin Date: Sat, 3 Jul 2021 10:57:18 +0000 (+0000) Subject: cmake: exclude -pthread from Emscripten default build X-Git-Tag: submit/tizen/20220120.021815~1^2~1^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0e523618a17a99647fc13a2be1577b9c887d6d64;p=platform%2Fupstream%2Fopencv.git cmake: exclude -pthread from Emscripten default build --- diff --git a/cmake/OpenCVCompilerOptions.cmake b/cmake/OpenCVCompilerOptions.cmake index 0a10bfffcf..303d4f451e 100644 --- a/cmake/OpenCVCompilerOptions.cmake +++ b/cmake/OpenCVCompilerOptions.cmake @@ -177,7 +177,13 @@ if(CV_GCC OR CV_CLANG) endif() # We need pthread's - if(UNIX AND NOT ANDROID AND NOT (APPLE AND CV_CLANG)) # TODO + if((UNIX + AND NOT ANDROID + AND NOT (APPLE AND CV_CLANG) + AND NOT EMSCRIPTEN + ) + OR (EMSCRIPTEN AND WITH_PTHREADS_PF) # https://github.com/opencv/opencv/issues/20285 + ) add_extra_compiler_option(-pthread) endif()