forked from qt-creator/qt-creator
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:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user