diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b659762..26b77abe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,8 +42,6 @@ endfunction() list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") include(TestCXX17) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED true) if(NOT CYGWIN) # We don't want to use -std=gnu++17 instead of -std=c++17, but among other # things, -std=c++17 on cygwin defines __STRICT_ANSI__ which makes cygwin diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1697bf30..4c7c8f2e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -86,16 +86,11 @@ set_target_properties(znclib PROPERTIES OUTPUT_NAME "znc" SOVERSION "${ZNC_VERSION}") -# CMake started supporting metafeature cxx_std_11 only in 3.8 -set(required_cxx11_features - cxx_range_for cxx_nullptr cxx_override - cxx_lambdas cxx_auto_type) -target_compile_features(znc PUBLIC ${required_cxx11_features}) -target_compile_features(znclib PUBLIC ${required_cxx11_features}) - add_library(ZNC INTERFACE) target_link_libraries(ZNC INTERFACE ${znc_link} ${zncpubdeps}) target_compile_definitions(ZNC INTERFACE "znc_export_lib_EXPORTS") +target_compile_features(ZNC INTERFACE cxx_std_17) +target_compile_features(znclib PUBLIC cxx_std_17) if(HAVE_I18N) add_subdirectory(po)