summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct49
1 files changed, 28 insertions, 21 deletions
diff --git a/SConstruct b/SConstruct
index 48a56dae3ab..188927e702a 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1174,27 +1174,6 @@ if has_option("cache"):
env.FatalError("Mixing --cache and --gcov doesn't work correctly yet. See SERVER-11084")
env.CacheDir(str(env.Dir(cacheDir)))
- if get_option("cache") == "nolinked":
- def noCacheEmitter(target, source, env):
- for t in target:
- env.NoCache(t)
- return target, source
-
- def addNoCacheEmitter(builder):
- origEmitter = builder.emitter
- if SCons.Util.is_Dict(origEmitter):
- for k,v in origEmitter:
- origEmitter[k] = SCons.Builder.ListEmitter([v, noCacheEmitter])
- elif SCons.Util.is_List(origEmitter):
- emitter.append(noCacheEmitter)
- else:
- builder.emitter = SCons.Builder.ListEmitter([origEmitter, noCacheEmitter])
-
- addNoCacheEmitter(env['BUILDERS']['Program'])
- addNoCacheEmitter(env['BUILDERS']['StaticLibrary'])
- addNoCacheEmitter(env['BUILDERS']['SharedLibrary'])
- addNoCacheEmitter(env['BUILDERS']['LoadableModule'])
-
# Normalize the link model. If it is auto, then for now both developer and release builds
# use the "static" mode. Somday later, we probably want to make the developer build default
# dynamic, but that will require the hygienic builds project.
@@ -3310,6 +3289,34 @@ try:
except NotImplementedError:
pass
+# Keep this late in the game so that we can investigate attributes set by all the tools that have run.
+if has_option("cache"):
+ if get_option("cache") == "nolinked":
+ def noCacheEmitter(target, source, env):
+ for t in target:
+ try:
+ if getattr(t.attributes, 'thin_archive', False):
+ continue
+ except(AttributeError):
+ pass
+ env.NoCache(t)
+ return target, source
+
+ def addNoCacheEmitter(builder):
+ origEmitter = builder.emitter
+ if SCons.Util.is_Dict(origEmitter):
+ for k,v in origEmitter:
+ origEmitter[k] = SCons.Builder.ListEmitter([v, noCacheEmitter])
+ elif SCons.Util.is_List(origEmitter):
+ origEmitter.append(noCacheEmitter)
+ else:
+ builder.emitter = SCons.Builder.ListEmitter([origEmitter, noCacheEmitter])
+
+ addNoCacheEmitter(env['BUILDERS']['Program'])
+ addNoCacheEmitter(env['BUILDERS']['StaticLibrary'])
+ addNoCacheEmitter(env['BUILDERS']['SharedLibrary'])
+ addNoCacheEmitter(env['BUILDERS']['LoadableModule'])
+
env.SConscript(
dirs=[
'src',