aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/build_commands.py4
-rw-r--r--python/servo/command_base.py6
-rw-r--r--python/servo/devenv_commands.py22
-rw-r--r--python/servo/post_build_commands.py4
4 files changed, 26 insertions, 10 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py
index 6ceb6f9574a..effcd8676c5 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 42385ff4e38..f9a01bbb4af 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -793,6 +793,12 @@ install them, let us know by filing a bug!")
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,
action='store_true',
diff --git a/python/servo/devenv_commands.py b/python/servo/devenv_commands.py
index 78f6e2ce392..1a29fc5f118 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 382f22ac0f5..4cc7e69318f 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -238,10 +238,6 @@ class PostBuildCommands(CommandBase):
@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):