mirror of
https://github.com/znc/znc.git
synced 2026-08-10 02:43:05 +02:00
Require C++ version via cmake features
This works nicely with znc-buildmod because it will now ask cmake to support at least C++17, but not limit modules to it
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user