From 4b3801ab6f2c0a7c8f4465d3ced1d407efa34e6a Mon Sep 17 00:00:00 2001 From: Andy Green Date: Fri, 24 Jan 2020 13:55:21 +0000 Subject: [PATCH] cmake: old osx clang: suppress check failures sue to -pthread only recognized at compile time --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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()