mirror of
https://github.com/servo/servo.git
synced 2025-06-06 00:25:37 +00:00
Extract media_stack pick into CommandBase
This commit is contained in:
parent
6d8f35c590
commit
81c439a899
4 changed files with 16 additions and 36 deletions
|
@ -191,18 +191,7 @@ class MachCommands(CommandBase):
|
|||
if not uwp:
|
||||
uwp = target and 'uwp' in target
|
||||
|
||||
# A guess about which platforms should use the gstreamer media stack
|
||||
if not(media_stack):
|
||||
if (
|
||||
not(target) or
|
||||
("armv7" in target and "android" in target) or
|
||||
("x86_64" in target)
|
||||
):
|
||||
media_stack = "gstreamer"
|
||||
else:
|
||||
media_stack = "dummy"
|
||||
|
||||
features += ["media-" + media_stack]
|
||||
features += self.pick_media_stack(media_stack, target)
|
||||
|
||||
target_path = base_path = self.get_target_dir()
|
||||
if android:
|
||||
|
|
|
@ -862,6 +862,19 @@ install them, let us know by filing a bug!")
|
|||
android = self.handle_android_target(target)
|
||||
return target, android
|
||||
|
||||
# A guess about which platforms should use the gstreamer media stack
|
||||
def pick_media_stack(self, media_stack, target):
|
||||
if not(media_stack):
|
||||
if (
|
||||
not(target) or
|
||||
("armv7" in target and "android" in target) or
|
||||
("x86_64" in target)
|
||||
):
|
||||
media_stack = "gstreamer"
|
||||
else:
|
||||
media_stack = "dummy"
|
||||
return ["media-" + media_stack]
|
||||
|
||||
def run_cargo_build_like_command(
|
||||
self, command, cargo_args,
|
||||
env=None, verbose=False,
|
||||
|
|
|
@ -47,18 +47,7 @@ class MachCommands(CommandBase):
|
|||
|
||||
target, android = self.pick_target_triple(target, android, magicleap)
|
||||
|
||||
# A guess about which platforms should use the gstreamer media stack
|
||||
if not(media_stack):
|
||||
if (
|
||||
not(target) or
|
||||
("armv7" in target and "android" in target) or
|
||||
("x86_64" in target)
|
||||
):
|
||||
media_stack = "gstreamer"
|
||||
else:
|
||||
media_stack = "dummy"
|
||||
|
||||
features += ["media-" + media_stack]
|
||||
features += self.pick_media_stack(media_stack, target)
|
||||
|
||||
self.ensure_bootstrapped()
|
||||
self.ensure_clobbered()
|
||||
|
|
|
@ -272,18 +272,7 @@ class PostBuildCommands(CommandBase):
|
|||
|
||||
target, android = self.pick_target_triple(target, android, magicleap)
|
||||
|
||||
# A guess about which platforms should use the gstreamer media stack
|
||||
if not(media_stack):
|
||||
if (
|
||||
not(target) or
|
||||
("armv7" in target and "android" in target) or
|
||||
("x86_64" in target)
|
||||
):
|
||||
media_stack = "gstreamer"
|
||||
else:
|
||||
media_stack = "dummy"
|
||||
|
||||
features += ["media-" + media_stack]
|
||||
features += self.pick_media_stack(media_stack, target)
|
||||
|
||||
returncode = self.run_cargo_build_like_command("doc", params, features=features, **kwargs)
|
||||
if returncode:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue