cmake: update installation of python extra submodules

- support Python standalone builds
- loader installs submodules unconditionally
This commit is contained in:
Alexander Alekhin
2021-10-15 16:58:37 +03:00
parent 39c3334147
commit a590682764
6 changed files with 89 additions and 87 deletions
+2 -1
View File
@@ -41,7 +41,7 @@ def __load_extra_py_code_for_module(base, name, enable_debug_print=False):
setattr(py_module, "_native", native_module)
for k, v in filter(lambda kv: not hasattr(py_module, kv[0]),
native_module.__dict__.items()):
if enable_debug_print: print(' symbol: {} = {}'.format(k, v))
if enable_debug_print: print(' symbol({}): {} = {}'.format(name, k, v))
setattr(py_module, k, v)
return True
@@ -51,6 +51,7 @@ def __collect_extra_submodules(enable_debug_print=False):
return all((
# module is not internal
not module.startswith("_"),
not module.startswith("python-"),
# it is not a file
os.path.isdir(os.path.join(_extra_submodules_init_path, module))
))