[Scons-users] Can SCons be called from a wrapper script?

Pierre-Luc Boily pierreluc.boily at gmail.com
Fri Mar 15 13:09:46 EDT 2019


I think it would be easier to just invoke scons with aliases.

In the Sconscript, your actions should return target(s).  Use those targets
with Alias scons function:

tgt = env.Command(someAction)
env.Alias("doThisOnly", tgt)

When invoking scons :
scons doThisOnly

et voilà!


<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Garanti
sans virus. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Le ven. 15 mars 2019, à 12 h 47, Don Baldwin <donb at qti.qualcomm.com> a
écrit :

> Hi,
>
>
>
> I have a use case where I’d like to be able to use SCons to process some
> actions as part of a larger Python script.  I’d like to be able to import
> scons, pass it an SConstruct file as a string, and then have it return to
> me once the build is done.  I see examples where you can import
> SCons.Script and call SCons.Script.main(), but:
>
>
>
>    1. SCons.Script.main() doesn’t take any parameters, so it seems like I
>    might have to write my script to a file first before calling this function.
>    2. SCons.Script.main() calls sys.exit() at the end, which would end my
>    wrapper script as well.
>
>
>
> Is there another way to do what I’m trying to do, and if not, would it be
> possible to add this support in future versions?
>
>
>
> Thanks,
>
> Don
> _______________________________________________
> 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/20190315/2ab7406a/attachment.html>


More information about the Scons-users mailing list