mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
dist: Add special support for hidden imports of plyer module
This commit is contained in:
parent
218f2af7fb
commit
5c03cd59fb
15
direct/src/dist/FreezeTool.py
vendored
15
direct/src/dist/FreezeTool.py
vendored
@ -80,6 +80,7 @@ defaultHiddenImports = {
|
||||
],
|
||||
'pandas.compat': ['lzma', 'cmath'],
|
||||
'pandas._libs.tslibs.conversion': ['pandas._libs.tslibs.base'],
|
||||
'plyer': ['plyer.platforms'],
|
||||
}
|
||||
|
||||
|
||||
@ -853,6 +854,20 @@ class Freezer:
|
||||
if hiddenImports is not None:
|
||||
self.hiddenImports.update(hiddenImports)
|
||||
|
||||
# Special hack for plyer, which has platform-specific hidden imports
|
||||
plyer_platform = None
|
||||
if self.platform.startswith('android'):
|
||||
plyer_platform = 'android'
|
||||
elif self.platform.startswith('linux'):
|
||||
plyer_platform = 'linux'
|
||||
elif self.platform.startswith('mac'):
|
||||
plyer_platform = 'macosx'
|
||||
elif self.platform.startswith('win'):
|
||||
plyer_platform = 'win'
|
||||
|
||||
if plyer_platform:
|
||||
self.hiddenImports['plyer'].append(f'plyer.platforms.{plyer_platform}.*')
|
||||
|
||||
# Suffix/extension for Python C extension modules
|
||||
if self.platform == PandaSystem.getPlatform():
|
||||
suffixes = imp.get_suffixes()
|
||||
|
Loading…
x
Reference in New Issue
Block a user