From 0e523618a17a99647fc13a2be1577b9c887d6d64 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sat, 3 Jul 2021 10:57:18 +0000 Subject: [PATCH] cmake: exclude -pthread from Emscripten default build --- cmake/OpenCVCompilerOptions.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()