From d5197439268fcfb4e73e7e81e2e778a1d8c5db69 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 10 Jun 2024 18:53:37 +0200 Subject: [PATCH] configure: accept -c++std c++17 again When 2cf66d49ef926ee53b6c394d8be0b8e8bcf148e8 removed support for c++14, it incorrectly also removed support for explicitly setting the default, C++17. This broke build scripts for no good reason, and made it impossible to undo an earlier -c++std c++20 again. Accept C++17 and C++1z again, as an explicit disabler for C++20 and C++23 features. Amends 2cf66d49ef926ee53b6c394d8be0b8e8bcf148e8. Fixes: QTBUG-125015 Change-Id: I99b80cd5f41fa5a23259630eae85ef807982f526 Reviewed-by: Joerg Bornemann (cherry picked from commit 68e6406623afe5aaaa79e116cbd6b07e8f295e8b) Reviewed-by: Qt Cherry-pick Bot --- qt_cmdline.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt_cmdline.cmake b/qt_cmdline.cmake index 0347f86eefa..a30031135db 100644 --- a/qt_cmdline.cmake +++ b/qt_cmdline.cmake @@ -141,7 +141,10 @@ function(qt_commandline_cxxstd arg val nextok) qtConfAddError("Missing argument to command line parameter '${arg}'.") return() endif() - if(val MATCHES "(c\\+\\+)?(20|2a)") + if(val MATCHES "(c\\+\\+)?(17|1z)") + qtConfCommandlineDisableFeature(c++20) + qtConfCommandlineDisableFeature(c++2b) + elseif(val MATCHES "(c\\+\\+)?(20|2a)") qtConfCommandlineEnableFeature(c++20) qtConfCommandlineDisableFeature(c++2b) elseif(val MATCHES "(c\\+\\+)?(2b)")