Meson: Fix compile for gcc 5.3

Amends 77d7bb5014.

Change-Id: Ic613e2b9ddcc0e4b86ed78ddc997c7c40120316c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2020-06-09 13:42:03 +02:00
committed by Eike Ziller
parent 14b163c961
commit 43b6b3d1c8
3 changed files with 16 additions and 15 deletions

View File

@@ -249,8 +249,8 @@ protected:
struct UnknownBuildOption : BuildOption
{
QVariant value() const override { return "Unknown option"; }
QString valueStr() const override { return "Unknown option"; }
QVariant value() const override { return {"Unknown option"}; }
QString valueStr() const override { return {"Unknown option"}; }
void setValue(const QVariant &) override {}
Type type() const override { return Type::unknown; }
BuildOption *copy() const override { return new UnknownBuildOption{*this}; }

View File

@@ -27,6 +27,19 @@
#include <projectexplorer/taskhub.h>
namespace MesonProjectManager {
namespace Internal {
struct WarningRegex
{
const int lineCnt;
const QRegularExpression regex;
};
static const WarningRegex multiLineWarnings[] = {
WarningRegex{ 3, QRegularExpression{R"!(WARNING: Unknown options:)!"}},
WarningRegex{ 2, QRegularExpression{
R"!(WARNING: Project specifies a minimum meson_version|WARNING: Deprecated features used:)!"}},
WarningRegex{ 1, QRegularExpression{R"!(WARNING: )!"}}};
inline void MesonOutputParser::addTask(ProjectExplorer::Task task)
{
#ifndef MESONPARSER_DISABLE_TASKS_FOR_TESTS // small hack to allow unit testing without the banana/monkey/jungle
@@ -100,7 +113,7 @@ Utils::OutputLineParser::Result MesonOutputParser::processErrors(const QString &
Utils::OutputLineParser::Result MesonOutputParser::processWarnings(const QString &line)
{
for (const auto &warning : m_multiLineWarnings) {
for (const auto &warning : multiLineWarnings) {
const auto match = warning.regex.match(line);
if (match.hasMatch()) {
m_remainingLines = warning.lineCnt;

View File

@@ -34,20 +34,8 @@ namespace Internal {
class MesonOutputParser final : public ProjectExplorer::OutputTaskParser
{
Q_OBJECT
struct WarningRegex
{
const int lineCnt;
const QRegularExpression regex;
};
const QRegularExpression m_errorFileLocRegex{R"((^.*meson.build):(\d+):(\d+): ERROR)"};
const QRegularExpression m_errorOptionRegex{R"!(ERROR: Value)!"};
const std::array<WarningRegex, 3> m_multiLineWarnings{
WarningRegex{3, QRegularExpression{R"!(WARNING: Unknown options:)!"}},
WarningRegex{
2,
QRegularExpression{
R"!(WARNING: Project specifies a minimum meson_version|WARNING: Deprecated features used:)!"}},
WarningRegex{1, QRegularExpression{R"!(WARNING: )!"}}};
int m_remainingLines = 0;
QStringList m_pending;
void pushLine(const QString &line);