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"));