add -skip option to the configures

this makes it possible to exclude modules from the build without moving
their sources out of the way. substitutes the much-requested -no-webkit.

not adding a symmetrical option, as it is relatively pointless:
to build only specific "leaf" modules, you only need to run
"make module-qt<module> ..." once you configured. and removing
particular "intermediate" modules is achieved with this very option.

Task-number: QTBUG-26697
Change-Id: I25cebdbd029885a2c653c4cde696f9bb78691768
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-02-18 17:37:21 +01:00 committed by The Qt Project
parent 23762682c1
commit 3fdfde294f
5 changed files with 41 additions and 2 deletions

16
configure vendored
View File

@ -777,6 +777,7 @@ CFG_SQL_AVAILABLE=
QT_DEFAULT_BUILD_PARTS="libs tools examples"
CFG_BUILD_PARTS=""
CFG_NOBUILD_PARTS=""
CFG_SKIP_MODULES=""
CFG_RELEASE_QMAKE=no
CFG_AUDIO_BACKEND=auto
CFG_V8SNAPSHOT=auto
@ -995,7 +996,7 @@ while [ "$#" -gt 0 ]; do
VAL=no
;;
#Qt style options that pass an argument
-prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig)
-prefix|-docdir|-headerdir|-plugindir|-importdir|-qmldir|-archdatadir|-datadir|-libdir|-bindir|-libexecdir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-skip|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir|-qpa|-qconfig)
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
shift
VAL="$1"
@ -1288,6 +1289,14 @@ while [ "$#" -gt 0 ]; do
make)
CFG_BUILD_PARTS="$CFG_BUILD_PARTS $VAL"
;;
skip)
VAL=qt${VAL#qt}
if ! [ -d $relpath/../$VAL ]; then
echo "Attempting to skip non-existent module $VAL." >&2
exit 1
fi
CFG_SKIP_MODULES="$CFG_SKIP_MODULES $VAL"
;;
sdk)
if [ "$BUILD_ON_MAC" = "yes" ]; then
CFG_SDK="$VAL"
@ -3193,6 +3202,8 @@ Additional options:
($QT_DEFAULT_BUILD_PARTS)
-nomake <part> ..... Exclude part from the list of parts to be built.
-skip <module> ..... Exclude an entire module from the build.
-no-gui ............ Don't build the Qt GUI module and dependencies.
+ -gui ............... Build the Qt GUI module and dependencies.
@ -6084,6 +6095,9 @@ QTMODULE="$outpath/mkspecs/qmodule.pri"
echo "CONFIG += $QMAKE_CONFIG" >> "$QTMODULE.tmp"
echo "QT_BUILD_PARTS += $CFG_BUILD_PARTS" >> "$QTMODULE.tmp"
if [ -n "$CFG_SKIP_MODULES" ]; then
echo "QT_SKIP_MODULES += $CFG_SKIP_MODULES" >> "$QTMODULE.tmp"
fi
if [ -n "$QT_CFLAGS_PSQL" ]; then
echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$QTMODULE.tmp"

3
dist/changes-5.0.2 vendored
View File

@ -22,6 +22,9 @@ information about a particular change.
General Improvements
--------------------
- [QTBUG-26697] The -skip option was added to configure, which enables not
building particular modules. Typical use case: -skip webkit.
Third party components
----------------------

View File

@ -1011,6 +1011,20 @@ void Configure::parseCmdLine()
nobuildParts.append(configCmdLine.at(i));
}
else if (configCmdLine.at(i) == "-skip") {
++i;
if (i == argCount)
break;
QString mod = configCmdLine.at(i);
if (!mod.startsWith(QStringLiteral("qt")))
mod.insert(0, QStringLiteral("qt"));
if (!QFileInfo(sourcePath + "/../" + mod).isDir()) {
cout << "Attempting to skip non-existent module " << mod << "." << endl;
dictionary["DONE"] = "error";
}
skipModules += mod;
}
// Directories ----------------------------------------------
else if (configCmdLine.at(i) == "-prefix") {
++i;
@ -1647,6 +1661,8 @@ bool Configure::displayHelp()
desc( "", qPrintable(QString(" %1").arg(defaultBuildParts.at(i))), false, ' ');
desc( "-nomake <part>", "Exclude part from the list of parts to be built.\n");
desc( "-skip <module>", "Exclude an entire module from the build.\n");
desc("WIDGETS", "no", "-no-widgets", "Disable Qt Widgets module.\n");
desc("ACCESSIBILITY", "no", "-no-accessibility", "Disable accessibility support.\n");
@ -2778,7 +2794,10 @@ void Configure::generateCachefile()
if (moduleFile.open(QFile::WriteOnly | QFile::Text)) { // Truncates any existing file.
QTextStream moduleStream(&moduleFile);
moduleStream << "QT_BUILD_PARTS += " << buildParts.join(' ') << endl << endl;
moduleStream << "QT_BUILD_PARTS += " << buildParts.join(' ') << endl;
if (!skipModules.isEmpty())
moduleStream << "QT_SKIP_MODULES += " << skipModules.join(' ') << endl;
moduleStream << endl;
if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE")
moduleStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl;

View File

@ -116,6 +116,7 @@ private:
QStringList defaultBuildParts;
QStringList buildParts;
QStringList nobuildParts;
QStringList skipModules;
QStringList licensedModules;
QStringList allSqlDrivers;
QStringList allConfigs;

View File

@ -58,6 +58,8 @@ int runConfigure( int argc, char** argv )
#if !defined(EVAL)
app.validateArgs();
#endif
if (!app.isOk())
return 3;
if( app.displayHelp() )
return 1;