Fix for cmake + windows debug build crash on startup, PYTHONPATH needs to be set, Py_SetPythonHome seems insufficient. Not sure why this is needed or if there is a better solution, but couldn't find another one.

This commit is contained in:
2010-01-11 11:11:21 +00:00
parent a3e461ce1b
commit ebb9286fd6

View File

@@ -299,9 +299,20 @@ void BPY_start_python_path(void)
\nThis may make python import function fail\n");
#endif
#if 0
BLI_setenv("PYTHONHOME", py_path_bundle);
BLI_setenv("PYTHONPATH", py_path_bundle);
#ifdef _WIN32
/* cmake/MSVC debug build crashes without this, why only
in this case is unknown.. */
{
char *envpath = getenv("PYTHONPATH");
if(envpath && envpath[0]) {
char *newenvpath = BLI_sprintfN("%s;%s", py_path_bundle, envpath);
BLI_setenv("PYTHONPATH", newenvpath);
MEM_freeN(newenvpath);
}
else
BLI_setenv("PYTHONPATH", py_path_bundle);
}
#endif
{