summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2022-03-25 14:01:49 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-28 22:46:38 +0000
commitfcf8de14cb92fb4ff5874308104ca942ea11b655 (patch)
tree1d7c7f05df62edc82e0fdddcad81974fa31b8bc0 /site_scons
parent18eb70e70613854d240b3c0f6e5fa52de01fe141 (diff)
downloadmongo-fcf8de14cb92fb4ff5874308104ca942ea11b655.tar.gz
SERVER-62313 Disable ccache cpp2 when sanitizer denylists are in play
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/ccache.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/site_scons/site_tools/ccache.py b/site_scons/site_tools/ccache.py
index de7d03e5472..2a4b89015d5 100644
--- a/site_scons/site_tools/ccache.py
+++ b/site_scons/site_tools/ccache.py
@@ -112,11 +112,15 @@ def generate(env):
# hash can be calculated on them. This both reduces the amount of work ccache needs to
# do and increases the likelihood of a cache hit.
if env.ToolchainIs("clang"):
- env["ENV"].pop("CCACHE_CPP2", None)
- env["ENV"]["CCACHE_NOCPP2"] = "1"
- env.AppendUnique(CCFLAGS=["-frewrite-includes"])
+ if not env.get('CCACHE_EXTRAFILES_USE_SOURCE_PATHS', False):
+ env["ENV"].pop("CCACHE_CPP2", None)
+ env["ENV"]["CCACHE_NOCPP2"] = "1"
+ env.AppendUnique(CCFLAGS=["-frewrite-includes"])
+ else:
+ env["ENV"].pop("CCACHE_NOCPP2", None)
+ env["ENV"]["CCACHE_CPP2"] = "1"
elif env.ToolchainIs("gcc"):
- if icecream_enabled:
+ if icecream_enabled and not env.get('CCACHE_EXTRAFILES_USE_SOURCE_PATHS', False):
# Newer versions of Icecream will drop -fdirectives-only from
# preprocessor and compiler flags if it does not find a remote
# build host to build on. ccache, on the other hand, will not