mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
preload libpandaexpress
This commit is contained in:
parent
970f35a3e6
commit
8b77da64df
@ -2158,6 +2158,8 @@ class Packager:
|
|||||||
self.do_module('VFSImporter', filename = filename)
|
self.do_module('VFSImporter', filename = filename)
|
||||||
self.do_freeze('_vfsimporter', compileToExe = False)
|
self.do_freeze('_vfsimporter', compileToExe = False)
|
||||||
|
|
||||||
|
self.do_file('libpandaexpress.dll');
|
||||||
|
|
||||||
# Now that we're done freezing, explicitly add 'direct' to
|
# Now that we're done freezing, explicitly add 'direct' to
|
||||||
# counteract the previous explicit excludeModule().
|
# counteract the previous explicit excludeModule().
|
||||||
self.do_module('direct')
|
self.do_module('direct')
|
||||||
|
@ -128,8 +128,23 @@ run_python() {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// First, load _vfsimporter.pyd. Since this is a magic frozen pyd,
|
// We'll need libpandaexpress to be imported before we can load
|
||||||
// importing it automatically makes all of its frozen contents
|
// _vfsimporter. So, find it and load it.
|
||||||
|
Filename libpandaexpress(_archive_file.get_dirname(),
|
||||||
|
Filename::dso_filename("libpandaexpress.so"));
|
||||||
|
if (!libpandaexpress.exists()) {
|
||||||
|
nout << "Can't find " << libpandaexpress << "\n";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
string startup;
|
||||||
|
startup = "import imp; imp.load_dynamic('libpandaexpress', \"";
|
||||||
|
startup += libpandaexpress.to_os_specific();
|
||||||
|
startup += "\");";
|
||||||
|
PyRun_SimpleString(startup.c_str());
|
||||||
|
|
||||||
|
// Now we can load _vfsimporter.pyd. Since this is a magic frozen
|
||||||
|
// pyd, importing it automatically makes all of its frozen contents
|
||||||
// available to import as well.
|
// available to import as well.
|
||||||
PyObject *vfsimporter = PyImport_ImportModule("_vfsimporter");
|
PyObject *vfsimporter = PyImport_ImportModule("_vfsimporter");
|
||||||
if (vfsimporter == NULL) {
|
if (vfsimporter == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user