mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Implement ./mach doc --media-stack={dummy|gstreamer}
This commit is contained in:
parent
01a99b5cbe
commit
ba3169e65d
1 changed files with 22 additions and 1 deletions
|
@ -238,8 +238,13 @@ class PostBuildCommands(CommandBase):
|
||||||
@CommandArgument(
|
@CommandArgument(
|
||||||
'params', nargs='...',
|
'params', nargs='...',
|
||||||
help="Command-line arguments to be passed through to cargo doc")
|
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
|
@CommandBase.build_like_command_arguments
|
||||||
def doc(self, params, features, **kwargs):
|
def doc(self, params, features, target=None, android=False, magicleap=False,
|
||||||
|
media_stack=None, **kwargs):
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["RUSTUP_TOOLCHAIN"] = self.toolchain()
|
env["RUSTUP_TOOLCHAIN"] = self.toolchain()
|
||||||
rustc_path = check_output(["rustup" + BIN_SUFFIX, "which", "rustc"], env=env)
|
rustc_path = check_output(["rustup" + BIN_SUFFIX, "which", "rustc"], env=env)
|
||||||
|
@ -268,6 +273,22 @@ class PostBuildCommands(CommandBase):
|
||||||
copy2(full_name, destination)
|
copy2(full_name, destination)
|
||||||
|
|
||||||
features = features or []
|
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]
|
||||||
|
|
||||||
returncode = self.run_cargo_build_like_command("doc", params, features=features, **kwargs)
|
returncode = self.run_cargo_build_like_command("doc", params, features=features, **kwargs)
|
||||||
if returncode:
|
if returncode:
|
||||||
return returncode
|
return returncode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue