aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-02-11 14:41:53 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-02-11 15:18:24 +0100
commite330f659c47de880493f9bfd4ba2a000196d00bc (patch)
treed4e6d7064bdaa9cf6594306c6dadbe88c91ce7f9 /sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
parent9827a47135d8e0ac7262c6c13188e387bf034b3b (diff)
shiboken6: Move Vulkan detection out of the emulated compiler options
Task-number: PYSIDE-1812 Change-Id: I304d0c437cda114a865828578dca320c0d2fe45f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
index fb42b78f0..7d31f17e0 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
@@ -186,16 +186,18 @@ static HeaderPaths gppInternalIncludePaths(const QString &compiler)
}
// Detect Vulkan as supported from Qt 5.10 by checking the environment variables.
-static void detectVulkan(HeaderPaths *headerPaths)
+QByteArrayList detectVulkan()
{
static const char *vulkanVariables[] = {"VULKAN_SDK", "VK_SDK_PATH"};
for (const char *vulkanVariable : vulkanVariables) {
if (qEnvironmentVariableIsSet(vulkanVariable)) {
- const QByteArray path = qgetenv(vulkanVariable) + QByteArrayLiteral("/include");
- headerPaths->append(HeaderPath{path, HeaderType::System});
- break;
+ const auto option = QByteArrayLiteral("-isystem")
+ + qgetenv(vulkanVariable)
+ + QByteArrayLiteral("/include");
+ return {option};
}
}
+ return {};
}
// For MSVC, we set the MS compatibility version and let Clang figure out its own
@@ -326,7 +328,6 @@ QByteArrayList emulatedCompilerOptions()
break;
}
- detectVulkan(&headerPaths);
std::transform(headerPaths.cbegin(), headerPaths.cend(),
std::back_inserter(result), HeaderPath::includeOption);
return result;