mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
deploy-ng: Allow setting build_apps command line options via bdist_apps command line options
This commit is contained in:
parent
a42ebaea74
commit
d9256755e3
@ -1133,10 +1133,16 @@ class bdist_apps(setuptools.Command):
|
||||
}
|
||||
|
||||
description = 'bundle built Panda3D applications into distributable forms'
|
||||
user_options = []
|
||||
user_options = build_apps.user_options + [
|
||||
]
|
||||
|
||||
def _build_apps_options(self):
|
||||
return [opt[0].replace('-', '_').replace('=', '') for opt in build_apps.user_options]
|
||||
|
||||
def initialize_options(self):
|
||||
self.installers = {}
|
||||
for opt in self._build_apps_options():
|
||||
setattr(self, opt, None)
|
||||
|
||||
def finalize_options(self):
|
||||
# We need to massage the inputs a bit in case they came from a
|
||||
@ -1283,14 +1289,16 @@ class bdist_apps(setuptools.Command):
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
def run(self):
|
||||
build_cmd = self.get_finalized_command('build_apps')
|
||||
if not build_cmd.platforms:
|
||||
platforms = [p3d.PandaSystem.get_platform()]
|
||||
else:
|
||||
build_cmd = self.distribution.get_command_obj('build_apps')
|
||||
for opt in self._build_apps_options():
|
||||
optval = getattr(self, opt)
|
||||
if optval is not None:
|
||||
setattr(build_cmd, opt, optval)
|
||||
build_cmd.finalize_options()
|
||||
self.run_command('build_apps')
|
||||
|
||||
platforms = build_cmd.platforms
|
||||
build_base = build_cmd.build_base
|
||||
|
||||
self.run_command('build_apps')
|
||||
os.chdir(build_base)
|
||||
|
||||
for platform in platforms:
|
||||
|
Loading…
x
Reference in New Issue
Block a user