Commit f6094492 authored by Lynn Garren's avatar Lynn Garren
Browse files

need to recognize both Clang and AppleClang

parent a1059400
2016-04-21 Lynn Garren <garren@fnal.gov>
* cmake: need to recognize both Clang and AppleClang
==============================
19.04.16 Release CLHEP-2.3.2.1
==============================
......
......@@ -95,6 +95,12 @@ macro( _clhep_verify_cxx11 )
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5 )
message( FATAL_ERROR "CLHEP now requires c++11 support with clang 3.5 or later")
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 14.0)
message( FATAL_ERROR "c++11 extension is not available for ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
......@@ -119,6 +125,12 @@ macro( _clhep_verify_cxx1y )
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5 )
message( FATAL_ERROR "c++1y extension is not available for ${CMAKE_CXX_COMPILER_ID}${CMAKE_CXX_COMPILER_VERSION}")
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0)
message( FATAL_ERROR "c++11 extension is not available for ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
......@@ -143,6 +155,12 @@ macro( _clhep_verify_cxx14 )
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5 )
message( FATAL_ERROR "c++14 extension is not available for ${CMAKE_CXX_COMPILER_ID}${CMAKE_CXX_COMPILER_VERSION}")
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
message( FATAL_ERROR "c++14 extension is not available for ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
......@@ -188,6 +206,8 @@ macro( _clhep_check_cxxstd )
if( DEFINED HAVE_STDCXX )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLHEP_BUILD_CXXSTD}" )
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLHEP_BUILD_CXXSTD}" )
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLHEP_BUILD_CXXSTD" )
elseif(CMAKE_COMPILER_IS_GNUCXX)
......@@ -227,6 +247,8 @@ macro( clhep_set_compiler_flags )
endif( CLHEP_DEBUG_MESSAGES )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
set(CMAKE_C_FLAGS "-O -pedantic -Wall ${CMAKE_C_FLAGS}")
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" )
set(CMAKE_C_FLAGS "-O -pedantic -Wall ${CMAKE_C_FLAGS}")
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
set(CMAKE_C_FLAGS "-O -ansi -pedantic -Wall {CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-O -ansi -pedantic -Wall ${CMAKE_CXX_FLAGS}")
......@@ -235,6 +257,8 @@ macro( clhep_set_compiler_flags )
endif()
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
set(CMAKE_CXX_FLAGS "-O -pedantic -Wall ${CMAKE_CXX_FLAGS}")
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" )
set(CMAKE_CXX_FLAGS "-O -pedantic -Wall ${CMAKE_CXX_FLAGS}")
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-O -ansi -pedantic -Wall -D_GNU_SOURCE ${CMAKE_CXX_FLAGS}")
endif()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment