Use compile features cxx_auto_type cxx_variadic_templates instead of cxx_std_11

This commit is contained in:
Lectem 2019-04-07 12:15:24 +02:00 committed by Victor Zverovich
parent 3de3d76a36
commit 6e37c20030

View File

@ -66,6 +66,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
include(cxx14)
include(CheckCXXCompilerFlag)
set(FMT_REQUIRED_FEATURES cxx_auto_type cxx_variadic_templates)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(PEDANTIC_COMPILE_FLAGS -pedantic-errors -Wall -Wextra -pedantic
-Wold-style-cast -Wundef
@ -158,10 +160,7 @@ if (FMT_PEDANTIC)
target_compile_options(fmt PRIVATE ${PEDANTIC_COMPILE_FLAGS})
endif ()
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.8)
target_compile_features(fmt INTERFACE cxx_std_11)
endif ()
target_compile_features(fmt INTERFACE ${FMT_REQUIRED_FEATURES})
target_include_directories(fmt PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
@ -185,9 +184,7 @@ add_library(fmt::fmt-header-only ALIAS fmt-header-only)
target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)
if (NOT ${CMAKE_VERSION} VERSION_LESS 3.8)
target_compile_features(fmt-header-only INTERFACE cxx_std_11)
endif ()
target_compile_features(fmt-header-only INTERFACE ${FMT_REQUIRED_FEATURES})
target_include_directories(fmt-header-only INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>