From 5db419d044149ab3760c1588b44536febab5d657 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Sat, 11 Sep 2021 08:41:57 +0100 Subject: [PATCH] Set C++ standard (to C++14) using CMake Not adding the -std flag broke builds with GCC 11 until the code was fixed up recently. This should prevent this sort of thing from happening in future. It also ensures that the compiler is actually new enough. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ab991c97..b55c545a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,9 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE) message(STATUS "Used Toolchain definition file '${CMAKE_TOOLCHAIN_FILE}'") endif() +set(CMAKE_CXX_STANDARD 14) +set(CXX_STANDARD_REQUIRED ON) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules" "${CMAKE_SOURCE_DIR}/external/libutil/cmake") if(CMAKE_VERSION VERSION_LESS 3.14) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/external/libutil/cmake/cmake_3.14") -- 2.32.0