diff options
author | Xidorn Quan <me@upsuper.org> | 2016-12-09 13:55:49 -1000 |
---|---|---|
committer | Xidorn Quan <me@upsuper.org> | 2016-12-10 00:33:41 -1000 |
commit | 1cefd1bef037c361a785345e619508312883389e (patch) | |
tree | adf34e40e9c45c54f9eddcb79506f8869e80aff5 /python/servo/build_commands.py | |
parent | 6dd4b4822fa788694153ee61a04dd9a5dfb748ec (diff) | |
download | servo-1cefd1bef037c361a785345e619508312883389e.tar.gz servo-1cefd1bef037c361a785345e619508312883389e.zip |
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
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r-- | python/servo/build_commands.py | 14 |
1 files changed, 10 insertions, 4 deletions
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) |