Commit 8a16a084 authored by Lynn Garren's avatar Lynn Garren
Browse files

a better way to find the clang compiler

parent b4690256
......@@ -86,11 +86,10 @@ macro( clhep_autoconf_variables )
endmacro( clhep_autoconf_variables )
macro( _clhep_check_cxxstd )
message(STATUS "_clhep_check_cxxstd debug: CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
message(STATUS "_clhep_check_cxxstd debug: CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "_clhep_check_cxxstd debug: CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
get_filename_component(clhep_cxx_compiler ${CMAKE_CXX_COMPILER} NAME)
if( ${clhep_cxx_compiler} STREQUAL "clang++" )
##message(STATUS "_clhep_check_cxxstd debug: CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
##message(STATUS "_clhep_check_cxxstd debug: CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
##message(STATUS "_clhep_check_cxxstd debug: CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" )
if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 2.9 )
message( FATAL_ERROR "c++11 extensions are not available for ${CMAKE_CXX_COMPILER_ID}${CMAKE_CXX_COMPILER_VERSION}")
else()
......@@ -104,6 +103,8 @@ macro( _clhep_check_cxxstd )
else()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -ftls-model=initial-exec -pthread -Wno-deprecated-declarations" )
endif()
else()
message(STATUS "clhep_set_compiler_flags: Do not know how to set c++11 extensions for ${CMAKE_CXX_COMPILER_ID}")
endif()
endmacro( _clhep_check_cxxstd )
......
Supports Markdown
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