mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-15 07:44:10 +00:00
obs-scripting: Fix python lib path on MacOS
The libpython .dylib files on MacOS are in the python_path/lib subdir. The user supplied python_path still needs to be to the actual python root and not lib/ as the root path get's used as python home dir so just add lib/ when loading the dylib.
This commit is contained in:
parent
f6aed7cb72
commit
e7801e10ba
|
@ -32,6 +32,12 @@
|
|||
#define SO_EXT ".dylib"
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define PYTHON_LIB_SUBDIR "lib/"
|
||||
#else
|
||||
#define PYTHON_LIB_SUBDIR ""
|
||||
#endif
|
||||
|
||||
bool import_python(const char *python_path)
|
||||
{
|
||||
struct dstr lib_path;
|
||||
|
@ -44,7 +50,7 @@ bool import_python(const char *python_path)
|
|||
dstr_init_copy(&lib_path, python_path);
|
||||
dstr_replace(&lib_path, "\\", "/");
|
||||
if (!dstr_is_empty(&lib_path)) {
|
||||
dstr_cat(&lib_path, "/");
|
||||
dstr_cat(&lib_path, "/" PYTHON_LIB_SUBDIR);
|
||||
}
|
||||
dstr_cat(&lib_path, PYTHON_LIB SO_EXT);
|
||||
|
||||
|
|
Loading…
Reference in a new issue