Auto merge of #14251 - vvuk:servobuild-rustflags, r=ConnorGBrewster

Support build.rustflags in .servobuild

Add ability to specify rustflags in .servobuild.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14251)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-12-13 16:55:12 -08:00 committed by GitHub
commit 75c869d508
2 changed files with 6 additions and 0 deletions

View file

@ -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:

View file

@ -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]