[Scons-users] Ignore and Requires

William Blevins wblevins001 at gmail.com
Wed Oct 15 20:31:29 EDT 2014


I'm not sure you can achieve this the way you desire.  Your approach
fundamentally contradicts the results.  Using Requires makes the generated
CPP-file an explicit dependency.  You are manually injecting the new
CPP-file into the dependency graph.  Since the file new has a different
name, methods like checking the md5sum cannot detect the lack of changes;
thus, the library will always be linked.

Is this a situation where you can use a soft-link to trick SCons into
keeping a consistent file name?


On Wed, Oct 15, 2014 at 5:38 PM, Arvid Rosén <arvid at softube.com> wrote:

> Hi!
> I generate a .cpp file with a revision number. It is compiled and linked
> with a lot of other object files. However, I don’t want to re-link if only
> the revision number has changed.
> I thought order-only dependencies using ”Requires” function would solve
> this, but if I state that the final binary ”Requires” the revision-object,
> the binary is still always re-linked. I guess this is because the revision
> object file is in the source list of the link command, so it gets added as
> an implicit dependency. There is a ugly workaround (passing the revision
> object as a link flag) in the user guide:
> http://www.scons.org/doc/2.3.1/HTML/scons-user.html#idp2498640
> But, can I achieve the same thing by using the Ignore function followed by
> Requires? It seems to work, but I don’t know if I am guarantied that the
> files are built in the right order.
> Cheers,
> Arvid
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141015/952db19e/attachment.html>

More information about the Scons-users mailing list