[Scons-users] Using intermediate build targets inside env.Command()
Michel Lestrade
michel.lestrade at crosslight.com
Fri Nov 30 17:39:02 EST 2012
I found the solution; previous comment definitely put me on the right track:
dummysizes = env.Program(target='dummysizes',source = 'dummysizes.c')
scotch_h = env.Command('scotch.h', 'library.h', dummysizes[0].path + "
$SOURCE $TARGET")
Thanks for the help.
On 30/11/2012 2:20 PM, Michel Lestrade wrote:
> Unfortunately, this does not appear to be supported.
> dummysizes.abspath produces "AttributeError: 'NodeList' object has no
> attribute 'abspath' ". I checked the API documentation to be sure and
> there are no similarly-spelled functions that pop out in case this was
> a typo.
>
> It also seems like I was wrong and there is no path information at all
> stored in the output of env.Program(): a print of the variable only
> shows ['dummysizes.exe'] for this NodeList object.
>
> Not sure how I can execute a command from the variant directory if the
> SConscript itself is unaware of the variant directory it is operating
> under....
>
> On 30/11/2012 12:28 PM, Managan, Rob wrote:
>> There are almost certainly better ways to do this but I would guess that
>> replacing
>> "dummysizes $SOURCE $TARGET"
>> with
>> dummysizes.abspath + "$SOURCE $TARGET"
>> might work.
>>
>>
>>
>>
>> *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
>> Rob Managan email managan at llnl.gov
>> LLNL phone: 925-423-0903
>> P.O. Box 808, L-095 FAX: 925-422-3389
>> Livermore, CA 94551-0808
>>
>>
>>
>>
>>
>> On 11/30/12 12:21 PM, "Michel Lestrade" <michel.lestrade at crosslight.com>
>> wrote:
>>
>>> Hi,
>>>
>>> Can anyone explain how to use a build target inside env.Command() ?
>>>
>>> In my SConstruct:
>>> SConscript(dirs='src',variant_dir = 'static64')
>>> In my SConscript:
>>> dummysizes = env.Program(target='dummysizes',source =
>>> 'dummysizes.c')
>>> scotch_h = env.Command('scotch.h', 'library.h', "dummysizes
>>> $SOURCE
>>> $TARGET")
>>>
>>> However, the command runs as:
>>> dummysizes static64\library.h static64\scotch.h
>>> rather than:
>>> static64\dummysizes static64\library.h static64\scotch.h
>>>
>>> How do I change this behavior ? I should have the full path to my
>>> executable as the output of env.Program() but I cannot seem to use it
>>> properly.
>>> _______________________________________________
>>> 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
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> http://four.pairlist.net/mailman/listinfo/scons-users
>
More information about the Scons-users
mailing list