2016-07-05 20:23:39 +03:00
include ( Compiler/Intel )
__compiler_intel ( CXX )
2009-08-21 17:54:42 +04:00
2016-07-05 20:23:39 +03:00
string ( APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG" )
string ( APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG" )
string ( APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG" )
2009-08-21 17:54:42 +04:00
2016-03-15 17:15:53 +03:00
set ( CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>" )
2013-11-04 16:29:19 +04:00
2016-04-18 21:20:32 +03:00
if ( "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" )
set ( _std -Qstd )
2016-10-24 21:16:22 +03:00
set ( _ext c++ )
2016-04-18 21:20:32 +03:00
else ( )
set ( _std -std )
2016-10-24 21:16:22 +03:00
set ( _ext gnu++ )
2016-04-18 21:20:32 +03:00
endif ( )
2015-11-16 19:19:30 +03:00
2016-04-18 21:20:32 +03:00
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.2 )
set ( CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++14" )
# todo: there is no gnu++14 value supported; figure out what to do
set ( CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++14" )
elseif ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0.0 )
set ( CMAKE_CXX14_STANDARD_COMPILE_OPTION "${_std}=c++1y" )
# todo: there is no gnu++14 value supported; figure out what to do
set ( CMAKE_CXX14_EXTENSION_COMPILE_OPTION "${_std}=c++1y" )
endif ( )
2015-11-16 19:19:30 +03:00
2016-04-18 21:20:32 +03:00
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0 )
set ( CMAKE_CXX11_STANDARD_COMPILE_OPTION "${_std}=c++11" )
2016-10-24 21:16:22 +03:00
set ( CMAKE_CXX11_EXTENSION_COMPILE_OPTION "${_std}=${_ext}11" )
2016-04-18 21:20:32 +03:00
elseif ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1 )
set ( CMAKE_CXX11_STANDARD_COMPILE_OPTION "${_std}=c++0x" )
2016-10-24 21:16:22 +03:00
set ( CMAKE_CXX11_EXTENSION_COMPILE_OPTION "${_std}=${_ext}0x" )
2016-04-18 21:20:32 +03:00
endif ( )
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1 )
set ( CMAKE_CXX98_STANDARD_COMPILE_OPTION "${_std}=c++98" )
2016-10-24 21:16:22 +03:00
set ( CMAKE_CXX98_EXTENSION_COMPILE_OPTION "${_std}=${_ext}98" )
2015-11-16 19:19:30 +03:00
endif ( )
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1 )
if ( NOT CMAKE_CXX_COMPILER_FORCED )
if ( NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT )
message ( FATAL_ERROR "CMAKE_CXX_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER}) version ${CMAKE_CXX_COMPILER_VERSION}" )
else ( )
set ( CMAKE_CXX_STANDARD_DEFAULT ${ CMAKE_CXX_STANDARD_COMPUTED_DEFAULT } )
endif ( )
elseif ( NOT CMAKE_CXX_STANDARD_COMPUTED_DEFAULT )
# Compiler id was forced so just guess the default standard level.
set ( CMAKE_CXX_STANDARD_DEFAULT 98 )
endif ( )
endif ( )
2016-04-18 21:20:32 +03:00
unset ( _std )
2016-10-24 21:16:22 +03:00
unset ( _ext )
2016-04-18 21:20:32 +03:00
2015-11-16 19:19:30 +03:00
macro ( cmake_record_cxx_compile_features )
macro ( _get_intel_features std_version list )
record_compiler_features ( CXX "${std_version}" ${ list } )
endmacro ( )
set ( _result 0 )
if ( NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" AND
N O T C M A K E _ C X X _ C O M P I L E R _ V E R S I O N V E R S I O N _ L E S S 1 2 . 1 )
if ( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.0 )
_get_intel_features ( ${ CMAKE_CXX14_STANDARD_COMPILE_OPTION } CMAKE_CXX14_COMPILE_FEATURES )
endif ( )
if ( _result EQUAL 0 )
_get_intel_features ( ${ CMAKE_CXX11_STANDARD_COMPILE_OPTION } CMAKE_CXX11_COMPILE_FEATURES )
endif ( )
if ( _result EQUAL 0 )
_get_intel_features ( ${ CMAKE_CXX98_STANDARD_COMPILE_OPTION } CMAKE_CXX98_COMPILE_FEATURES )
endif ( )
endif ( )
endmacro ( )
2015-07-13 17:35:04 +03:00
set ( CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>" )
set ( CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>" )