From: Michael Altizer (mialtize) Date: Fri, 13 Mar 2020 21:37:04 +0000 (+0000) Subject: Merge pull request #2067 in SNORT/snort3 from ~MIALTIZE/snort3:cxx14 to master X-Git-Tag: 3.0.0-270~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dec29b3a9b6cfee50eb5584abd54780b349f7db1;p=thirdparty%2Fsnort3.git Merge pull request #2067 in SNORT/snort3 from ~MIALTIZE/snort3:cxx14 to master Squashed commit of the following: commit be07a2b2ac719b81b1d16e09e9cb552e73573a29 Author: Michael Altizer Date: Fri Mar 6 18:13:43 2020 -0500 build: Bump the C++ compiler supported feature set requirement to C++14 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5be70a626..4981a7fc7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ set (VERSION_MINOR 0) set (VERSION_PATCH 0) set (VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") -set (CMAKE_CXX_STANDARD 11) +set (CMAKE_CXX_STANDARD 14) set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_CXX_EXTENSIONS OFF) diff --git a/README.md b/README.md index da13b7022..232a55ce4 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ the latest: * cmake to build from source * daq from https://github.com/snort3/libdaq for packet IO * dnet from https://github.com/dugsong/libdnet.git for network utility functions -* g++ >= 4.8 or other C++11 compiler +* g++ >= 5 or other C++14 compiler * hwloc from https://www.open-mpi.org/projects/hwloc/ for CPU affinity management * LuaJIT from http://luajit.org for configuration and scripting * OpenSSL from https://www.openssl.org/source/ for SHA and MD5 file signatures, diff --git a/cmake/compiler_features.cmake b/cmake/compiler_features.cmake index f136fdc90..23d447936 100644 --- a/cmake/compiler_features.cmake +++ b/cmake/compiler_features.cmake @@ -1,5 +1,5 @@ set ( _SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} ) -set ( CMAKE_REQUIRED_FLAGS "-std=c++11 -fPIC -shared -Wl,-undefined,dynamic_lookup" ) +set ( CMAKE_REQUIRED_FLAGS "-std=c++14 -fPIC -shared -Wl,-undefined,dynamic_lookup" ) unset ( HAVE_EXTERN_GNU_TLS ) check_cxx_source_compiles ( diff --git a/cmake/platforms.cmake b/cmake/platforms.cmake index 14b245661..e8acf4725 100644 --- a/cmake/platforms.cmake +++ b/cmake/platforms.cmake @@ -11,15 +11,6 @@ endif() set (CMAKE_SKIP_RPATH ON) -if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") - set(GNUCXX_MINVER "4.8.1") - message(STATUS "g++ version ${CMAKE_CXX_COMPILER_VERSION}") - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS GNUCXX_MINVER) - message(FATAL_ERROR "A minimum of g++ ${GNUCXX_MINVER} is required for C++11 support") - endif() -endif() - - # the Clang compiler on MacOS X may need the c++ library explicitly specified if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/doc/tutorial.txt b/doc/tutorial.txt index b8537c042..fab457033 100644 --- a/doc/tutorial.txt +++ b/doc/tutorial.txt @@ -7,12 +7,12 @@ out more advanced usage. Required: +* a compiler that supports the C++14 feature set + * cmake to build from source * daq from https://github.com/snort3/libdaq for packet IO -* g\++ >= 4.8 or other recent C++11 compiler - * dnet from https://github.com/dugsong/libdnet.git for network utility functions diff --git a/src/network_inspectors/appid/test/tp_mock.cc b/src/network_inspectors/appid/test/tp_mock.cc index 8ed7b86bb..d46f8bbf7 100644 --- a/src/network_inspectors/appid/test/tp_mock.cc +++ b/src/network_inspectors/appid/test/tp_mock.cc @@ -20,7 +20,7 @@ // Standalone compilation: // g++ -g -Wall -I.. -I/path/to/snort3/src -c tp_mock.cc -// g++ -std=c++11 -g -Wall -I.. -I/path/to/snort3/src -shared -fPIC -o libtp_mock.so tp_mock.cc +// g++ -std=c++14 -g -Wall -I.. -I/path/to/snort3/src -shared -fPIC -o libtp_mock.so tp_mock.cc // As a module (dynamically loaded) - see CMakeLists.txt #include