From 1bbc6eaefec1e4d63ab9d58bb621397112c3db99 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 14 May 2025 18:03:21 -0700 Subject: [PATCH] Enable some additional C++20 and C++23 compat warnings with clang --- build/CompilerAndLinker.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/CompilerAndLinker.cmake b/build/CompilerAndLinker.cmake index a61b58a2..50f16221 100644 --- a/build/CompilerAndLinker.cmake +++ b/build/CompilerAndLinker.cmake @@ -119,6 +119,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM") if(WINDOWS_STORE) list(APPEND COMPILER_DEFINES _SILENCE_CLANG_COROUTINE_MESSAGE) endif() + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) + list(APPEND COMPILER_SWITCHES -Wc++20-compat) + endif() + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0) + list(APPEND COMPILER_SWITCHES -Wc++23-compat) + endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") list(APPEND COMPILER_SWITCHES /Zc:__cplusplus /Zc:inline /fp:fast /Qdiag-disable:161) elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")