summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefiledeps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/makefiledeps.cpp')
-rw-r--r--qmake/generators/makefiledeps.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index df37957f9b..e1fb42e0a4 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -345,6 +345,30 @@ bool QMakeSourceFileInfo::containsSourceFile(const QString &f, SourceFileType ty
return false;
}
+bool QMakeSourceFileInfo::isSystemInclude(const QString &name)
+{
+ if (QDir::isRelativePath(name)) {
+ // if we got a relative path here, it's either an -I flag with a relative path
+ // or an include file we couldn't locate. Either way, conclude it's not
+ // a system include.
+ return false;
+ }
+
+ for (int i = 0; i < systemIncludes.size(); ++i) {
+ // check if name is located inside the system include dir:
+ QDir systemDir(systemIncludes.at(i));
+ QString relativePath = systemDir.relativeFilePath(name);
+
+ // the relative path might be absolute if we're crossing drives on Windows
+ if (QDir::isAbsolutePath(relativePath) || relativePath.startsWith("../"))
+ continue;
+ debug_msg(5, "File/dir %s is in system dir %s, skipping",
+ qPrintable(name), qPrintable(systemIncludes.at(i)));
+ return true;
+ }
+ return false;
+}
+
char *QMakeSourceFileInfo::getBuffer(int s) {
if(!spare_buffer || spare_buffer_size < s)
spare_buffer = (char *)realloc(spare_buffer, spare_buffer_size=s);