Add CCACHE infra and turn it on in travis

This commit is contained in:
Lars Bergstrom 2015-11-05 14:47:23 -06:00
parent 17a6cb5873
commit 5c5acc0249
4 changed files with 11 additions and 0 deletions

View file

@ -1,5 +1,8 @@
language: python language: python
env:
- CCACHE=/usr/bin/ccache
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
@ -13,6 +16,7 @@ matrix:
directories: directories:
- .cargo - .cargo
- .servo - .servo
- $HOME/.ccache
addons: addons:
apt: apt:
packages: packages:
@ -22,6 +26,7 @@ matrix:
- libosmesa6-dev - libosmesa6-dev
- python-virtualenv - python-virtualenv
- xorg-dev - xorg-dev
- ccache
branches: branches:
only: only:

View file

@ -232,6 +232,9 @@ class MachCommands(CommandBase):
env['OPENSSL_INCLUDE_DIR'] = path.join(openssl_dir, "include") env['OPENSSL_INCLUDE_DIR'] = path.join(openssl_dir, "include")
env['OPENSSL_STATIC'] = 'TRUE' env['OPENSSL_STATIC'] = 'TRUE'
if not (self.config["build"]["ccache"] == ""):
env['CCACHE'] = self.config["build"]["ccache"]
status = call( status = call(
["cargo", "build"] + opts, ["cargo", "build"] + opts,
env=env, cwd=self.servo_crate(), verbose=verbose) env=env, cwd=self.servo_crate(), verbose=verbose)

View file

@ -107,6 +107,7 @@ class CommandBase(object):
self.config["build"].setdefault("android", False) self.config["build"].setdefault("android", False)
self.config["build"].setdefault("mode", "") self.config["build"].setdefault("mode", "")
self.config["build"].setdefault("debug-mozjs", False) self.config["build"].setdefault("debug-mozjs", False)
self.config["build"].setdefault("ccache", "")
self.config.setdefault("android", {}) self.config.setdefault("android", {})
self.config["android"].setdefault("sdk", "") self.config["android"].setdefault("sdk", "")

View file

@ -36,6 +36,8 @@ rustc-with-gold = true
android = false android = false
# Set "debug-mozjs" or use `mach build --debug-mozjs` to build a debug spidermonkey. # Set "debug-mozjs" or use `mach build --debug-mozjs` to build a debug spidermonkey.
debug-mozjs = false debug-mozjs = false
# Set to the path to your ccache binary to enable caching of compiler outputs
#ccache = "/usr/local/bin/ccache"
# Android information # Android information
[android] [android]