diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 6ceb6f9574aa..effcd8676c55 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -155,10 +155,6 @@ class MachCommands(CommandBase): @CommandArgument('--jobs', '-j', default=None, help='Number of jobs to run in parallel') - @CommandArgument('--media-stack', - default=None, - choices=["gstreamer", "dummy"], - help='Which media stack to use') @CommandArgument('--no-package', action='store_true', help='For Android, disable packaging into a .apk after building') diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 42385ff4e385..f9a01bbb4af2 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -792,6 +792,12 @@ def build_like_command_arguments(decorated_function): default=None, help='Cross compile for given target platform', ), + CommandArgument( + '--media-stack', + default=None, + choices=["gstreamer", "dummy"], + help='Which media stack to use', + ), CommandArgument( '--android', default=None, diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py index 78f6e2ce392c..1a29fc5f1187 100644 --- a/python/servo/devenv_commands.py +++ b/python/servo/devenv_commands.py @@ -38,16 +38,34 @@ class MachCommands(CommandBase): 'params', default=None, nargs='...', help="Command-line arguments to be passed through to cargo check") @CommandBase.build_like_command_arguments - def check(self, params, **kwargs): + def check(self, params, features=[], media_stack=None, target=None, + android=False, magicleap=False, **kwargs): if not params: params = [] + features = features or [] + + 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] + self.ensure_bootstrapped() self.ensure_clobbered() env = self.build_env() build_start = time() - status = self.run_cargo_build_like_command("check", params, env=env, **kwargs) + status = self.run_cargo_build_like_command("check", params, env=env, features=features, **kwargs) elapsed = time() - build_start notify_build_done(self.config, elapsed, status == 0) diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py index 382f22ac0f5e..4cc7e69318f8 100644 --- a/python/servo/post_build_commands.py +++ b/python/servo/post_build_commands.py @@ -238,10 +238,6 @@ def rr_replay(self): @CommandArgument( 'params', nargs='...', help="Command-line arguments to be passed through to cargo doc") - @CommandArgument('--media-stack', - default=None, - choices=["gstreamer", "dummy"], - help='Which media stack to use') @CommandBase.build_like_command_arguments def doc(self, params, features, target=None, android=False, magicleap=False, media_stack=None, **kwargs):