31 lines
716 B
CMake
31 lines
716 B
CMake
|
function(myx_cmake_write_compiler_detection_header)
|
||
|
|
||
|
if(${CMAKE_VERSION} VERSION_LESS "3.6.0")
|
||
|
return()
|
||
|
endif()
|
||
|
|
||
|
include(WriteCompilerDetectionHeader)
|
||
|
|
||
|
set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/include/compiler_features.hpp)
|
||
|
if(MYX_CMAKE_GENERATED_HEADER_FILENAME)
|
||
|
set(OUTPUT_FILE ${MYX_CMAKE_GENERATED_HEADER_FILENAME})
|
||
|
endif()
|
||
|
|
||
|
write_compiler_detection_header(
|
||
|
FILE ${OUTPUT_FILE}
|
||
|
PREFIX ${MYX_CMAKE_PROJECT_NAME_CANONICAL}
|
||
|
COMPILERS GNU Clang MSVC Intel
|
||
|
FEATURES
|
||
|
cxx_nullptr
|
||
|
cxx_override
|
||
|
cxx_alignas
|
||
|
cxx_alignof
|
||
|
cxx_attributes
|
||
|
cxx_auto_type
|
||
|
cxx_constexpr
|
||
|
cxx_digit_separators
|
||
|
cxx_range_for)
|
||
|
unset(OUTPUT_FILE)
|
||
|
endfunction()
|
||
|
|