Mesa (mesa_7_7_branch): scons: Control caching via new SCONS_CACHE_DIR environment variable.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Mon Feb 22 11:29:17 UTC 2010
Module: Mesa
Branch: mesa_7_7_branch
Commit: c98eced9aebf4a3661e5141af4a711e95d7cc602
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c98eced9aebf4a3661e5141af4a711e95d7cc602
Author: José Fonseca <jfonseca at vmware.com>
Date: Sun Feb 14 15:34:39 2010 +0000
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 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/scons/gallium.py b/scons/gallium.py
index 633b86b..d3bd419 100644
--- a/scons/gallium.py
+++ b/scons/gallium.py
@@ -235,7 +235,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'])
# Parallel build
if env.GetOption('num_jobs') <= 1:
More information about the mesa-commit
mailing list