Support build.rustflags in .servobuild

This commit is contained in:
Vladimir Vukicevic 2016-11-16 11:06:00 -05:00
parent eb531c15d9
commit a82be9ffb4
2 changed files with 6 additions and 0 deletions

View file

@ -276,6 +276,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", "")
@ -467,6 +468,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]