forked from qt-creator/qt-creator
CMake: Allow parser to run remotely
Change-Id: I3953d459177790fd652ab69c083b0dd0f1d29031 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -32,12 +32,19 @@ CMakeParser::CMakeParser()
|
||||
QTC_CHECK(m_locationLine.isValid());
|
||||
}
|
||||
|
||||
void CMakeParser::setSourceDirectory(const QString &sourceDir)
|
||||
void CMakeParser::setSourceDirectory(const FilePath &sourceDir)
|
||||
{
|
||||
if (m_sourceDirectory)
|
||||
emit searchDirExpired(FilePath::fromString(m_sourceDirectory.value().path()));
|
||||
m_sourceDirectory = QDir(sourceDir);
|
||||
emit newSearchDirFound(FilePath::fromString(sourceDir));
|
||||
emit searchDirExpired(m_sourceDirectory.value());
|
||||
m_sourceDirectory = sourceDir;
|
||||
emit newSearchDirFound(sourceDir);
|
||||
}
|
||||
|
||||
FilePath CMakeParser::resolvePath(const QString &path) const
|
||||
{
|
||||
if (m_sourceDirectory)
|
||||
return m_sourceDirectory->resolvePath(path);
|
||||
return FilePath::fromUserInput(path);
|
||||
}
|
||||
|
||||
OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputFormat type)
|
||||
@@ -69,12 +76,11 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
|
||||
|
||||
match = m_commonError.match(trimmedLine);
|
||||
if (match.hasMatch()) {
|
||||
QString path = m_sourceDirectory ? m_sourceDirectory->absoluteFilePath(
|
||||
QDir::fromNativeSeparators(match.captured(1)))
|
||||
: QDir::fromNativeSeparators(match.captured(1));
|
||||
const FilePath path = resolvePath(match.captured(1));
|
||||
|
||||
m_lastTask = BuildSystemTask(Task::Error,
|
||||
QString(),
|
||||
absoluteFilePath(FilePath::fromUserInput(path)),
|
||||
absoluteFilePath(path),
|
||||
match.captured(2).toInt());
|
||||
m_lines = 1;
|
||||
LinkSpecs linkSpecs;
|
||||
@@ -94,12 +100,10 @@ OutputLineParser::Result CMakeParser::handleLine(const QString &line, OutputForm
|
||||
}
|
||||
match = m_commonWarning.match(trimmedLine);
|
||||
if (match.hasMatch()) {
|
||||
QString path = m_sourceDirectory ? m_sourceDirectory->absoluteFilePath(
|
||||
QDir::fromNativeSeparators(match.captured(2)))
|
||||
: QDir::fromNativeSeparators(match.captured(2));
|
||||
const FilePath path = resolvePath(match.captured(2));
|
||||
m_lastTask = BuildSystemTask(Task::Warning,
|
||||
QString(),
|
||||
absoluteFilePath(FilePath::fromUserInput(path)),
|
||||
absoluteFilePath(path),
|
||||
match.captured(3).toInt());
|
||||
m_lines = 1;
|
||||
LinkSpecs linkSpecs;
|
||||
|
||||
Reference in New Issue
Block a user