From 5174e022c67a9632544b17f6ed8a13d8d3a8db53 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Wed, 30 Oct 2024 20:58:08 +0100 Subject: [PATCH] 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)