Skip to content

Commit

Permalink
Add a deprecation warning when building with C++17 (AIDASoft#700)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
jmcarcell and jmcarcell committed Nov 18, 2024
1 parent f7f93d8 commit 67b6950
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 "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)

Expand Down

0 comments on commit 67b6950

Please sign in to comment.