Skip to content

Commit

Permalink
Remove explicit --std=c++11 compile-option
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-kar authored and dtrugman committed Jul 8, 2024
1 parent b87122d commit a16e95f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Expand All @@ -64,13 +65,15 @@ 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()

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()

Expand Down
6 changes: 3 additions & 3 deletions sample/enum_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int enum_net(std::vector<std::string>&& args)

auto dev = net.get_dev();
print(dev);

auto icmp = net.get_icmp();
print(icmp);

Expand Down Expand Up @@ -66,8 +66,8 @@ int enum_net(std::vector<std::string>&& 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);
Expand Down

0 comments on commit a16e95f

Please sign in to comment.