From 67b6950857f80e759191043b5fa38acc0354831d Mon Sep 17 00:00:00 2001 From: Juan Miguel Carceller <22276694+jmcarcell@users.noreply.github.com> Date: Fri, 8 Nov 2024 14:28:41 +0100 Subject: [PATCH] Add a deprecation warning when building with C++17 (#700) * Add a deprecation warning when building with C++17 * Specify a version when support for C++17 will be removed * Set the default to C++20 --------- Co-authored-by: jmcarcell --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09489361b..491d03fb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,10 @@ if(NOT CMAKE_CXX_STANDARD MATCHES "20|23") 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 v01-03. 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)