From a16e95ff0bf6bf4438dfe187fc00c838db5f07b5 Mon Sep 17 00:00:00 2001 From: Arie Karchmar Date: Sun, 7 Jul 2024 18:34:15 +0300 Subject: [PATCH] Remove explicit --std=c++11 compile-option --- CMakeLists.txt | 5 ++++- sample/enum_net.cpp | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 294ea22..a33bf36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ option (pfs_BUILD_TESTS "Build tests" ON) # Actual configuration # ------------------------------------------------------------------------ -add_compile_options (-std=c++11 -Wall -Wextra -pedantic -Werror) +add_compile_options (-Wall -Wextra -pedantic -Werror) set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) @@ -43,6 +43,7 @@ aux_source_directory (${pfs_ROOT_SOURCE_DIR}/parsers pfs_PARSERS_SOURCES) set (SOURCES ${pfs_ROOT_SOURCES} ${pfs_PARSERS_SOURCES}) add_library (pfs ${pfs_SHARED_OR_STATIC} ${SOURCES}) +target_compile_features(pfs PUBLIC cxx_std_11) target_include_directories( pfs PUBLIC $ @@ -64,6 +65,7 @@ endif () if (pfs_BUILD_SAMPLES) aux_source_directory (sample pfs_SAMPLE_SOURCES) add_executable (sample ${pfs_SAMPLE_SOURCES}) + target_compile_features(sample PUBLIC cxx_std_11) target_link_libraries (sample PRIVATE pfs) endif() @@ -71,6 +73,7 @@ if (pfs_BUILD_TESTS) set (pfs_UNITTEST_SOURCE_DIR test) aux_source_directory (${pfs_UNITTEST_SOURCE_DIR} pfs_UNITTEST_SOURCES) add_executable (unittest ${pfs_UNITTEST_SOURCES}) + target_compile_features(unittest PUBLIC cxx_std_11) target_link_libraries (unittest PRIVATE pfs) endif() diff --git a/sample/enum_net.cpp b/sample/enum_net.cpp index 9111f9f..a9e79b3 100644 --- a/sample/enum_net.cpp +++ b/sample/enum_net.cpp @@ -35,7 +35,7 @@ int enum_net(std::vector&& args) auto dev = net.get_dev(); print(dev); - + auto icmp = net.get_icmp(); print(icmp); @@ -66,8 +66,8 @@ int enum_net(std::vector&& args) auto udplite6 = net.get_udplite6(); print(udplite6); - auto unix = net.get_unix(); - print(unix); + auto unix_ = net.get_unix(); + print(unix_); auto netlink = net.get_netlink(); print(netlink);