forked from qt-creator/qt-creator
QMakeStep: Add extra parser arguments
It is useful when developing toolchain plugin to have separate agruments for pro-file parser only. Certain arguments may be added to qmake implicitly, without Qt Creator control, and we would like to tell them to the parser in order to get proper code assistance. This function is used in 3rd party plugin Sailfish OS. Change-Id: Ie1ce19d5773bb2c0c87b1d58cf00dca57f1108d5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -383,6 +383,16 @@ void QMakeStep::setExtraArguments(const QStringList &args)
|
||||
}
|
||||
}
|
||||
|
||||
QStringList QMakeStep::extraParserArguments() const
|
||||
{
|
||||
return m_extraParserArgs;
|
||||
}
|
||||
|
||||
void QMakeStep::setExtraParserArguments(const QStringList &args)
|
||||
{
|
||||
m_extraParserArgs = args;
|
||||
}
|
||||
|
||||
bool QMakeStep::linkQmlDebuggingLibrary() const
|
||||
{
|
||||
return m_linkQmlDebuggingLibrary;
|
||||
@@ -476,7 +486,8 @@ QString QMakeStep::effectiveQMakeCall() const
|
||||
|
||||
QStringList QMakeStep::parserArguments()
|
||||
{
|
||||
QStringList result;
|
||||
// NOTE: extra parser args placed before the other args intentionally
|
||||
QStringList result = m_extraParserArgs;
|
||||
BaseQtVersion *qt = QtKitAspect::qtVersion(target()->kit());
|
||||
QTC_ASSERT(qt, return QStringList());
|
||||
for (QtcProcess::ConstArgIterator ait(allArguments(qt, ArgumentFlag::Expand)); ait.next(); ) {
|
||||
|
@@ -133,9 +133,13 @@ public:
|
||||
// arguments set by the user
|
||||
QString userArguments();
|
||||
void setUserArguments(const QString &arguments);
|
||||
// QMake extra arguments. Not user editable.
|
||||
// Extra arguments for qmake and pro file parser. Not user editable via UI.
|
||||
QStringList extraArguments() const;
|
||||
void setExtraArguments(const QStringList &args);
|
||||
/* Extra arguments for pro file parser only. Not user editable via UI.
|
||||
* This function is used in 3rd party plugin SailfishOS. */
|
||||
QStringList extraParserArguments() const;
|
||||
void setExtraParserArguments(const QStringList &args);
|
||||
QString mkspec() const;
|
||||
bool linkQmlDebuggingLibrary() const;
|
||||
void setLinkQmlDebuggingLibrary(bool enable);
|
||||
@@ -174,8 +178,10 @@ private:
|
||||
Utils::FilePath m_makeExecutable;
|
||||
QString m_makeArguments;
|
||||
QString m_userArgs;
|
||||
// Extra arguments for qmake.
|
||||
// Extra arguments for qmake and pro file parser
|
||||
QStringList m_extraArgs;
|
||||
// Extra arguments for pro file parser only
|
||||
QStringList m_extraParserArgs;
|
||||
|
||||
// last values
|
||||
enum class State { IDLE = 0, RUN_QMAKE, RUN_MAKE_QMAKE_ALL, POST_PROCESS };
|
||||
|
Reference in New Issue
Block a user