[Scons-users] Build obj only if not everything is up to date
Gary Oberbrunner
garyo at oberbrunner.com
Tue Jul 8 11:15:30 EDT 2014
The Requires() method is probably what you're looking for:
http://www.scons.org/doc/HTML/scons-user/ch06s08.html. The example in
there is pretty similar to your scenario, Roman.
On Tue, Jul 8, 2014 at 10:53 AM, William Roberts <bill.c.roberts at gmail.com>
wrote:
> 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
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
>
--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140708/cfc448ca/attachment.html>
More information about the Scons-users
mailing list