summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/compileroptionsbuilder.cpp
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-11-12 13:18:27 +0100
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-11-21 13:18:22 +0000
commit053b2090b46ad59f3614c2c9877df3f0f0c906a4 (patch)
treec305bbbe37c4d89a38f4b9c8b957f851688efa93 /src/plugins/cpptools/compileroptionsbuilder.cpp
parent647566c135bc2693bc486e7b23567870cc194e4b (diff)
downloadqt-creator-053b2090b46ad59f3614c2c9877df3f0f0c906a4.tar.gz
Clang: Fix C++ paths search in compiler options builder
Take into account paths from MinGW and NDK Clang. Fixes: QTCREATORBUG-21540 Change-Id: I00906c75dc4ddeb92fe5942a0222285d8ce2eb9d Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r--src/plugins/cpptools/compileroptionsbuilder.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp
index e3f2be6c83..1529cb445f 100644
--- a/src/plugins/cpptools/compileroptionsbuilder.cpp
+++ b/src/plugins/cpptools/compileroptionsbuilder.cpp
@@ -235,14 +235,15 @@ static int lastIncludeIndex(const QStringList &options, const QRegularExpression
static int includeIndexForResourceDirectory(const QStringList &options, bool isMacOs = false)
{
- // include/c++/{version}, include/c++/v1 and include/g++
- static const QRegularExpression includeRegExp(
- R"(\A.*[\/\\]include[\/\\].*(g\+\+.*\z|c\+\+[\/\\](v1\z|\d+.*\z)))");
+ // include/c++, include/g++, libc++\include and libc++abi\include
+ static const QString cppIncludes = R"((.*[\/\\]include[\/\\].*(g\+\+|c\+\+).*))"
+ R"(|(.*libc\+\+[\/\\]include))"
+ R"(|(.*libc\+\+abi[\/\\]include))";
+ static const QRegularExpression includeRegExp("\\A(" + cppIncludes + ")\\z");
// The same as includeRegExp but also matches /usr/local/include
static const QRegularExpression includeRegExpMac(
- R"(\A(.*[\/\\]include[\/\\].*(g\+\+.*\z|c\+\+[\/\\](v1\z|\d+.*\z))))"
- R"(|([\/\\]usr[\/\\]local[\/\\]include\z))");
+ "\\A(" + cppIncludes + R"(|([\/\\]usr[\/\\]local[\/\\]include))" + ")\\z");
const int cppIncludeIndex = lastIncludeIndex(options, isMacOs
? includeRegExpMac