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>
This commit is contained in:
parent
b63160b079
commit
932ad39080
61
configure
vendored
61
configure
vendored
@ -2253,28 +2253,19 @@ while [ "$#" -gt 0 ]; do
|
|||||||
UNKNOWN_OPT=yes
|
UNKNOWN_OPT=yes
|
||||||
fi
|
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)
|
c++std)
|
||||||
case "$VAL" in
|
case "$VAL" in
|
||||||
c++98|c++11|c++14|c++1z|auto)
|
c++11|c++14|c++1z|auto)
|
||||||
CFG_STDCXX="$VAL"
|
CFG_STDCXX="$VAL"
|
||||||
;;
|
;;
|
||||||
98|11|14|1z)
|
11|14|1z)
|
||||||
CFG_STDCXX="c++$VAL"
|
CFG_STDCXX="c++$VAL"
|
||||||
;;
|
;;
|
||||||
1y|c++1y)
|
1y|c++1y)
|
||||||
CFG_STDCXX="c++14"
|
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
|
ERROR=yes
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -2450,7 +2441,7 @@ Configure options:
|
|||||||
-confirm-license ... Automatically acknowledge the license (use with
|
-confirm-license ... Automatically acknowledge the license (use with
|
||||||
either -opensource or -commercial)
|
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
|
Default: highest supported
|
||||||
|
|
||||||
* -shared ............ Create and use shared Qt libraries.
|
* -shared ............ Create and use shared Qt libraries.
|
||||||
@ -4411,20 +4402,11 @@ if [ "$CFG_SEPARATE_DEBUG_INFO" = "yes" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Detect C++11 & up support
|
# 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
|
stdcxx_error=false
|
||||||
if [ "$BUILD_ON_MAC" = "yes" ] && [ "$XPLATFORM_ANDROID" = "yes" ]; then
|
if ! compileTest common/c++11 "C++11"; then
|
||||||
CFG_STDCXX="c++98"
|
echo "ERROR: Qt requires a C++11 compiler and yours does not seem to be that."
|
||||||
elif [ "$CFG_STDCXX" = "c++98" ]; then
|
echo "Please upgrade."
|
||||||
: # CFG_STDCXX is correct
|
exit 1
|
||||||
elif ! compileTest common/c++11 "C++11"; then
|
|
||||||
if [ "$CFG_STDCXX" != "auto" ]; then
|
|
||||||
stdcxx_error=true
|
|
||||||
else
|
|
||||||
CFG_STDCXX="c++98"
|
|
||||||
fi
|
|
||||||
elif [ "$CFG_STDCXX" = "c++11" ]; then
|
elif [ "$CFG_STDCXX" = "c++11" ]; then
|
||||||
: # CFG_STDCXX is correct
|
: # CFG_STDCXX is correct
|
||||||
elif ! compileTest common/c++14 "C++14"; then
|
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
|
# ask for all that hasn't been auto-detected or specified in the arguments
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
if [ "$CFG_STDCXX" != "c++98" ]; then
|
# Set "c++11" unconditionally, as lots of code does contains(QT_CONFIG, c++11)
|
||||||
QT_CONFIG="$QT_CONFIG c++11"
|
QT_CONFIG="$QT_CONFIG c++11"
|
||||||
if [ "$CFG_STDCXX" != "c++11" ]; then
|
if [ "$CFG_STDCXX" != "c++11" ]; then
|
||||||
QT_CONFIG="$QT_CONFIG c++14"
|
QT_CONFIG="$QT_CONFIG c++14"
|
||||||
if [ "$CFG_STDCXX" != "c++14" ]; then
|
if [ "$CFG_STDCXX" != "c++14" ]; then
|
||||||
QT_CONFIG="$QT_CONFIG c++1z"
|
QT_CONFIG="$QT_CONFIG c++1z"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -7610,20 +7591,6 @@ cat <<EOF
|
|||||||
EOF
|
EOF
|
||||||
fi
|
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
|
# finally save the executed command to another script
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
@ -468,25 +468,21 @@ void Configure::parseCmdLine()
|
|||||||
dictionary[ "COMPILE_EXAMPLES" ] = "no";
|
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") {
|
else if (configCmdLine.at(i) == "-c++std") {
|
||||||
++i;
|
++i;
|
||||||
if (i == argCount)
|
if (i == argCount)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
QString level = configCmdLine.at(i);
|
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") {
|
|| level == "auto") {
|
||||||
dictionary[ "C++STD" ] = level;
|
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;
|
dictionary[ "C++STD" ] = "c++" + level;
|
||||||
} else {
|
} else {
|
||||||
dictionary[ "DONE" ] = "error";
|
dictionary[ "DONE" ] = "error";
|
||||||
cout << "ERROR: invalid C++ standard " << level
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1824,7 +1820,7 @@ bool Configure::displayHelp()
|
|||||||
desc("OPENSOURCE", "opensource", "-opensource", "Compile and link the Open-Source Edition of Qt.");
|
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("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");
|
"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).");
|
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 (dictionary["C++STD"] == "auto" && !dictionary["QMAKESPEC"].contains("msvc")) {
|
||||||
if (!tryCompileProject("common/c++11")) {
|
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")) {
|
} else if (!tryCompileProject("common/c++14")) {
|
||||||
dictionary["C++STD"] = "c++11";
|
dictionary["C++STD"] = "c++11";
|
||||||
} else if (!tryCompileProject("common/c++1z")) {
|
} else if (!tryCompileProject("common/c++1z")) {
|
||||||
@ -4059,14 +4058,6 @@ void Configure::displayConfig()
|
|||||||
<< "will be the same unless you are cross-compiling)." << endl
|
<< "will be the same unless you are cross-compiling)." << endl
|
||||||
<< 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()) {
|
if (!dictionary["PREFIX_COMPLAINTS"].isEmpty()) {
|
||||||
sout << endl
|
sout << endl
|
||||||
<< dictionary["PREFIX_COMPLAINTS"] << endl
|
<< dictionary["PREFIX_COMPLAINTS"] << endl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user