diff options
author | Glenn Watson <gw@intuitionlibrary.com> | 2015-01-22 09:08:39 +1000 |
---|---|---|
committer | Glenn Watson <gw@intuitionlibrary.com> | 2015-01-23 06:09:25 +1000 |
commit | 0f525d908da229218c88a30cdaa837d492f802be (patch) | |
tree | 1f7717044738f400542521b942156799e576f43a /python/servo/build_commands.py | |
parent | 59bca2962c19f653eec835fc54caf1a3eadcb906 (diff) | |
download | servo-0f525d908da229218c88a30cdaa837d492f802be.tar.gz servo-0f525d908da229218c88a30cdaa837d492f802be.zip |
Change glutin headless mode to be a build config, as it breaks some Linux distros linking to both.
The majority of this change is simply re-arranging the code in the glutin port
so that the windowed/headless code is configured at build time rather
than runtime. There shouldn't be any functional difference as a result of this change.
Diffstat (limited to 'python/servo/build_commands.py')
-rw-r--r-- | python/servo/build_commands.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index 78d9fb51318..c4f6edc62b8 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -1,5 +1,6 @@ from __future__ import print_function, unicode_literals +import os import os.path as path import subprocess from time import time @@ -12,6 +13,8 @@ from mach.decorators import ( from servo.command_base import CommandBase, cd +def is_headless_build(): + return int(os.getenv('SERVO_HEADLESS', 0)) == 1 @CommandProvider class MachCommands(CommandBase): @@ -69,6 +72,10 @@ class MachCommands(CommandBase): if debug_mozjs or self.config["build"]["debug-mozjs"]: features += ["script/debugmozjs"] + if is_headless_build(): + opts += ["--no-default-features"] + features += ["glutin_app", "headless"] + if features: opts += ["--features", "%s" % ' '.join(features)] @@ -132,11 +139,11 @@ class MachCommands(CommandBase): help='Number of jobs to run in parallel') def build_tests(self, jobs=None): self.ensure_bootstrapped() - opts = [] - if jobs is not None: - opts += ["-j", jobs] + args = ["cargo", "test", "--no-run"] + if is_headless_build(): + args += ["--no-default-features", "--features", "glutin_app headless"] return subprocess.call( - ["cargo", "test", "--no-run"], + args, env=self.build_env(), cwd=self.servo_crate()) @Command('clean', |