summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-10-21 18:11:38 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-10-21 18:14:04 (GMT)
commit7c8329aa2efd8d89ea100772620f10b40a589406 (patch)
tree3f7600a66ebe7c47d806cc7ebbb0f90f692d86c9 /BuildTools/SCons/SConstruct
parentd46ebaac1cf7161fd0a551c34cf80f441f6d19ab (diff)
downloadswift-7c8329aa2efd8d89ea100772620f10b40a589406.zip
swift-7c8329aa2efd8d89ea100772620f10b40a589406.tar.bz2
Added ccache option to SCons.
Resolves: #650
Diffstat (limited to 'BuildTools/SCons/SConstruct')
-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 :