mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
Add Qt5Qml.dll stub for 32-bit pyside2 distribution
* When the pyside2 we ship was built it accidentally included a small dependency on Qt5Qml, which we don't distribute so the pyside2 libraries wouldn't load. * We can generate a tiny stub with the right exports and load it manually from the PySide2 folder on 32-bit qrenderdoc builds to allow pyside2 to load subsequently. The stub source is tiny, and added alongside. * Putting it in the PySide2 folder means that even if someone puts RenderDoc's build folder in their PATH, our stub Qt5Qml won't break anything because it won't be loaded. If they put PySide2 in the PATH it might, but then it's their fault!
This commit is contained in:
@@ -56,6 +56,11 @@ PyTypeObject **SbkPySide2_QtWidgetsTypes = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// for the LoadLibrary call on 32-bit windows
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
@@ -342,6 +347,14 @@ void PythonContext::GlobalInit()
|
||||
// set up PySide
|
||||
#if PYSIDE2_ENABLED
|
||||
{
|
||||
// hack for win32 builds, where our pyside2 accidentally depends on Qt5Qml.dll for no good
|
||||
// reason and we ship a stub to allow the dll to load instead of rebuilding the whole of pyside2
|
||||
// :S
|
||||
#if defined(_MSC_VER) && !defined(_M_X64)
|
||||
QString Qt5QmlStub = QApplication::applicationDirPath() + lit("/PySide2/Qt5Qml.dll");
|
||||
LoadLibraryA(Qt5QmlStub.toUtf8().data());
|
||||
#endif
|
||||
|
||||
Shiboken::AutoDecRef core(Shiboken::Module::import("PySide2.QtCore"));
|
||||
if(!core.isNull())
|
||||
SbkPySide2_QtCoreTypes = Shiboken::Module::getTypes(core);
|
||||
|
||||
Reference in New Issue
Block a user