diff --git a/CMakeLists.txt b/CMakeLists.txt index 389eb0c..f165861 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,31 @@ elseif (UNIX) set(DISABLE_RTTI "-fno-rtti -fno-exceptions ") endif () +##-------- +# - Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU +# libstdc++ when it cannot be properly recognized, e.g. when used +# with Clang on Linux* OS. Inspired by a contribution from David A. +if(NOT TBB_USE_GLIBCXX_VERSION AND UNIX AND NOT APPLE) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + # using Clang + string(REPLACE "." "0" TBB_USE_GLIBCXX_VERSION ${CMAKE_CXX_COMPILER_VERSION}) + message(STATUS "TBB_USE_GLIBCXX_VERSION:${TBB_USE_GLIBCXX_VERSION}:") + + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + # Do nothing using GCC + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") + # Do nothing when using Intel C++ + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # Do nothgin when using Visual Studio C++ + endif() +endif() +if(TBB_USE_GLIBCXX_VERSION) + message(STATUS "ADDING: -DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION}") + add_definitions(-DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION}) +endif() + +##------- + # Linker export definitions if (APPLE) set (ARCH_PREFIX "mac")