Skip to content

Commit

Permalink
[build] Fixed Linux build with STDCXX SYNC enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Aug 5, 2020
1 parent 088962b commit a6e4b9a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Intel|Clang|AppleClang")
# At the bottom there's information about C++98, which is default up to 6.1 version.
# For all other compilers - including Clang - we state that the default C++ standard is AT LEAST 11.
if (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 6.1)
message(STATUS "NOTE: GCC ${CMAKE_CXX_COMPILER_VERSION} is detected with default C++98. Forcing C++11 on applications.")
message(STATUS "NOTE: GCC ${CMAKE_CXX_COMPILER_VERSION} is detected with default C++98. Forcing C++11 on applications.")
set (FORCE_CXX_STANDARD 1)
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang|AppleClang")
message(STATUS "NOTE: CLANG ${CMAKE_CXX_COMPILER_VERSION} detected, unsure if >=C++11 is default, forcing C++11 on applications")
set (FORCE_CXX_STANDARD 1)
else()
message(STATUS "NOTE: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} - assuming default C++11.")
message(STATUS "NOTE: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} - assuming default C++11.")
endif()
else()
message(STATUS "COMPILER: ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) - NOT GNU compat")
Expand Down Expand Up @@ -629,7 +629,8 @@ if (ENABLE_CODE_COVERAGE)
endif()
endif()

if (ENABLE_STDCXX_SYNC)
if (ENABLE_STDCXX_SYNC AND NOT LINUX)
# On Linux pthreads have to be linked even when using C++11 threads
message(STATUS "Pthread library: C++11")
elseif (PTHREAD_LIBRARY AND PTHREAD_INCLUDE_DIR)
message(STATUS "Pthread library: ${PTHREAD_LIBRARY}")
Expand Down

0 comments on commit a6e4b9a

Please sign in to comment.