Commit 4cc403a8 authored by Lynn Garren's avatar Lynn Garren

changes to support c++17 for CLHEP-144

parent 0ad93737
2017-09-18 Lynn Garren <garren@fnal.gov>
* support c++17 and c++1z (see CLHEP-144)
code contributed by Chris Green
==============================
21.03.17 Release CLHEP-2.3.4.4
==============================
......
2017-09-18 Lynn Garren <garren@fnal.gov>
* test: remove unused test .cc files to avoid confusion
==============================
21.03.17 Release CLHEP-2.3.4.4
==============================
......
......@@ -184,6 +184,66 @@ macro( _clhep_verify_cxx14 )
endif()
endmacro( _clhep_verify_cxx14 )
macro( _clhep_verify_cxx1z )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0 )
message( FATAL_ERROR "c++1z 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 "AppleClang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0 )
message( FATAL_ERROR "c++1z 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 17.0)
message( FATAL_ERROR "c++1z extension is not available for ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
else()
set( HAVE_STDCXX true )
endif()
elseif(CMAKE_COMPILER_IS_GNUCXX)
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 )
message( FATAL_ERROR "c++1z extension is not available for ${CMAKE_CXX_COMPILER}")
else()
set( HAVE_STDCXX true )
endif()
else()
message(STATUS "clhep_set_compiler_flags: Do not know how to set c++1z extensions for ${CMAKE_CXX_COMPILER_ID}")
endif()
endmacro( _clhep_verify_cxx1z )
macro( _clhep_verify_cxx17 )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 )
message( FATAL_ERROR "c++17 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 "AppleClang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0 )
message( FATAL_ERROR "c++17 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 18.0)
message( FATAL_ERROR "c++17 extension is not available for ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
else()
set( HAVE_STDCXX true )
endif()
elseif(CMAKE_COMPILER_IS_GNUCXX)
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.4.0 )
message( FATAL_ERROR "c++17 extension is not available for ${CMAKE_CXX_COMPILER}")
else()
set( HAVE_STDCXX true )
endif()
else()
message(STATUS "clhep_set_compiler_flags: Do not know how to set c++17 extensions for ${CMAKE_CXX_COMPILER_ID}")
endif()
endmacro( _clhep_verify_cxx17 )
macro( _clhep_check_cxxstd )
if( CLHEP_DEBUG_MESSAGES )
message(STATUS "_clhep_check_cxxstd debug: CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
......@@ -201,6 +261,10 @@ macro( _clhep_check_cxxstd )
_clhep_verify_cxx1y()
elseif( "${CLHEP_BUILD_CXXSTD}" STREQUAL "-std=c++14" )
_clhep_verify_cxx14()
elseif( "${CLHEP_BUILD_CXXSTD}" STREQUAL "-std=c++1z" )
_clhep_verify_cxx1z()
elseif( "${CLHEP_BUILD_CXXSTD}" STREQUAL "-std=c++17" )
_clhep_verify_cxx17()
elseif( DEFINED CLHEP_BUILD_CXXSTD )
message( FATAL_ERROR "${CLHEP_BUILD_CXXSTD} is not supported. Supported extensions are c++11, c++1y, and c++14.")
else()
......
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