[Scons-users] Build obj only if not everything is up to date

William Roberts bill.c.roberts at gmail.com
Tue Jul 8 10:53:24 EDT 2014


So is the scenario that you make a change to x.c and version.c doesn't have
a dependency on x thus never gets rebuilt?

If so, you could try making version.c an explicit dependency on everything.
Look at the function Depends().

Something like:
env.Depends(version.c, [all files])
(Drop env if you don't explicitly use it)
On Jul 8, 2014 2:45 AM, "Roman Karlstetter" <Roman.Karlstetter at ifta.com>
wrote:

> Hi,
>
> I have the following problem:
>
> I have a version.cpp file which makes use of __DATE__ and __TIME__ macros
> to indicate when the build was performed. I can use the AlwaysBuild
> functionality of scons to always build the respective object. However, this
> has the (expected) implication that the final binary always gets rebuilt,
> because version.obj always has changed.
>
> It would be better for us to only rebuild the "version.obj" if there are
> changes to other dependencies that force a rebuild of the binary (or to
> version.cpp, of course), such that when nothing in the directory has
> changed, nothing is rebuilt. Is something like that possible at all with
> scons?
>
> Thanks in advance and kind regards,
> Roman
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140708/d97b06cd/attachment.html>


More information about the Scons-users mailing list