Clang: Introduce CompilerMacro

We want not only the name but the value of the macro too. So we can
compare if anything has changed.

Change-Id: Ie59caf8cbf54d108f9e15299d25306a406b5c40d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-02-06 19:03:14 +01:00
parent 07fcd6f362
commit 56f79feebf
27 changed files with 251 additions and 77 deletions

View File

@@ -77,14 +77,14 @@ protected:
projectPart.files.push_back(source1ProjectFile);
projectPart.files.push_back(source2ProjectFile);
projectPart.displayName = QString(projectPartId);
projectPart.projectMacros.push_back({"DEFINE"});
projectPart.projectMacros.push_back({"DEFINE", "1"});
Utils::SmallStringVector arguments{ClangPchManager::ProjectUpdater::compilerArguments(
&projectPart)};
expectedContainer = {projectPartId.clone(),
arguments.clone(),
macroNames.clone(),
Utils::clone(compilerMacros),
{filePathId(headerPaths[1])},
{filePathIds(sourcePaths)}};
}
@@ -101,7 +101,7 @@ protected:
Utils::SmallString projectPartId2{"project2"};
Utils::PathStringVector headerPaths = {"/path/to/header1.h", "/path/to/header2.h"};
Utils::PathStringVector sourcePaths = {"/path/to/source1.cpp", "/path/to/source2.cpp"};
Utils::SmallStringVector macroNames = {"DEFINE"};
ClangBackEnd::CompilerMacros compilerMacros = {{"DEFINE", "1"}};
CppTools::ProjectFile header1ProjectFile{QString(headerPaths[0]), CppTools::ProjectFile::CXXHeader};
CppTools::ProjectFile header2ProjectFile{QString(headerPaths[1]), CppTools::ProjectFile::CXXHeader};
CppTools::ProjectFile source1ProjectFile{QString(sourcePaths[0]), CppTools::ProjectFile::CXXSource};