From d27c5772f583b4f7777bab70fbe70ffb40ac9e8f Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Wed, 30 Oct 2024 20:58:08 +0100 Subject: [PATCH 1/3] Add a deprecation warning when building with C++17 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0931d424c..8f91ea2f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,10 @@ if(NOT CMAKE_CXX_STANDARD MATCHES "17|20") message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}") endif() +if(CMAKE_CXX_STANDARD EQUAL 17) + message(WARNING "C++17 is deprecated and support for it will be removed in the future. Please use at least C++20.") +endif() + # Prevent CMake falls back to the latest standard the compiler does support set(CMAKE_CXX_STANDARD_REQUIRED ON) From 94e744c6d49ead629c469d016bf7e778d5974f43 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 5 Nov 2024 09:47:04 +0100 Subject: [PATCH 2/3] Specify a version when support for C++17 will be removed --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f91ea2f3..24a7014a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ if(NOT CMAKE_CXX_STANDARD MATCHES "17|20") endif() if(CMAKE_CXX_STANDARD EQUAL 17) - message(WARNING "C++17 is deprecated and support for it will be removed in the future. Please use at least C++20.") + message(WARNING "C++17 is deprecated and support for it will be removed in v01-03. Please use at least C++20.") endif() # Prevent CMake falls back to the latest standard the compiler does support From d07f8919cd6f28103441c3d4546eab7e365f777e Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 5 Nov 2024 10:55:53 +0100 Subject: [PATCH 3/3] Set the default to C++20 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24a7014a7..85a744c7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ endif() # Set up C++ Standard # ``-DCMAKE_CXX_STANDARD=`` when invoking CMake -set(CMAKE_CXX_STANDARD 17 CACHE STRING "") +set(CMAKE_CXX_STANDARD 20 CACHE STRING "") if(NOT CMAKE_CXX_STANDARD MATCHES "17|20") message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")