forked from qt-creator/qt-creator
Convert macros from plain QByteArray to a vector of structs
The old code model expected the macros as C++ formatted text
("#define Foo 42) but newer targets like the Clang codemodel expect key
value arguments like "-DFoo=42". So instead of parsing the text again and
again we use an abstract data description.
Task-number: QTCREATORBUG-17915
Change-Id: I0179fd13c48a581e91ee79bba9d42d501c26f19f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -29,9 +29,12 @@
|
||||
|
||||
#include "makefileparser.h"
|
||||
|
||||
#include <projectexplorer/projectmacro.h>
|
||||
|
||||
#include <QMutex>
|
||||
#include <QStringList>
|
||||
#include <QThread>
|
||||
#include <QVector>
|
||||
|
||||
namespace AutotoolsProjectManager {
|
||||
namespace Internal {
|
||||
@@ -47,6 +50,8 @@ class MakefileParserThread : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
using Macros = ProjectExplorer::Macros;
|
||||
|
||||
public:
|
||||
MakefileParserThread(const QString &makefile);
|
||||
|
||||
@@ -82,10 +87,10 @@ public:
|
||||
QStringList includePaths() const;
|
||||
|
||||
/**
|
||||
* @return Concatenated defines. Should be invoked, after the signal
|
||||
* @return Concatenated macros. Should be invoked, after the signal
|
||||
* finished() has been emitted.
|
||||
*/
|
||||
QByteArray defines() const;
|
||||
Macros macros() const;
|
||||
|
||||
/**
|
||||
* @return List of compiler flags for C. Should be invoked, after the signal
|
||||
@@ -134,7 +139,7 @@ private:
|
||||
QStringList m_sources; ///< Return value for MakefileParserThread::sources()
|
||||
QStringList m_makefiles; ///< Return value for MakefileParserThread::makefiles()
|
||||
QStringList m_includePaths; ///< Return value for MakefileParserThread::includePaths()
|
||||
QByteArray m_defines; ///< Return value for MakefileParserThread::defines()
|
||||
Macros m_macros; ///< Return value for MakefileParserThread::macros()
|
||||
QStringList m_cflags; ///< Return value for MakefileParserThread::cflags()
|
||||
QStringList m_cxxflags; ///< Return value for MakefileParserThread::cxxflags()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user