Clang: Add macro names the to project part

So we can compare later if the macro names have changed.

Change-Id: I65c5f76e07fced8df6cc7282c03430adffcf5fa8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-01-29 12:07:15 +01:00
parent 8b85b095b2
commit c0b771f99c
11 changed files with 44 additions and 22 deletions

View File

@@ -66,18 +66,20 @@ public:
}
void insertOrUpdateProjectPart(Utils::SmallStringView projectPartName,
const Utils::SmallStringVector &commandLineArguments) override
const Utils::SmallStringVector &commandLineArguments,
const Utils::SmallStringVector &macroNames) override
{
m_statementFactory.database.setLastInsertedRowId(-1);
Utils::SmallString compilerArguementsAsJson = toJson(commandLineArguments);
Utils::SmallString macroNamesAsJson = toJson(macroNames);
WriteStatement &insertStatement = m_statementFactory.insertProjectPartStatement;
insertStatement.write(projectPartName, compilerArguementsAsJson);
insertStatement.write(projectPartName, compilerArguementsAsJson, macroNamesAsJson);
if (m_statementFactory.database.lastInsertedRowId() == -1) {
WriteStatement &updateStatement = m_statementFactory.updateProjectPartStatement;
updateStatement.write(compilerArguementsAsJson, projectPartName);
updateStatement.write(compilerArguementsAsJson, macroNamesAsJson, projectPartName);
}
}