diff options
author | Sadie Powell <sadie@witchery.services> | 2022-01-03 16:49:24 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2022-01-03 19:02:44 +0000 |
commit | d76d74719687bd2bce2af661208e77db365c1b2d (patch) | |
tree | fa7e68e4c8d7b8eadec75a9b5690956d5b0d1ce2 /CMakeLists.txt | |
parent | aee1e53cb3bec6d30f171bfbc14a69be46a3f31c (diff) |
Require C++17 to build Anope.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f3e94feed..2d02f3ea6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,12 +17,10 @@ set(ENV{LC_ALL} C) set(DEFAULT_LIBRARY_DIRS) set(DEFAULT_INCLUDE_DIRS) -# Check that we aren't running on an ancient broken GCC -if(CMAKE_COMPILER_IS_GNUCXX) - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2) - message(FATAL_ERROR "Your compiler is too old to build Anope. Upgrade to GCC 4.2 or newer!") - endif() -endif() +# We require C++17 to build +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) # If we are using a GNU compiler (have to use CXX because it seems to fail on C), we will be able to determine it's default paths for libraries and includes if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang$") @@ -193,9 +191,9 @@ else() set(CXXFLAGS "${CXXFLAGS} -Wall -Wshadow") # If on a *nix system, also set the compile flags to remove GNU extensions (favor ISO C++) as well as reject non-ISO C++ code, also remove all leading underscores in exported symbols (only on GNU compiler) if(UNIX) - set(CXXFLAGS "${CXXFLAGS} -ansi -pedantic ${CMAKE_CXX_FLAGS}") + set(CXXFLAGS "${CXXFLAGS} -pedantic ${CMAKE_CXX_FLAGS}") if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CXXFLAGS "${CXXFLAGS} -Wno-long-long -fno-leading-underscore") + set(CXXFLAGS "${CXXFLAGS} -fno-leading-underscore") endif() # If we aren't on a *nix system, we are using MinGW else() |