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:
@@ -31,6 +31,7 @@
|
||||
#include <app/app_version.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <cpptools/cppprojectfile.h>
|
||||
#include <projectexplorer/projectmacro.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/temporarydirectory.h>
|
||||
@@ -495,15 +496,17 @@ void Dumper::dumpProjectInfos( const QList<ProjectInfo> &projectInfos)
|
||||
}
|
||||
}
|
||||
|
||||
if (!part->toolchainDefines.isEmpty()) {
|
||||
if (!part->toolChainMacros.isEmpty()) {
|
||||
m_out << i3 << "Toolchain Defines:{{{4\n";
|
||||
const QList<QByteArray> defineLines = part->toolchainDefines.split('\n');
|
||||
const QList<QByteArray> defineLines =
|
||||
ProjectExplorer::Macro::toByteArray(part->toolChainMacros).split('\n');
|
||||
foreach (const QByteArray &defineLine, defineLines)
|
||||
m_out << i4 << defineLine << "\n";
|
||||
}
|
||||
if (!part->projectDefines.isEmpty()) {
|
||||
if (!part->projectMacros.isEmpty()) {
|
||||
m_out << i3 << "Project Defines:{{{4\n";
|
||||
const QList<QByteArray> defineLines = part->projectDefines.split('\n');
|
||||
const QList<QByteArray> defineLines =
|
||||
ProjectExplorer::Macro::toByteArray(part->projectMacros).split('\n');
|
||||
foreach (const QByteArray &defineLine, defineLines)
|
||||
m_out << i4 << defineLine << "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user