Skip to content

Commit

Permalink
Require C++ version via cmake features
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthGandalf committed Nov 18, 2023
1 parent 9835f76 commit f425dda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions src/CMakeLists.txt
Expand Up @@ -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)
Expand Down

0 comments on commit f425dda

Please sign in to comment.