void-packages/srcpkgs/shiboken2/patches/clang-options-via-environment-variables.patch
yopito 50e5ad1c72 shiboken2: update to 5.15.2, testing support, remove dummy packages
add SHIBOKEN_CLANG_OPTIONS env variable support to manage crossbuild
2021-01-28 00:31:48 -03:00

21 lines
810 B
Diff

Add ability to pass additional options to clang via environnement variable.
With help from https://github.com/void-linux/void-packages/pull/26962
--- sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
+++ sources/shiboken2/ApiExtractor/clangparser/compilersupport.cpp
@@ -305,6 +305,15 @@
QByteArrayList emulatedCompilerOptions()
{
QByteArrayList result;
+
+ QByteArray shiboken_clang_options = qgetenv("SHIBOKEN_CLANG_OPTIONS");
+ // split to avoid double quoting drived by space inside it
+ if (!shiboken_clang_options.isEmpty()) {
+ for (const QByteArray &item: shiboken_clang_options.split(' ')) {
+ result.append(item);
+ }
+ }
+
#if defined(Q_CC_MSVC)
HeaderPaths headerPaths;
result.append(QByteArrayLiteral("-fms-compatibility-version=19"));