mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
This should fix the eggcacher/packpanda problems on Windows, I think.
This commit is contained in:
parent
d2576e10a1
commit
d60e61993e
@ -21,6 +21,27 @@ int main(int argc, char **argv) {
|
|||||||
int sts = 0;
|
int sts = 0;
|
||||||
|
|
||||||
Py_SetProgramName(argv[0]);
|
Py_SetProgramName(argv[0]);
|
||||||
|
|
||||||
|
// On windows, we need to set pythonhome correctly. We'll try to
|
||||||
|
// find ppython.exe on the path and set pythonhome to its location.
|
||||||
|
#ifdef _WIN32
|
||||||
|
char *path = getenv("PATH");
|
||||||
|
char *result = strtok(path, ";");
|
||||||
|
while (result != NULL) {
|
||||||
|
struct stat st;
|
||||||
|
char *ppython = (char*) malloc(strlen(result) + 13);
|
||||||
|
strcpy(ppython, result);
|
||||||
|
strcat(ppython, "\\ppython.exe");
|
||||||
|
if (stat(ppython, &st) == 0) {
|
||||||
|
Py_SetPythonHome(result);
|
||||||
|
free(ppython);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
result = strtok(NULL, ";");
|
||||||
|
free(ppython);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
|
|
||||||
if (Py_VerboseFlag) {
|
if (Py_VerboseFlag) {
|
||||||
@ -38,4 +59,3 @@ int main(int argc, char **argv) {
|
|||||||
Py_Finalize();
|
Py_Finalize();
|
||||||
return sts;
|
return sts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user