diff options
Diffstat (limited to 'src/plugins/projectexplorer/ldparser.cpp')
-rw-r--r-- | src/plugins/projectexplorer/ldparser.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/ldparser.cpp b/src/plugins/projectexplorer/ldparser.cpp index 919c9db30b..8c00f9f424 100644 --- a/src/plugins/projectexplorer/ldparser.cpp +++ b/src/plugins/projectexplorer/ldparser.cpp @@ -25,7 +25,6 @@ #include "ldparser.h" #include "projectexplorerconstants.h" -#include "task.h" #include <utils/qtcassert.h> @@ -58,6 +57,9 @@ LdParser::LdParser() void LdParser::stdError(const QString &line) { QString lne = rightTrimmed(line); + if (!lne.isEmpty() && !lne.at(0).isSpace() && !m_incompleteTask.isNull()) + flush(); + if (lne.startsWith(QLatin1String("TeamBuilder ")) || lne.startsWith(QLatin1String("distcc[")) || lne.contains(QLatin1String("ar: creating "))) { @@ -65,6 +67,21 @@ void LdParser::stdError(const QString &line) return; } + // ld on macOS + if (lne.startsWith("Undefined symbols for architecture") && lne.endsWith(":")) { + m_incompleteTask = Task(Task::Error, lne, Utils::FilePath(), -1, + Constants::TASK_CATEGORY_COMPILE); + return; + } + if (!m_incompleteTask.isNull() && lne.startsWith(" ")) { + m_incompleteTask.description.append('\n').append(lne); + static const QRegularExpression locRegExp(" (?<symbol>\\S+) in (?<file>\\S+)"); + const QRegularExpressionMatch match = locRegExp.match(lne); + if (match.hasMatch()) + m_incompleteTask.setFile(Utils::FilePath::fromString(match.captured("file"))); + return; + } + if (lne.startsWith("collect2:") || lne.startsWith("collect2.exe:")) { Task task = Task(Task::Error, lne /* description */, @@ -134,3 +151,12 @@ void LdParser::stdError(const QString &line) IOutputParser::stdError(line); } + +void LdParser::doFlush() +{ + if (m_incompleteTask.isNull()) + return; + const Task t = m_incompleteTask; + m_incompleteTask.clear(); + emit addTask(t); +} |