diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-07-09 16:33:33 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-11-04 14:04:35 +0000 |
commit | 932ad390802319af1996f678d9226c2a17a913d0 (patch) | |
tree | d7c65289ebb47e8b4c1444b92905add7280d3a04 | |
parent | b63160b079a124ce45fb5741c65e9a4393aaa560 (diff) |
Remove support for disabling C++11 support in configure
Qt now requires it.
We could try and run the common/c++11 test for MSVC too, but we know it
passes, so we won't bother and thus slow down the configure step.
Change-Id: Ib056b47dde3341ef9a52ffff13ef6b53b9f8bb65
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
-rwxr-xr-x | configure | 61 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 25 |
2 files changed, 22 insertions, 64 deletions
@@ -2253,28 +2253,19 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; - c++11) - if [ "$VAL" = "yes" ]; then - CFG_STDCXX="c++11" - elif [ "$VAL" = "no" ]; then - CFG_STDCXX="c++98" - else - UNKNOWN_OPT=yes - fi - ;; c++std) case "$VAL" in - c++98|c++11|c++14|c++1z|auto) + c++11|c++14|c++1z|auto) CFG_STDCXX="$VAL" ;; - 98|11|14|1z) + 11|14|1z) CFG_STDCXX="c++$VAL" ;; 1y|c++1y) CFG_STDCXX="c++14" ;; *) - echo >&2 "Invalid C++ edition: $VAL; valid options are: c++98 c++11 c++14 c++1z auto" + echo >&2 "Invalid C++ edition: $VAL; valid options are: c++11 c++14 c++1z auto" ERROR=yes ;; esac @@ -2450,7 +2441,7 @@ Configure options: -confirm-license ... Automatically acknowledge the license (use with either -opensource or -commercial) - -c++std <edition> .. Compile Qt with C++ standard edition (c++98, c++11, c++14, c++1z) + -c++std <edition> .. Compile Qt with C++ standard edition (c++11, c++14, c++1z) Default: highest supported * -shared ............ Create and use shared Qt libraries. @@ -4411,20 +4402,11 @@ if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then fi # Detect C++11 & up support -# Configure detects compiler features based on cross compiler, so we need -# to explicitly disable C++11 on Mac to avoid breaking builds where the -# host compiler does not support it. stdcxx_error=false -if [ "$BUILD_ON_MAC" = "yes" ] && [ "$XPLATFORM_ANDROID" = "yes" ]; then - CFG_STDCXX="c++98" -elif [ "$CFG_STDCXX" = "c++98" ]; then - : # CFG_STDCXX is correct -elif ! compileTest common/c++11 "C++11"; then - if [ "$CFG_STDCXX" != "auto" ]; then - stdcxx_error=true - else - CFG_STDCXX="c++98" - fi +if ! compileTest common/c++11 "C++11"; then + echo "ERROR: Qt requires a C++11 compiler and yours does not seem to be that." + echo "Please upgrade." + exit 1 elif [ "$CFG_STDCXX" = "c++11" ]; then : # CFG_STDCXX is correct elif ! compileTest common/c++14 "C++14"; then @@ -6267,13 +6249,12 @@ fi # ask for all that hasn't been auto-detected or specified in the arguments #------------------------------------------------------------------------------- -if [ "$CFG_STDCXX" != "c++98" ]; then - QT_CONFIG="$QT_CONFIG c++11" - if [ "$CFG_STDCXX" != "c++11" ]; then - QT_CONFIG="$QT_CONFIG c++14" - if [ "$CFG_STDCXX" != "c++14" ]; then - QT_CONFIG="$QT_CONFIG c++1z" - fi +# Set "c++11" unconditionally, as lots of code does contains(QT_CONFIG, c++11) +QT_CONFIG="$QT_CONFIG c++11" +if [ "$CFG_STDCXX" != "c++11" ]; then + QT_CONFIG="$QT_CONFIG c++14" + if [ "$CFG_STDCXX" != "c++14" ]; then + QT_CONFIG="$QT_CONFIG c++1z" fi fi @@ -7611,20 +7592,6 @@ EOF fi #------------------------------------------------------------------------------- -# check if the user passed the deprecated -no-c++11 / --c++-level=c++98 option -#------------------------------------------------------------------------------- -if [ "$CFG_STDCXX" = "c++98" ]; then -cat <<EOF - - NOTICE: The -no-c++11 / --c++-level=c++98 option is deprecated. - - Qt 5.7 will require C++11 support. The options are in effect for this - Qt 5.6 build, but you should update your build scripts to remove the - option and, if necessary, upgrade your compiler. -EOF -fi - -#------------------------------------------------------------------------------- # finally save the executed command to another script #------------------------------------------------------------------------------- if [ `basename $0` != "config.status" ]; then diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 08afc51bc4..bdfaeda052 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -468,25 +468,21 @@ void Configure::parseCmdLine() dictionary[ "COMPILE_EXAMPLES" ] = "no"; } - else if (configCmdLine.at(i) == "-c++11") - dictionary[ "C++STD" ] = "c++11"; - else if (configCmdLine.at(i) == "-no-c++11") - dictionary[ "C++STD" ] = "c++98"; else if (configCmdLine.at(i) == "-c++std") { ++i; if (i == argCount) break; QString level = configCmdLine.at(i); - if (level == "c++98" || level == "c++11" || level == "c++14" || level == "c++1z" + if (level == "c++11" || level == "c++14" || level == "c++1z" || level == "auto") { dictionary[ "C++STD" ] = level; - } else if (level == "98" || level == "11" || level == "14" || level == "1z") { + } else if (level == "11" || level == "14" || level == "1z") { dictionary[ "C++STD" ] = "c++" + level; } else { dictionary[ "DONE" ] = "error"; cout << "ERROR: invalid C++ standard " << level - << "; valid options are: c++98 c++11 c++14 c++1z auto" << endl; + << "; valid options are: c++11 c++14 c++1z auto" << endl; return; } } @@ -1824,7 +1820,7 @@ bool Configure::displayHelp() desc("OPENSOURCE", "opensource", "-opensource", "Compile and link the Open-Source Edition of Qt."); desc("COMMERCIAL", "commercial", "-commercial", "Compile and link the Commercial Edition of Qt.\n"); - desc( "-c++std <edition>", "Compile Qt with C++ standard edition (c++98, c++11, c++14, c++1z)\n" + desc( "-c++std <edition>", "Compile Qt with C++ standard edition (c++11, c++14, c++1z)\n" "Default: highest supported. This option is not supported for MSVC.\n"); desc("USE_GOLD_LINKER", "yes", "-use-gold-linker", "Link using the GNU gold linker (gcc only)."); @@ -2401,7 +2397,10 @@ void Configure::autoDetection() if (dictionary["C++STD"] == "auto" && !dictionary["QMAKESPEC"].contains("msvc")) { if (!tryCompileProject("common/c++11")) { - dictionary["C++STD"] = "c++98"; + dictionary["DONE"] = "error"; + cout << "ERROR: Qt requires a C++11 compiler and yours does not seem to be that." << endl + << "Please upgrade." << endl; + return; } else if (!tryCompileProject("common/c++14")) { dictionary["C++STD"] = "c++11"; } else if (!tryCompileProject("common/c++1z")) { @@ -4059,14 +4058,6 @@ void Configure::displayConfig() << "will be the same unless you are cross-compiling)." << endl << endl; } - if (dictionary["C++STD"] == "c++98") { - sout << endl - << "NOTE: The -no-c++11 / -c++-level c++98 option is deprecated." << endl - << endl - << "Qt 5.7 will require C++11 support. The options are in effect for this" << endl - << "Qt 5.6 build, but you should update your build scripts to remove the" << endl - << "option and, if necessary, upgrade your compiler." << endl; - } if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) { sout << endl << dictionary["PREFIX_COMPLAINTS"] << endl |