1--- a/ApiExtractor/clangparser/compilersupport.cpp 2+++ b/ApiExtractor/clangparser/compilersupport.cpp 3@@ -16,6 +16,7 @@ 4 #include <QtCore/qstandardpaths.h> 5 #include <QtCore/qstringlist.h> 6 #include <QtCore/qversionnumber.h> 7+#include <QtCore/qregularexpression.h> 8 9 #include <clang-c/Index.h> 10 11@@ -341,6 +342,13 @@ QByteArrayList emulatedCompilerOptions() 12 { 13 QByteArrayList result; 14 HeaderPaths headerPaths; 15+ 16+ bool isNixDebug = qgetenv("NIX_DEBUG").toInt() > 0; 17+ // examples: 18+ // /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-qtsensors-6.4.2-dev/include 19+ // /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-qtbase-6.4.2-dev/include 20+ QRegularExpression qtHeaderRegex(uR"(/[0-9a-z]{32}-qt[a-z0-9]+-)"_s); 21+ 22 switch (compiler()) { 23 case Compiler::Msvc: 24 result.append(QByteArrayLiteral("-fms-compatibility-version=19.26.28806")); 25@@ -352,9 +360,30 @@ QByteArrayList emulatedCompilerOptions() 26 appendClangBuiltinIncludes(&headerPaths); 27 break; 28 case Compiler::Clang: 29- headerPaths.append(gppInternalIncludePaths(compilerFromCMake(u"clang++"_s))); 30+ // fix: error: cannot jump from switch statement to this case label: case Compiler::Gpp 31+ // note: jump bypasses variable initialization: const HeaderPaths clangPaths = 32+ { 33+ //headerPaths.append(gppInternalIncludePaths(compilerFromCMake(u"clang++"_s))); 34+ // fix: qt.shiboken: x is specified in typesystem, but not defined. This could potentially lead to compilation errors. 35+ // PySide requires that Qt headers are not -isystem 36+ // https://bugreports.qt.io/browse/PYSIDE-787 37+ const HeaderPaths clangPaths = gppInternalIncludePaths(compilerFromCMake(u"clang++"_qs)); 38+ for (const HeaderPath &h : clangPaths) { 39+ auto match = qtHeaderRegex.match(QString::fromUtf8(h.path)); 40+ if (!match.hasMatch()) { 41+ if (isNixDebug) 42+ qDebug() << "shiboken compilersupport.cpp: found non-qt header: " << h.path; 43+ // add using -isystem 44+ headerPaths.append(h); 45+ } else { 46+ if (isNixDebug) 47+ qDebug() << "shiboken compilersupport.cpp: found qt header: " << h.path; 48+ headerPaths.append({h.path, HeaderType::Standard}); 49+ } 50+ } 51 result.append(noStandardIncludeOption()); 52 break; 53+ } 54 case Compiler::Gpp: 55 if (needsClangBuiltinIncludes()) 56 appendClangBuiltinIncludes(&headerPaths); 57@@ -363,8 +392,20 @@ QByteArrayList emulatedCompilerOptions() 58 // <type_traits> etc (g++ 11.3). 59 const HeaderPaths gppPaths = gppInternalIncludePaths(compilerFromCMake(u"g++"_qs)); 60 for (const HeaderPath &h : gppPaths) { 61- if (h.path.contains("c++") || h.path.contains("sysroot")) 62+ // fix: qt.shiboken: x is specified in typesystem, but not defined. This could potentially lead to compilation errors. 63+ // PySide requires that Qt headers are not -isystem 64+ // https://bugreports.qt.io/browse/PYSIDE-787 65+ auto match = qtHeaderRegex.match(QString::fromUtf8(h.path)); 66+ if (!match.hasMatch()) { 67+ if (isNixDebug) 68+ qDebug() << "shiboken compilersupport.cpp: found non-qt header: " << h.path; 69+ // add using -isystem 70 headerPaths.append(h); 71+ } else { 72+ if (isNixDebug) 73+ qDebug() << "shiboken compilersupport.cpp: found qt header: " << h.path; 74+ headerPaths.append({h.path, HeaderType::Standard}); 75+ } 76 } 77 break; 78 } 79-- 802.39.0