summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/SConscript.main15
1 files changed, 9 insertions, 6 deletions
diff --git a/build/SConscript.main b/build/SConscript.main
index 873371e..617e5b4 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -270,14 +270,17 @@ elif env['PLATFORM'] == 'posix':
# OS_LINUX defined in a weird way.
env.FilterOut(CPPDEFINES = ['OS_LINUX=OS_LINUX'])
- # Copy some environment variables from the outer environment if they exist.
- for envvar in ['CC', 'CXX']:
+ # Copy some environment variables from the outer environment to the
+ # SCons.Environment if they exist.
+ for envvar in ('CC', 'CXX'):
if envvar in os.environ:
env[envvar] = os.environ[envvar]
- # Provide $HOME when compiling so distcc can find its lock file.
- env['ENV']['HOME'] = os.environ['HOME']
- if 'DISTCC_HOSTS' in os.environ:
- env['ENV']['DISTCC_HOSTS'] = os.environ['DISTCC_HOSTS']
+ # Copy these environment variables from the outer environment to the
+ # environment that the build commands run in.
+ # $HOME is needed by distcc so it can find its lock file.
+ for envvar in ('HOME', 'DISTCC_HOSTS', 'CCACHE_DIR'):
+ if envvar in os.environ:
+ env['ENV'][envvar] = os.environ[envvar]
# TODO(evanm): this is Linux-specific, not posix.
# Parse /proc/cpuinfo for processor count.