ENH: This adds new compiler specific flags

Compiler flags are optionally set for usign clang on
linux with different glibc versions.

These flags have been migrated from the makefile to
the CMakeLists.txt file.

This resolves #18.
This commit is contained in:
Hans Johnson
2016-09-17 12:42:55 -05:00
committed by Wenzel Jakob
parent e32d75f876
commit e6b7f8d4ff
+25
View File
@@ -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")