[Scons-users] Writing a command that always succeeds

Stefan Seefeld stefan at seefeld.name
Wed Jun 15 11:46:18 EDT 2016


Hi again,

let me follow up on my own mail...

On 15.06.2016 06:59, Stefan Seefeld wrote:
> Hi Jason,
>
> thanks for your detailed reply. I'm presently stuck with a much simpler
> problem:
>
> I have this code:
>
>     def my_command(target, source, env=env):
>         print(env['TARGET']) # fails !!
>
>     env.Command(target, sources, my_command)

the missing bit is the definition of the 'TARGET', 'SOURCE' etc.
variables that are required for env.subst() to work. I'm still not sure
where this is done inside SCons, and what the supposed way is to hook
this up with the execution of custom python functions.

However, what appears to work fine is to call

    env.subst('$TARGET', target=<the-target>)

The documentation at
http://scons.org/doc/production/HTML/scons-user/ch07s02.html#idp1400500516
is missing this important point.



Thanks,
        Stefan


-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the Scons-users mailing list