summaryrefslogtreecommitdiffstats
path: root/qmake/library
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-04-23 15:42:15 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2021-04-26 10:59:32 +0200
commit63a812b85191c9cfe0704d400df86ce7961dea12 (patch)
tree05724a51f66ac76bc1f90c57002a46411d6fb73b /qmake/library
parent6235893d54b8fbf5c8bd54e33cd82b55042555f1 (diff)
Fix "qmake -spec foo" call for cross builds
In a cross built Qt, for example Qt for Android, calling "qmake -spec android-clang" led to an error message: "Could not find qmake spec '-qtconf'." This happened, because: - the qmake in Qt for Android is a wrapper script that calls "qmake -qtconf qt_target.conf -spec android-clang" - the first stage of command line argument handling in qmake garbled the call to "qmake -spec -qtconf qt_target.conf android-clang" We do not modify the order of arguments anymore. Instead, we skip the "-qtconf <file>" arguments in the first argument handling stage that is supposed to determine qmake's modus operandi (like -project or -query). In addition, we need to fix the assignment of QLibraryInfoPrivate::qtconfManualPath which was only done if QMakeGlobals::addCommandLineArguments returned ArgumentsOk. However, this function returns ArgumentUnknown, if it encounters an argument it cannot handle - like the project name. Now, we assign QLibraryInfoPrivate::qtconfManualPath if there was no error detected. Document the return values of addCommandLineArguments. This amends commit 661b586a69740bd9a1791622f8b238d290ebe00d. Pick-to: 6.1 6.0 Fixes: QTBUG-93079 Task-number: QTBUG-85136 Change-Id: I12ec25b17d64c00be2a3904b7c4a975b781500a0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'qmake/library')
-rw-r--r--qmake/library/qmakeglobals.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp
index 247084f6c6..b4dab9ce8f 100644
--- a/qmake/library/qmakeglobals.cpp
+++ b/qmake/library/qmakeglobals.cpp
@@ -103,6 +103,13 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s
return ret;
}
+/*
+ * Return value meanings:
+ * ArgumentUnknown The argument at *pos was not handled by this function.
+ * Leave it to the caller to handle this argument.
+ * ArgumentMalformed There was an error detected.
+ * ArgumentsOk All arguments were known. There are no arguments left to handle.
+ */
QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
QMakeCmdLineParserState &state, QStringList &args, int *pos)
{