diff options
-rw-r--r-- | .prev_configure.cmake | 21 | ||||
-rw-r--r-- | cmake/QtFlagHandlingHelpers.cmake | 2 | ||||
-rw-r--r-- | cmake/configure-cmake-mapping.md | 2 | ||||
-rw-r--r-- | config_help.txt | 2 | ||||
-rw-r--r-- | configure.cmake | 21 | ||||
-rw-r--r-- | configure.json | 21 | ||||
-rw-r--r-- | qmake/doc/src/qmake-manual.qdoc | 9 | ||||
-rw-r--r-- | qt_cmdline.cmake | 18 | ||||
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 2 |
9 files changed, 57 insertions, 41 deletions
diff --git a/.prev_configure.cmake b/.prev_configure.cmake index 75081a87c9..8f8c71926f 100644 --- a/.prev_configure.cmake +++ b/.prev_configure.cmake @@ -67,12 +67,12 @@ std::visit([](const auto &) { return 1; }, v); CXX_STANDARD 17 ) -# cxx2a -qt_config_compile_test(cxx2a - LABEL "C++2a support" +# cxx20 +qt_config_compile_test(cxx20 + LABEL "C++20 support" CODE "#if __cplusplus > 201703L -// Compiler claims to support experimental C++2a, trust it +// Compiler claims to support C++20, trust it #else # error __cplusplus must be > 201703L (the value for C++17) #endif @@ -594,10 +594,15 @@ qt_feature("c++1z" PUBLIC CONDITION QT_FEATURE_cxx17 ) qt_feature_config("c++1z" QMAKE_PUBLIC_QT_CONFIG) -qt_feature("c++2a" PUBLIC - LABEL "C++2a" +qt_feature("c++20" PUBLIC + LABEL "C++20" AUTODETECT OFF - CONDITION QT_FEATURE_cxx17 AND TEST_cxx2a + CONDITION QT_FEATURE_cxx17 AND TEST_cxx20 +) +qt_feature_config("c++20" QMAKE_PUBLIC_QT_CONFIG) +qt_feature("c++2a" PUBLIC + LABEL "C++20" + CONDITION QT_FEATURE_cxx20 ) qt_feature_config("c++2a" QMAKE_PUBLIC_QT_CONFIG) qt_feature("c89" @@ -954,7 +959,7 @@ qt_configure_add_summary_entry( ) qt_configure_add_summary_entry( TYPE "firstAvailableFeature" - ARGS "c++2a c++17 c++14 c++11" + ARGS "c++20 c++17 c++14 c++11" MESSAGE "Using C++ standard" ) qt_configure_add_summary_entry( diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index 69558c32db..9af05d5907 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -216,7 +216,7 @@ endfunction() function(qt_set_language_standards) ## Use the latest standard the compiler supports (same as qt_common.prf) - if (QT_FEATURE_cxx2a) + if (QT_FEATURE_cxx20) set(CMAKE_CXX_STANDARD 20 PARENT_SCOPE) else() set(CMAKE_CXX_STANDARD 17 PARENT_SCOPE) diff --git a/cmake/configure-cmake-mapping.md b/cmake/configure-cmake-mapping.md index 99bce46a3d..f9a71b59d5 100644 --- a/cmake/configure-cmake-mapping.md +++ b/cmake/configure-cmake-mapping.md @@ -56,7 +56,7 @@ The effort of this is tracked in QTBUG-85373 and QTBUG-85349. | | or -DFEATURE_<backend> | | | -sanitize address -sanitize undefined | -DECM_ENABLE_SANITIZERS=address;undefined | | | -coverage <arg> | | | -| -c++std c++2a | -DFEATURE_cxx2a=ON | | +| -c++std c++20 | -DFEATURE_cxx20=ON | | | -sse2/-sse3/-ssse3/-sse4.1 | -DFEATURE_sse4=ON | | | -mips_dsp/-mips_dspr2 | -DFEATURE_mips_dsp=ON | | | -qreal <type> | -DQT_COORD_TYPE=<type> | | diff --git a/config_help.txt b/config_help.txt index c912fa00b0..b2de3dd33c 100644 --- a/config_help.txt +++ b/config_help.txt @@ -111,7 +111,7 @@ Build options: sanitizers or generate instrumented code to collect execution counts and enable code coverage analysis, respectively. (Clang only) - -c++std <edition> .... Select C++ standard <edition> [c++2a/c++17/c++14/c++11] + -c++std <edition> .... Select C++ standard <edition> [c++20/c++17/c++14/c++11] -sse2 ................ Use SSE2 instructions [auto] -sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512 diff --git a/configure.cmake b/configure.cmake index d0767902c8..6bfe12d670 100644 --- a/configure.cmake +++ b/configure.cmake @@ -67,12 +67,12 @@ std::visit([](const auto &) { return 1; }, v); CXX_STANDARD 17 ) -# cxx2a -qt_config_compile_test(cxx2a - LABEL "C++2a support" +# cxx20 +qt_config_compile_test(cxx20 + LABEL "C++20 support" CODE "#if __cplusplus > 201703L -// Compiler claims to support experimental C++2a, trust it +// Compiler claims to support C++20, trust it #else # error __cplusplus must be > 201703L (the value for C++17) #endif @@ -607,10 +607,15 @@ qt_feature("c++1z" PUBLIC CONDITION QT_FEATURE_cxx17 ) qt_feature_config("c++1z" QMAKE_PUBLIC_QT_CONFIG) -qt_feature("c++2a" PUBLIC - LABEL "C++2a" +qt_feature("c++20" PUBLIC + LABEL "C++20" AUTODETECT OFF - CONDITION QT_FEATURE_cxx17 AND TEST_cxx2a + CONDITION QT_FEATURE_cxx17 AND TEST_cxx20 +) +qt_feature_config("c++20" QMAKE_PUBLIC_QT_CONFIG) +qt_feature("c++2a" PUBLIC + LABEL "C++20" + CONDITION QT_FEATURE_cxx20 ) qt_feature_config("c++2a" QMAKE_PUBLIC_QT_CONFIG) qt_feature("c89" @@ -970,7 +975,7 @@ qt_configure_add_summary_entry( ) qt_configure_add_summary_entry( TYPE "firstAvailableFeature" - ARGS "c++2a c++17 c++14 c++11" + ARGS "c++20 c++17 c++14 c++11" MESSAGE "Using C++ standard" ) qt_configure_add_summary_entry( diff --git a/configure.json b/configure.json index a9249e1ed2..56d9841119 100644 --- a/configure.json +++ b/configure.json @@ -363,18 +363,18 @@ "qmake": "CONFIG += c++11 c++14 c++17" } }, - "cxx2a": { - "label": "C++2a support", + "cxx20": { + "label": "C++20 support", "type": "compile", "test": { "head": [ "#if __cplusplus > 201703L", - "// Compiler claims to support experimental C++2a, trust it", + "// Compiler claims to support C++20, trust it", "#else", "# error __cplusplus must be > 201703L (the value for C++17)", "#endif" ], - "qmake": "CONFIG += c++11 c++14 c++17 c++2a" + "qmake": "CONFIG += c++11 c++14 c++17 c++20" } }, "precompile_header": { @@ -983,10 +983,15 @@ "condition": "features.c++17", "output": [ "publicFeature", "publicQtConfig" ] }, - "c++2a": { - "label": "C++2a", + "c++20": { + "label": "C++20", "autoDetect": false, - "condition": "features.c++17 && tests.cxx2a", + "condition": "features.c++17 && tests.cxx20", + "output": [ "publicFeature", "publicQtConfig" ] + }, + "c++2a": { + "label": "C++20", + "condition": "features.c++20", "output": [ "publicFeature", "publicQtConfig" ] }, "c89": { @@ -1520,7 +1525,7 @@ { "message": "Using C++ standard", "type": "firstAvailableFeature", - "args": "c++2a c++17 c++14 c++11" + "args": "c++20 c++17 c++14 c++11" }, { "type": "feature", diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index c14615fdc5..9e25c2726e 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -1210,13 +1210,14 @@ \row \li c++14 \li C++14 support is enabled. This option has no effect if the compiler does not support C++14, or can't select the C++ standard. By default, the compiler default is used. - \row \li c++1z \li C++17 support is enabled. This option has no effect if + \row \li c++17 \li C++17 support is enabled. This option has no effect if the compiler does not support C++17, or can't select the C++ standard. By default, support is disabled. - \row \li c++17 \li Same as c++1z. - \row \li c++2a \li C++2a support is enabled. This option has no effect if - the compiler does not support C++2a, or can't select the C++ standard. + \row \li c++1z \li Obsolete alias for c++17. + \row \li c++20 \li C++20 support is enabled. This option has no effect if + the compiler does not support C++20, or can't select the C++ standard. By default, support is disabled. + \row \li c++2a \li Obsolete alias for c++20. \row \li c++latest \li Support for the latest C++ language standard is enabled that is supported by the compiler. By default, this option is disabled. diff --git a/qt_cmdline.cmake b/qt_cmdline.cmake index 0145cd4a14..10cc67d7ec 100644 --- a/qt_cmdline.cmake +++ b/qt_cmdline.cmake @@ -152,20 +152,20 @@ function(qt_commandline_cxxstd arg val nextok) endif() if(val MATCHES "(c\\+\\+)?11") qtConfCommandlineSetInput(c++14 no) - qtConfCommandlineSetInput(c++1z no) - qtConfCommandlineSetInput(c++2a no) + qtConfCommandlineSetInput(c++17 no) + qtConfCommandlineSetInput(c++20 no) elseif(val MATCHES "(c\\+\\+)?(14|1y)") qtConfCommandlineSetInput(c++14 yes) - qtConfCommandlineSetInput(c++1z no) - qtConfCommandlineSetInput(c++2a no) + qtConfCommandlineSetInput(c++17 no) + qtConfCommandlineSetInput(c++20 no) elseif(val MATCHES "(c\\+\\+)?(17|1z)") qtConfCommandlineSetInput(c++14 yes) - qtConfCommandlineSetInput(c++1z yes) - qtConfCommandlineSetInput(c++2a no) - elseif(val MATCHES "(c\\+\\+)?2a") + qtConfCommandlineSetInput(c++17 yes) + qtConfCommandlineSetInput(c++20 no) + elseif(val MATCHES "(c\\+\\+)?(20|2a)") qtConfCommandlineSetInput(c++14 yes) - qtConfCommandlineSetInput(c++1z yes) - qtConfCommandlineSetInput(c++2a yes) + qtConfCommandlineSetInput(c++17 yes) + qtConfCommandlineSetInput(c++20 yes) else() qtConfAddError("Invalid argument '${val}' to command line parameter '${arg}'") endif() diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 1f7d838dc8..160557e18d 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -709,7 +709,7 @@ def write_compile_test( languageStandard = "CXX_STANDARD 14" elif details["qmake"] == "CONFIG += c++11 c++14 c++17": languageStandard = "CXX_STANDARD 17" - elif details["qmake"] == "CONFIG += c++11 c++14 c++17 c++2a": + elif details["qmake"] == "CONFIG += c++11 c++14 c++17 c++20": languageStandard = "CXX_STANDARD 20" elif details["qmake"] == "QMAKE_CXXFLAGS += -fstack-protector-strong": compileOptions = details["qmake"][18:] |