Skip to content

Commit

Permalink
Add a deprecation warning when building with C++17
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Oct 30, 2024
1 parent 87e0fee commit 5174e02
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 5174e02

Please sign in to comment.