P3DModuleBuilder
P3DModuleBuilder copied to clipboard
fix panda3d.lui.__name__
interrogate_module.cpp should contains :
PyObject *module = Dtool_PyModuleInitHelper(defs, "panda3d.lui");
actually is:
PyObject *module = Dtool_PyModuleInitHelper(defs, "lui");
Hm, I don't think this works since the module builder is also used for other modules besides of LUI, so that this would break them. I believe there should be an option to add the panda3d prefix? So that modules which are supposed to be added to the panda3d installation have that prefix, and others don't
maybe add a flag then, at least for LUI case ? i am currently modifying the cmake script to handle standalone python 3.7 and panda3d on android 4.4 ( linux cross build passed) i am about to test functionnality so not a problem to add specific force module name from env.
Okay, so it seems this is android specifc? Or does this also affect windows / linux builds? Should the prefix appear on all platforms?
i think the .__name__ of a module should be defined by an env e.g. "MODULE_FQN" for all platforms.
the lui case is straightforward :
as panda3d.core.__name__ == 'panda3d.core'
it should be settable so we'll have panda3d.lui.__name__ == 'panda3d.lui'
Actually P3DModuleBuilder can't do that.
and to comply with multi_lib specs of py3 you should allow an override of the soname ( because autodetect from python host could lead to arch triple error when cross compiling )
so you get for example : lui.cpython-34m-x86_64-linux-gnu.so
Wouldn't it be better to make the module builder automatically prefix "panda3d." when it detects that this is required? I'd prefer if this could happen automatically instead of having to set an environment variable.
How would you like to be able to override the name of the generated binary? Maybe with a pattern string? E.g. output_name=%module%-%pythonver%-%platform%.so?