[clang] force -pthread flag on linux to avoid some cmake bugs

This commit is contained in:
Stefano Sinigardi 2019-03-29 16:09:04 +01:00
parent 751d750952
commit c35c94798a
1 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,9 @@ if(CMAKE_COMPILER_IS_GNUCC)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
if (UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "-pthread ${CMAKE_CXX_FLAGS}") #force pthread to avoid bugs in some cmake setups
endif()
set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-writable-strings ${CMAKE_CXX_FLAGS}")
string(REGEX REPLACE "-O0" "-Og" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
string(REGEX REPLACE "-O3" "-Ofast" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})