CppTools: Do not return a language option for ProjectFile::Unclassified

This led to an invalid command line ("-x" without further argument).

Change-Id: I8cfe1a8a29789fba426b61fe3702496d8089db6b
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-05-06 16:32:53 +02:00
parent c5c57dca0c
commit 65137313b0

View File

@@ -596,9 +596,10 @@ QStringList CompilerOptionsBuilder::createDefineOptions(const QByteArray &define
static QStringList createLanguageOptionGcc(ProjectFile::Kind fileKind, bool objcExt)
{
QStringList opts;
opts += QLatin1String("-x");
switch (fileKind) {
case ProjectFile::Unclassified:
break;
case ProjectFile::CHeader:
if (objcExt)
opts += QLatin1String("objective-c-header");
@@ -643,6 +644,9 @@ static QStringList createLanguageOptionGcc(ProjectFile::Kind fileKind, bool objc
break;
}
if (!opts.isEmpty())
opts.prepend(QLatin1String("-x"));
return opts;
}