From 1cefd1bef037c361a785345e619508312883389e Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 9 Dec 2016 13:55:49 -1000 Subject: Do build-time bindgen Majority of build_gecko.rs is just the straightforward conversion from regen.py. There are two differences that: 1. Side in whitelist is changed to mozilla::Side 2. std::atomic__My_base is added to opaque types for Windows --- python/servo/build_commands.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'python/servo/build_commands.py') diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 514a8f87e69..a54d667f5f4 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -384,6 +384,9 @@ class MachCommands(CommandBase): @Command('build-geckolib', description='Build a static library of components used by Gecko', category='build') + @CommandArgument('--with-gecko', + default=None, + help='Build with Gecko dist directory') @CommandArgument('--jobs', '-j', default=None, help='Number of jobs to run in parallel') @@ -393,12 +396,18 @@ class MachCommands(CommandBase): @CommandArgument('--release', '-r', action='store_true', help='Build in release mode') - def build_geckolib(self, jobs=None, verbose=False, release=False): + def build_geckolib(self, with_gecko=None, jobs=None, verbose=False, release=False): self.set_use_stable_rust() self.ensure_bootstrapped() + env = self.build_env(is_build=True) + env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8") + ret = None opts = [] + if with_gecko is not None: + opts += ["--features", "bindgen"] + env["MOZ_DIST"] = path.abspath(with_gecko) if jobs is not None: opts += ["-j", jobs] if verbose: @@ -406,9 +415,6 @@ class MachCommands(CommandBase): if release: opts += ["--release"] - env = self.build_env(is_build=True) - env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target", "geckolib").encode("UTF-8") - build_start = time() with cd(path.join("ports", "geckolib")): ret = call(["cargo", "build"] + opts, env=env, verbose=verbose) -- cgit v1.2.3