[Scons-dev] tracking command line argument changes in a custom tool ?

Dirk Bächle tshortik at gmx.de
Fri Apr 11 17:06:48 EDT 2014


Hi Ram,

On 11.04.2014 21:06, Ram Bhamidipaty wrote:

>

> How do I track build variable changes in a tool ?

>

> In my case I have a tool that I invoke like this:

>

> env.MyTool("file.o" ["file.c"], V1=1, V2=2, ...)

>

> The tool is a bit complicated - I use Builder() objects to construct a

> file that contains the command line arguments for the compiler and

> then I use another Builder() to run the compiler. This is modeled on

> the tools for fools wiki page.

>

> The problem I am seeing is that if I change the variables used to

> invoke MyTool() scons does not rebuild the file.

>

> Question: In a tool - how does one track variable changes that would

> require the output file to be regenerated?

>


you shouldn't have to do anything special, if the dependencies are setup
correctly. Did you make sure that your "file.o" depends on the
intermediate file with the compiler command(s)?

You are right that your Builder is somewhat complicated, but it probably
doesn't have to be. Did you have a look at the "command generator"
feature yet? You can find it in the UserGuide, sect. 18.5 "Builders That
Create Actions Using a Generator".

Best regards,

Dirk




More information about the Scons-dev mailing list