forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/12.0'
Change-Id: Iee11f97dbd0114957e856d02f0ad295813a05431
This commit is contained in:
@@ -1909,7 +1909,9 @@ CMakeBuildConfiguration *CMakeBuildSystem::cmakeBuildConfiguration() const
|
||||
static FilePaths librarySearchPaths(const CMakeBuildSystem *bs, const QString &buildKey)
|
||||
{
|
||||
const CMakeBuildTarget cmakeBuildTarget
|
||||
= Utils::findOrDefault(bs->buildTargets(), Utils::equal(&CMakeBuildTarget::title, buildKey));
|
||||
= Utils::findOrDefault(bs->buildTargets(), [buildKey](const auto &target) {
|
||||
return target.title == buildKey && target.targetType != UtilityType;
|
||||
});
|
||||
|
||||
return cmakeBuildTarget.libraryDirectories;
|
||||
}
|
||||
|
||||
@@ -48,10 +48,6 @@ static LocatorMatcherTasks cmakeMatchers(const BuildAcceptor &acceptor)
|
||||
continue;
|
||||
const int index = target.title.indexOf(input, 0, Qt::CaseInsensitive);
|
||||
if (index >= 0) {
|
||||
const FilePath path = target.backtrace.isEmpty()
|
||||
? cmakeProject->projectFilePath()
|
||||
: target.backtrace.last().path;
|
||||
const int line = target.backtrace.isEmpty() ? 0 : target.backtrace.last().line;
|
||||
const FilePath projectPath = cmakeProject->projectFilePath();
|
||||
const QString displayName = target.title;
|
||||
LocatorFilterEntry entry;
|
||||
@@ -62,11 +58,20 @@ static LocatorMatcherTasks cmakeMatchers(const BuildAcceptor &acceptor)
|
||||
return AcceptResult();
|
||||
};
|
||||
}
|
||||
entry.linkForEditor = {path, line};
|
||||
entry.extraInfo = path.shortNativePath();
|
||||
bool realTarget = false;
|
||||
if (!target.backtrace.isEmpty() && target.targetType != UtilityType) {
|
||||
const FilePath path = target.backtrace.last().path;
|
||||
const int line = target.backtrace.last().line;
|
||||
entry.linkForEditor = {path, line};
|
||||
entry.extraInfo = path.shortNativePath();
|
||||
realTarget = true;
|
||||
} else {
|
||||
entry.extraInfo = projectPath.shortNativePath();
|
||||
}
|
||||
entry.highlightInfo = {index, int(input.length())};
|
||||
entry.filePath = cmakeProject->projectFilePath();
|
||||
entries.append(entry);
|
||||
if (acceptor || realTarget)
|
||||
entries.append(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user