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

explict support for the Intel compiler

parent dd0b405e
......@@ -108,7 +108,13 @@ endmacro( _clhep_verify_cxx0x )
macro( _clhep_verify_cxx11 )
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3 )
message( FATAL_ERROR "c++11 extension is not available for ${CMAKE_CXX_COMPILER_ID}${CMAKE_CXX_COMPILER_VERSION}")
message( FATAL_ERROR "c++11 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 12.0)
message( FATAL_ERROR "c++11 extension is not available for ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
else()
set( HAVE_STDCXX true )
endif()
......@@ -132,6 +138,13 @@ macro( _clhep_verify_cxx1y )
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
message( STATUS "COMPILER_VERSION_MAJOR is ${COMPILER_VERSION_MAJOR}")
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}")
else()
set( HAVE_STDCXX true )
endif()
elseif(CMAKE_COMPILER_IS_GNUCXX)
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9 )
message( FATAL_ERROR "c++1y extension is not available for ${CMAKE_CXX_COMPILER}")
......@@ -150,6 +163,13 @@ macro( _clhep_verify_cxx14 )
else()
set( HAVE_STDCXX true )
endif()
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
message( STATUS "COMPILER_VERSION_MAJOR is ${COMPILER_VERSION_MAJOR}")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
message( FATAL_ERROR "c++11 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 4.9 )
message( FATAL_ERROR "c++14 extension is not available for ${CMAKE_CXX_COMPILER}")
......@@ -189,6 +209,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} -pthread" )
elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLHEP_BUILD_CXXSTD} -pthread" )
elseif(CMAKE_COMPILER_IS_GNUCXX)
set( CMAKE_CXX_FLAGS "${CLHEP_BUILD_CXXSTD} -pthread ${CMAKE_CXX_FLAGS} -D_GNU_SOURCE" )
else()
......@@ -237,13 +259,19 @@ macro( clhep_set_compiler_flags )
#else()
# _clhep_check_for_pthread()
#endif()
#message(STATUS "clhep_set_compiler_flags debug: CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
#message(STATUS "cmake compilers ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}")
if( CLHEP_DEBUG_MESSAGES )
message(STATUS "clhep_set_compiler_flags debug: CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(STATUS "clhep_set_compiler_flags debug: cmake compilers ${CMAKE_CXX_COMPILER} ${CMAKE_C_COMPILER}")
endif( CLHEP_DEBUG_MESSAGES )
get_filename_component(clhep_cxx_compiler ${CMAKE_CXX_COMPILER} NAME)
get_filename_component(clhep_c_compiler ${CMAKE_C_COMPILER} NAME)
#message(STATUS "using compilers ${clhep_cxx_compiler} ${clhep_c_compiler}")
if( CLHEP_DEBUG_MESSAGES )
message(STATUS "using compilers ${clhep_cxx_compiler} ${clhep_c_compiler}")
endif( CLHEP_DEBUG_MESSAGES )
if( ${clhep_c_compiler} STREQUAL "clang" )
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}")
elseif( CMAKE_COMPILER_IS_GNUCC )
set(CMAKE_C_FLAGS "-O -ansi -pedantic -Wall -D_GNU_SOURCE ${CMAKE_C_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