diff --git a/CMakeLists.txt b/CMakeLists.txt index d721a6a13..5218b6f90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -935,7 +935,12 @@ CHECK_C_SOURCE_COMPILES("#include }" LWS_HAS_INTPTR_T) if (LWS_HAVE_PTHREAD_H) - set(CMAKE_REQUIRED_FLAGS "-pthread") + if ((CMAKE_C_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) + set(CMAKE_REQUIRED_FLAGS "-pthread -Wno-error=unused-command-line-argument") + else() + set(CMAKE_REQUIRED_FLAGS "-pthread") + endif() + CHECK_C_SOURCE_COMPILES("#define _GNU_SOURCE #include int main(void) { @@ -1599,7 +1604,7 @@ if (COMPILER_IS_CLANG) # otherwise osx blows a bunch of openssl deprecated api errors set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations" ) if (UNIX AND LWS_HAVE_PTHREAD_H) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread" ) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -Wno-error=unused-command-line-argument" ) endif() endif()