summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-12-31 10:36:57 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-12-31 10:36:57 (GMT)
commitee8e6018640754bfca99605e9752c9053777f43a (patch)
treefe7d0c5960b9fa65e13ecf1cae9b3c96caa8098e /BuildTools
parent69d5515110bba3803ef37dd470d690b7b8aac9ae (diff)
downloadswift-ee8e6018640754bfca99605e9752c9053777f43a.zip
swift-ee8e6018640754bfca99605e9752c9053777f43a.tar.bz2
Add scan-build support.
Change-Id: Ife69d84147946b41875792cb90189542c3130bc3
Diffstat (limited to 'BuildTools')
-rw-r--r--BuildTools/SCons/SConscript.boot8
1 files changed, 8 insertions, 0 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index d218d9a..2ca5281 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -118,6 +118,14 @@ if env["PLATFORM"] == "darwin" :
if platform.machine() == "x86_64" :
env.Append(LINKFLAGS = ["-arch", "x86_64"])
+# Check whether we are running inside scan-build, and override compiler if so
+if "CCC_ANALYZER_HTML" in os.environ :
+ for key, value in os.environ.items() :
+ if key.startswith("CCC_") or key.startswith("CLANG") :
+ env["ENV"][key] = value
+ env["CC"] = os.environ["CC"]
+ env["CXX"] = os.environ["CXX"]
+
# Override the compiler with custom variables set at config time
if "cc" in env :
env["CC"] = env["cc"]