Skip to content

Add CMAKE_<LANG>_STANDARD_LATEST variables

Add a variable to indicate the latest standard known to be supported for each language:

  • CMAKE_C_STANDARD_LATEST
  • CMAKE_CXX_STANDARD_LATEST
  • CMAKE_CUDA_STANDARD_LATEST
  • CMAKE_HIP_STANDARD_LATEST
  • CMAKE_OBJC_STANDARD_LATEST
  • CMAKE_OBJCXX_STANDARD_LATEST

When CMake is run with a supported compiler (that is, one which CMake recognizes language support for), these variables will contain an integer value representing the latest language standard supported by the current compiler (e.g., 23 for C++23).

The current implementation will not allow this value to be larger than the latest standard supported by CMake.

Closes: #25717
Supersedes: !9288 (closed)
Topic-rename: lang-standard-latest

Edited by Tyler Nichols

Merge request reports