diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 9fc797b28f9..b337ca5e9ed 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -297,6 +297,7 @@ class CommandBase(object): self.config["build"].setdefault("mode", "") self.config["build"].setdefault("debug-mozjs", False) self.config["build"].setdefault("ccache", "") + self.config["build"].setdefault("rustflags", "") self.config.setdefault("android", {}) self.config["android"].setdefault("sdk", "") @@ -486,6 +487,9 @@ class CommandBase(object): env['RUSTDOC'] = path.join(self.context.topdir, 'etc', 'rustdoc-with-private') + if self.config["build"]["rustflags"]: + env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " " + self.config["build"]["rustflags"] + # Don't run the gold linker if on Windows https://github.com/servo/servo/issues/9499 if self.config["tools"]["rustc-with-gold"] and sys.platform not in ("win32", "msys"): if subprocess.call(['which', 'ld.gold'], stdout=PIPE, stderr=PIPE) == 0: diff --git a/servobuild.example b/servobuild.example index 1b6848315ec..df0e1d7f732 100644 --- a/servobuild.example +++ b/servobuild.example @@ -38,6 +38,8 @@ android = false debug-mozjs = false # Set to the path to your ccache binary to enable caching of compiler outputs #ccache = "/usr/local/bin/ccache" +# Any optional flags that will be added to $RUSTFLAGS +#rustflags = "" # Android information [android]