diff options
author | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-01-21 15:07:04 +0100 |
---|---|---|
committer | Ivan Donchevskii <ivan.donchevskii@qt.io> | 2019-01-24 13:12:41 +0000 |
commit | 6fa088589b08725b2319b5a4c5ac3d8ed2eb8a3b (patch) | |
tree | 08b0098c991d69c0add2a2306b564978ca3aa34b /src/plugins/cpptools/compileroptionsbuilder.cpp | |
parent | 7f3de881e3d8196649e69e025c80d872fbea2e24 (diff) | |
download | qt-creator-6fa088589b08725b2319b5a4c5ac3d8ed2eb8a3b.tar.gz |
Clang: Fix parsing files with Android toolchain
- filter out include paths from command line flags
- do not search for MinGW parent toolchain in Android toolchain
Change-Id: I5f2566aa0bd10eb939380193e64e17b000743b73
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r-- | src/plugins/cpptools/compileroptionsbuilder.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index f60434f7a4..6e3fa36817 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -48,6 +48,7 @@ static const char defineOption[] = "-D"; static const char undefineOption[] = "-U"; static const char includeUserPathOption[] = "-I"; +static const char includeUserPathOptionWindows[] = "/I"; static const char includeSystemPathOption[] = "-isystem"; static const char includeFileOptionGcc[] = "-include"; @@ -699,7 +700,13 @@ void CompilerOptionsBuilder::reset() void CompilerOptionsBuilder::evaluateCompilerFlags() { bool containsDriverMode = false; + bool skipNext = false; for (const QString &option : m_projectPart.compilerFlags) { + if (skipNext) { + skipNext = false; + continue; + } + // Ignore warning flags as these interfere with ouser user-configured diagnostics. // Note that once "-w" is provided, no warnings will be emitted, even if "-Wall" follows. if (option.startsWith("-w", Qt::CaseInsensitive) @@ -708,8 +715,17 @@ void CompilerOptionsBuilder::evaluateCompilerFlags() continue; } + if (option == includeUserPathOption || option == includeSystemPathOption + || option == includeUserPathOptionWindows) { + skipNext = true; + continue; + } + if (option.startsWith("-O", Qt::CaseSensitive) || option.startsWith("/O", Qt::CaseSensitive) - || option.startsWith("/M", Qt::CaseSensitive)) { + || option.startsWith("/M", Qt::CaseSensitive) + || option.startsWith(includeUserPathOption) + || option.startsWith(includeSystemPathOption) + || option.startsWith(includeUserPathOptionWindows)) { // Optimization and run-time flags. continue; } |