aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/command_base.py
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-06-15 13:08:14 -0600
committerbors-servo <metajack+bors@gmail.com>2015-06-15 13:08:14 -0600
commitd6263c9b6e969fde4c644034e684a39d68667ad9 (patch)
tree29a6dc1dc0a1a1e6e9d77ae0d447418b2c777df6 /python/servo/command_base.py
parentbb39e835f16cf53a8135f873ed6e979640c0a8ba (diff)
parenta0237085c6894cc781bc99469a735206e1e6b127 (diff)
downloadservo-d6263c9b6e969fde4c644034e684a39d68667ad9.tar.gz
servo-d6263c9b6e969fde4c644034e684a39d68667ad9.zip
Auto merge of #6306 - metajack:shared-target-dir, r=mbrubeck
This speeds up `./mach build --dev` followed by `./mach build-cef` by 25%. When rust-lang/cargo#497 is fixed, this speedup will increase dramatically. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6306) <!-- Reviewable:end -->
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r--python/servo/command_base.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 5369b3e47f9..c6d46fc3de8 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -130,8 +130,14 @@ class CommandBase(object):
self._cargo_build_id = open(filename).read().strip()
return self._cargo_build_id
+ def get_target_dir(self):
+ if "CARGO_TARGET_DIR" in os.environ:
+ return os.environ["CARGO_TARGET_DIR"]
+ else:
+ return path.join(self.context.topdir, "target")
+
def get_binary_path(self, release, dev):
- base_path = path.join("components", "servo", "target")
+ base_path = self.get_target_dir()
release_path = path.join(base_path, "release", "servo")
dev_path = path.join(base_path, "debug", "servo")
@@ -199,6 +205,9 @@ class CommandBase(object):
if "CARGO_HOME" not in env:
env["CARGO_HOME"] = self.config["tools"]["cargo-home-dir"]
+ if "CARGO_TARGET_DIR" not in env:
+ env["CARGO_TARGET_DIR"] = path.join(self.context.topdir, "target")
+
if extra_lib:
if sys.platform == "darwin":
env["DYLD_LIBRARY_PATH"] = "%s%s%s" % \