diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-09-25 12:23:02 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-09-26 08:53:23 +0000 |
commit | cab4bc1b30a10eeda0b73da7fbe47e666aa3edac (patch) | |
tree | abd8476d3dd17c5ae24ae1fbb5e644fd78f06df0 | |
parent | e3695fef9c4bbdf4a2c8721bca453cf908172e67 (diff) |
C/C++ support: Keep built-in includes out of the compiler command line
We are asking for trouble if we let e.g. -I/usr/include appear in the
compiler arguments.
Change-Id: Iccbf9648299e02d408f69e5069cc7443b5be672c
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
-rw-r--r-- | share/qbs/modules/cpp/cpp.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/share/qbs/modules/cpp/cpp.js b/share/qbs/modules/cpp/cpp.js index a13504013..9f907580a 100644 --- a/share/qbs/modules/cpp/cpp.js +++ b/share/qbs/modules/cpp/cpp.js @@ -327,7 +327,10 @@ function collectIncludePaths(input) { var includePaths = input.cpp.includePaths; if (includePaths) allIncludePaths = allIncludePaths.uniqueConcat(includePaths); - return allIncludePaths; + var builtIns = input.cpp.compilerIncludePaths; + return allIncludePaths.filter(function(p) { + return !builtIns.includes(p); + }); } function collectSystemIncludePaths(input) { @@ -338,7 +341,10 @@ function collectSystemIncludePaths(input) { var distributionIncludePaths = input.cpp.distributionIncludePaths; if (distributionIncludePaths) allIncludePaths = allIncludePaths.uniqueConcat(distributionIncludePaths); - return allIncludePaths; + var builtIns = input.cpp.compilerIncludePaths; + return allIncludePaths.filter(function(p) { + return !builtIns.includes(p); + }); } function collectPreincludePaths(input) { |