summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/SCons/SConstruct8
1 files changed, 8 insertions, 0 deletions
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index a43d2c5..4723755 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -11,6 +11,7 @@ vars.Add('cc', "C compiler")
vars.Add('cxx', "C++ compiler")
vars.Add('ccflags', "Extra C(++) compiler flags")
vars.Add('linkflags', "Extra linker flags")
+vars.Add(BoolVariable("ccache", "Use CCache", "no"))
vars.Add(BoolVariable("distcc", "Use DistCC", "no"))
vars.Add('distcc_hosts', "DistCC hosts (overrides DISTCC_HOSTS)")
vars.Add(EnumVariable("test", "Compile and run tests", "none", ["none", "all", "unit", "system"]))
@@ -86,6 +87,13 @@ if env.get("distcc", False) :
env["ENV"]["DISTCC_HOSTS"] = env["distcc_hosts"]
env["CC"] = "distcc gcc"
env["CXX"] = "distcc g++"
+if env.get("ccache", False) :
+ env["ENV"]["HOME"] = os.environ["HOME"]
+ for var in os.environ :
+ if var.startswith("CCACHE_") :
+ env["ENV"][var] = os.environ[var]
+ env["CC"] = "ccache gcc"
+ env["CXX"] = "ccache g++"
if "cc" in env :
env["CC"] = env["cc"]
if "cxx" in env :