BuildOutputParser: Make MSVC parser available on non-Windows platforms

Change-Id: If48e4fa361f3c306edf5dbfa129cc8a2e38abf53
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2018-03-07 18:21:34 +01:00
committed by André Hartmann
parent 28a1ef8bab
commit 10b5e8dc52
5 changed files with 4 additions and 22 deletions

View File

@@ -6,8 +6,6 @@ include(../../qtcreatortool.pri)
TARGET = buildoutputparser
win32|equals(TEST, 1):DEFINES += HAS_MSVC_PARSER
SOURCES = \
main.cpp \
outputprocessor.cpp

View File

@@ -15,6 +15,4 @@ QtcTool {
condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("darwin")
cpp.rpaths: base.concat(["$ORIGIN/../" + qtc.ide_plugin_path])
}
cpp.defines: base.concat(qbs.targetOS.contains("windows") || qtc.testsEnabled
? ["HAS_MSVC_PARSER"] : [])
}

View File

@@ -52,13 +52,7 @@ static void printUsage()
{
fprintf(stderr, "Usage: %s [--type <compiler type>] <file>\n",
qPrintable(QFileInfo(QCoreApplication::applicationFilePath()).fileName()));
fprintf(stderr, "Possible compiler types: gcc, clang%s. Default is gcc.\n",
#ifdef HAS_MSVC_PARSER
", msvc"
#else
""
#endif
);
fprintf(stderr, "Possible compiler types: gcc, clang, msvc. Default is gcc.\n");
}
int main(int argc, char *argv[])
@@ -83,10 +77,8 @@ int main(int argc, char *argv[])
compilerType = CompilerTypeGcc;
} else if (typeString == QLatin1String("clang")) {
compilerType = CompilerTypeClang;
#ifdef HAS_MSVC_PARSER
} else if (typeString == QLatin1String("msvc")) {
compilerType = CompilerTypeMsvc;
#endif
} else {
fprintf(stderr, "Invalid compiler type '%s'.\n", qPrintable(typeString));
printUsage();

View File

@@ -28,14 +28,12 @@
#include <projectexplorer/clangparser.h>
#include <projectexplorer/gccparser.h>
#include <projectexplorer/gnumakeparser.h>
#include <projectexplorer/msvcparser.h>
#include <projectexplorer/osparser.h>
#include <qmakeprojectmanager/qmakeparser.h>
#include <qtsupport/qtparser.h>
#include <utils/fileutils.h>
#ifdef HAS_MSVC_PARSER
#include <projectexplorer/msvcparser.h>
#endif
#include <QIODevice>
#include <QTextStream>
@@ -67,11 +65,9 @@ void CompilerOutputProcessor::start()
case CompilerTypeClang:
parser.appendOutputParser(new ProjectExplorer::ClangParser);
break;
#ifdef HAS_MSVC_PARSER
case CompilerTypeMsvc:
parser.appendOutputParser(new ProjectExplorer::MsvcParser);
break;
#endif
}
connect(&parser, &ProjectExplorer::IOutputParser::addTask,

View File

@@ -34,10 +34,8 @@ namespace ProjectExplorer { class Task; }
enum CompilerType {
CompilerTypeGcc,
CompilerTypeClang
#ifdef HAS_MSVC_PARSER
, CompilerTypeMsvc
#endif
CompilerTypeClang,
CompilerTypeMsvc
};
class CompilerOutputProcessor : public QObject