MinGW: if PYTHONHOME is not set then automatically do it at program start

This commit is contained in:
wmayer
2021-09-23 12:34:09 +02:00
parent b89a7dc88c
commit f38481a68c
2 changed files with 12 additions and 0 deletions

View File

@@ -72,6 +72,13 @@ int main( int argc, char ** argv )
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C");
#if defined(__MINGW32__)
const char* mingw_prefix = getenv("MINGW_PREFIX");
const char* py_home = getenv("PYTHONHOME");
if (!py_home && mingw_prefix)
_putenv_s("PYTHONHOME", mingw_prefix);
#endif
// Name and Version of the Application
App::Application::Config()["ExeName"] = "FreeCAD";
App::Application::Config()["ExeVendor"] = "FreeCAD";