From fe889a89d28293d8f98b2cd730efc58785ceb5d8 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sun, 14 Feb 2010 15:34:39 +0000 Subject: scons: Control caching via new SCONS_CACHE_DIR environment variable. This serves several purposes: - disable caching in situations were is it useless or undesired - share caches among all trees - simplify purging the cache (when it's a single location) - move the cache out of the tree, since that slows downs IDEs considerably To retain previous behavior just define do export SCONS_CACHE_DIR=$PWD/build/cache before invoking scons. --- scons/gallium.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scons') diff --git a/scons/gallium.py b/scons/gallium.py index 1d5e041c77..925effc25d 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -155,7 +155,9 @@ def generate(env): # different scons versions building the same source file env['build'] = build_dir env.SConsignFile(os.path.join(build_dir, '.sconsign')) - env.CacheDir('build/cache') + if 'SCONS_CACHE_DIR' in os.environ: + print 'scons: Using build cache in %s.' % (os.environ['SCONS_CACHE_DIR'],) + env.CacheDir(os.environ['SCONS_CACHE_DIR']) env['CONFIGUREDIR'] = os.path.join(build_dir, 'conf') env['CONFIGURELOG'] = os.path.join(os.path.abspath(build_dir), 'config.log') -- cgit v1.2.3