jusctsch
jusctsch

Reputation: 23

How to tell scons to exclude certain files from using the build cache

Scons provides an option to make use of a build cache, which is used to reduce build times by pulling up-to-date files from that cache. The enforcement of the cache seems to be global. For example, there are commands to force caching, disable caching, display the cache, etc. There does not seem to be a method within the CacheDir to exclude certain files, as there may be files that really should be recompiled.

Given this situation, what would some reasonable solutions be?

Sources: CacheDir Source: http://www.scons.org/doc/production/HTML/scons-api/SCons.CacheDir-pysrc.html

Disabling Cache Example: http://www.scons.org/doc/1.2.0/HTML/scons-user/x4168.html

Upvotes: 2

Views: 707

Answers (2)

JamesNoonan33
JamesNoonan33

Reputation: 584

There is NoCache:

P = Program(...)
NoCache(P)

Upvotes: 2

Tom Tanner
Tom Tanner

Reputation: 9354

You are thinking about this the wrong way round. Instead of excluding an object from the cache, you tell the scons that the object that is being built doesn't go into a cache. The cache directory is set per environment, so you'll want to do something like this

noCacheEnv = env.Clone()
noCacheEnv.CacheDir(None)
noCacheEnv.Program('cantbecached.c')

Upvotes: 0

Related Questions