mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-05 21:35:49 +00:00
Search share/renderdoc/pylibs for python libs.
* This is only relevant for static qrenderdoc builds where the python used isn't the system python, so it needs to locate its libs. Otherwise the system libpython3.so and libs will be used.
This commit is contained in:
@@ -41,7 +41,9 @@ PyTypeObject **SbkPySide2_QtWidgetsTypes = NULL;
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
#include "PythonContext.h"
|
||||
@@ -112,6 +114,7 @@ static inline QString ToQStr(PyObject *value)
|
||||
}
|
||||
|
||||
static wchar_t program_name[] = L"qrenderdoc";
|
||||
static wchar_t python_home[1024] = {0};
|
||||
|
||||
struct OutputRedirector
|
||||
{
|
||||
@@ -207,6 +210,19 @@ void PythonContext::GlobalInit()
|
||||
PyImport_AppendInittab("_renderdoc", &PyInit__renderdoc);
|
||||
PyImport_AppendInittab("_qrenderdoc", &PyInit__qrenderdoc);
|
||||
|
||||
#if defined(STATIC_QRENDERDOC)
|
||||
// add the location where our libs will be for statically-linked python installs
|
||||
{
|
||||
QDir bin = QFileInfo(QCoreApplication::applicationFilePath()).absoluteDir();
|
||||
|
||||
QString pylibs = QDir::cleanPath(bin.absoluteFilePath("../share/renderdoc/pylibs"));
|
||||
|
||||
pylibs.toWCharArray(python_home);
|
||||
|
||||
Py_SetPythonHome(python_home);
|
||||
}
|
||||
#endif
|
||||
|
||||
Py_SetProgramName(program_name);
|
||||
|
||||
Py_Initialize();
|
||||
|
||||
Reference in New Issue
Block a user