Clang: Support MSVC style of compiler flags

Clang has MSVC compatible mode which works with MSVC style command line
flags.

When possible use the same flags (-I, -D, -U, etc.) and in other cases
either replace by MSVC analog (for example use /FI instead of -include)
or pass the argument with '/clang:' prefix (requires
https://reviews.llvm.org/D53457).

Change-Id: I95f33bed5dc8d9493895ed8d4359cdd70fc774b8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2019-01-11 15:32:12 +01:00
parent 4c0c3f5a64
commit 0348009e0e
8 changed files with 467 additions and 209 deletions

View File

@@ -118,6 +118,42 @@ bool ProjectFile::isSource() const
return isSource(kind);
}
bool ProjectFile::isC(ProjectFile::Kind kind)
{
switch (kind) {
case ProjectFile::CHeader:
case ProjectFile::CSource:
case ProjectFile::ObjCHeader:
case ProjectFile::ObjCSource:
return true;
default:
return false;
}
}
bool ProjectFile::isCxx(ProjectFile::Kind kind)
{
switch (kind) {
case ProjectFile::CXXHeader:
case ProjectFile::CXXSource:
case ProjectFile::ObjCXXHeader:
case ProjectFile::ObjCXXSource:
return true;
default:
return false;
}
}
bool ProjectFile::isC() const
{
return isC(kind);
}
bool ProjectFile::isCxx() const
{
return isCxx(kind);
}
#define RETURN_TEXT_FOR_CASE(enumValue) case ProjectFile::enumValue: return #enumValue
const char *projectFileKindToText(ProjectFile::Kind kind)
{