forked from qt-creator/qt-creator
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:
@@ -86,10 +86,10 @@ public:
|
||||
void addExtraOptions() final
|
||||
{
|
||||
addDummyUiHeaderOnDiskIncludePath();
|
||||
add("-fmessage-length=0");
|
||||
add("-fdiagnostics-show-note-include-stack");
|
||||
add("-fmessage-length=0", /*gccOnlyOption=*/true);
|
||||
add("-fdiagnostics-show-note-include-stack", /*gccOnlyOption=*/true);
|
||||
add("-fretain-comments-from-system-headers", /*gccOnlyOption=*/true);
|
||||
add("-fmacro-backtrace-limit=0");
|
||||
add("-fretain-comments-from-system-headers");
|
||||
add("-ferror-limit=1000");
|
||||
}
|
||||
|
||||
@@ -97,10 +97,8 @@ private:
|
||||
void addDummyUiHeaderOnDiskIncludePath()
|
||||
{
|
||||
const QString path = ClangModelManagerSupport::instance()->dummyUiHeaderOnDiskDirPath();
|
||||
if (!path.isEmpty()) {
|
||||
add("-I");
|
||||
add(QDir::toNativeSeparators(path));
|
||||
}
|
||||
if (!path.isEmpty())
|
||||
add({"-I", QDir::toNativeSeparators(path)});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user