LIEF/cmake/LIEFCompilerDetection.cmake
Romain Thomas 262af07311 Use Frozen for static const containers.
Thanks to https://github.com/serge-sans-paille/frozen

By default, Frozen is used if the compiler support C++14. It can be disabled by
using the "LIEF_DISABLE_FROZEN" option during the CMake configuration
step
2018-03-28 05:57:22 +02:00

28 lines
570 B
CMake

if(__add_lief_compiler_detection)
return()
endif()
set(__add_lief_compiler_detection ON)
set(LIEF_SUPPORT_CXX11 0)
set(LIEF_SUPPORT_CXX14 0)
set(LIEF_SUPPORT_CXX17 0)
if (cxx_std_11 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(LIEF_SUPPORT_CXX11 1)
endif()
if (cxx_std_14 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(LIEF_SUPPORT_CXX14 1)
endif()
if (cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES)
set(LIEF_SUPPORT_CXX17 1)
endif()
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/src/compiler_support.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/compiler_support.h"
@ONLY
)