From a82be9ffb42ec2656f1b7b3be8e101b7ddffa889 Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Wed, 16 Nov 2016 11:06:00 -0500 Subject: [PATCH] Support build.rustflags in .servobuild --- python/servo/command_base.py | 4 ++++ servobuild.example | 2 ++ 2 files changed, 6 insertions(+) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 1a236bdf1fa..baae72c6d69 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -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: 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]