From 8f7a0766195c2147dbf6bf2707e7e708a849d333 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Wed, 12 Apr 2023 10:14:58 +0800 Subject: [PATCH] cmake: C++23 only when not using clang --- tools/cmake/build.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index ac350594e9..687c5c9212 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -129,7 +129,12 @@ function(__build_set_lang_version) # Use latest supported versions. # Please update docs/en/api-guides/cplusplus.rst when changing this. set(c_std gnu17) - set(cxx_std gnu++23) + if(NOT ${env_idf_toolchain} STREQUAL "clang") + set(cxx_std gnu++23) + else() + # TODO: IDF-7241 - remove the exception for clang + set(cxx_std gnu++20) + endif() else() enable_language(C CXX) # Building for Linux target, fall back to an older version of the standard