diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-21 17:04:40 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-06-22 20:20:44 +0000 |
commit | cf4dc77a973fa488594a818381cc9f0941a4f940 (patch) | |
tree | f12f030f58291adb43d17837784194add1fb1890 /sources/shiboken2/ApiExtractor/clangparser | |
parent | 5cf419c973ac367ab36e47abf4bde953ae533706 (diff) |
shiboken: Add command line options for system include paths
Refactor class HeaderPath to contain an enumeration for the type
instead of the boolean framework flag and add handling.
Task-number: PYSIDE-693
Change-Id: I60a62b831ddd5ce7519a066135854ff723db2fc6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser')
-rw-r--r-- | sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp index 655454898..e7de8fdb3 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp +++ b/sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp @@ -106,9 +106,9 @@ static HeaderPaths gppInternalIncludePaths(const QString &compiler) if (line.startsWith(QByteArrayLiteral("End of search list"))) { isIncludeDir = false; } else { - HeaderPath headerPath(line.trimmed()); + HeaderPath headerPath{line.trimmed(), HeaderType::System}; if (headerPath.path.endsWith(frameworkPath())) { - headerPath.m_isFramework = true; + headerPath.type = HeaderType::FrameworkSystem; headerPath.path.truncate(headerPath.path.size() - frameworkPath().size()); } result.append(headerPath); @@ -127,7 +127,8 @@ static void detectVulkan(HeaderPaths *headerPaths) static const char *vulkanVariables[] = {"VULKAN_SDK", "VK_SDK_PATH"}; for (const char *vulkanVariable : vulkanVariables) { if (qEnvironmentVariableIsSet(vulkanVariable)) { - headerPaths->append(HeaderPath(qgetenv(vulkanVariable) + QByteArrayLiteral("/include"))); + const QByteArray path = qgetenv(vulkanVariable) + QByteArrayLiteral("/include"); + headerPaths->append(HeaderPath{path, HeaderType::System}); break; } } @@ -193,9 +194,7 @@ QByteArrayList emulatedCompilerOptions() #endif detectVulkan(&headerPaths); std::transform(headerPaths.cbegin(), headerPaths.cend(), - std::back_inserter(result), [](const HeaderPath &p) { - return HeaderPath::includeOption(p, true); - }); + std::back_inserter(result), HeaderPath::includeOption); return result; } |