forked from qt-creator/qt-creator
Revert "CMake: Pass on extra files to code model"
This reverts commit 4d3eea6884
.
Reason for revert: QTCREATORBUG-23876
Change-Id: I1b438d13cbdf64870e7cc9f7432665d773f58369
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -312,10 +312,11 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
|
|||||||
const FilePath &sourceDirectory)
|
const FilePath &sourceDirectory)
|
||||||
{
|
{
|
||||||
RawProjectParts rpps;
|
RawProjectParts rpps;
|
||||||
const QDir sourceDir(sourceDirectory.toString());
|
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
for (const TargetDetails &t : input.targetDetails) {
|
for (const TargetDetails &t : input.targetDetails) {
|
||||||
|
QDir sourceDir(sourceDirectory.toString());
|
||||||
|
|
||||||
bool needPostfix = t.compileGroups.size() > 1;
|
bool needPostfix = t.compileGroups.size() > 1;
|
||||||
int count = 1;
|
int count = 1;
|
||||||
for (const CompileInfo &ci : t.compileGroups) {
|
for (const CompileInfo &ci : t.compileGroups) {
|
||||||
@@ -358,15 +359,14 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
|
|||||||
cxxProjectFlags.commandLineFlags = cProjectFlags.commandLineFlags;
|
cxxProjectFlags.commandLineFlags = cProjectFlags.commandLineFlags;
|
||||||
rpp.setFlagsForCxx(cxxProjectFlags);
|
rpp.setFlagsForCxx(cxxProjectFlags);
|
||||||
|
|
||||||
FilePath precompiled_header = FilePath::fromString(
|
FilePath precompiled_header
|
||||||
findOrDefault(t.sources, [&ending](const SourceInfo &si) {
|
= FilePath::fromString(findOrDefault(t.sources, [&ending](const SourceInfo &si) {
|
||||||
return si.path.endsWith(ending);
|
return si.path.endsWith(ending);
|
||||||
}).path);
|
}).path);
|
||||||
|
|
||||||
rpp.setFiles(transform<QList>(ci.sources, [&t, &sourceDir](const int si) {
|
rpp.setFiles(transform<QList>(ci.sources, [&t, &sourceDir](const int si) {
|
||||||
return sourceDir.absoluteFilePath(t.sources[static_cast<size_t>(si)].path);
|
return sourceDir.absoluteFilePath(t.sources[static_cast<size_t>(si)].path);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (!precompiled_header.isEmpty()) {
|
if (!precompiled_header.isEmpty()) {
|
||||||
if (precompiled_header.toFileInfo().isRelative()) {
|
if (precompiled_header.toFileInfo().isRelative()) {
|
||||||
const FilePath parentDir = FilePath::fromString(sourceDir.absolutePath());
|
const FilePath parentDir = FilePath::fromString(sourceDir.absolutePath());
|
||||||
@@ -381,22 +381,6 @@ RawProjectParts generateRawProjectParts(const PreprocessedData &input,
|
|||||||
rpps.append(rpp);
|
rpps.append(rpp);
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check sources for more files and associate them with the current target
|
|
||||||
const QStringList extraSources = Utils::transform<QList>(
|
|
||||||
Utils::filtered(t.sources, [](const SourceInfo &si) { return si.compileGroup == -1; }),
|
|
||||||
[&sourceDir](const SourceInfo &si) { return sourceDir.absoluteFilePath(si.path); });
|
|
||||||
if (!extraSources.isEmpty()) {
|
|
||||||
RawProjectPart rpp;
|
|
||||||
rpp.setProjectFileLocation(t.sourceDir.pathAppended("CMakeLists.txt").toString());
|
|
||||||
rpp.setBuildSystemTarget(t.name);
|
|
||||||
rpp.setDisplayName(t.id + "_extra");
|
|
||||||
|
|
||||||
rpp.setFiles(extraSources);
|
|
||||||
|
|
||||||
// This is all the information we have :-/
|
|
||||||
rpps.append(rpp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rpps;
|
return rpps;
|
||||||
|
Reference in New Issue
Block a user