From 6e37c20030f78b7ada1e6e580d9df839fb88168c Mon Sep 17 00:00:00 2001 From: Lectem Date: Sun, 7 Apr 2019 12:15:24 +0200 Subject: [PATCH] Use compile features cxx_auto_type cxx_variadic_templates instead of cxx_std_11 --- CMakeLists.txt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b036f60a..760ff1fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 $ @@ -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 $