[Scons-users] Missing dependencies

Bill Deegan bill at baddogconsulting.com
Thu Nov 30 17:29:02 EST 2017


Spencer,

Try this:
MYLIBS = ['shared1', 'shared2']
MYLIBPATH = 'variantDir/usr/lib'
executable=Program(hello.c,LIBS=[MYLIBS], LIBPATH=[MYLIBPATH])


On Thu, Nov 30, 2017 at 1:50 PM, Spencer Yost <syost at triad.rr.com> wrote:

> Let me back up and explain so you can make sure I know what I am doing.
>
> programdir/SConscript:
> ~~~~~~~~~~~~~~~~~~~
>
> MYLIBS = ['libshared1.so', 'libshared2.so']
> MYLIBPATH = 'variantDir/usr/lib'
> executable=Program(hello.c,LIBS=[MYLIBS], LIBPATH=[MYLIBPATH])
> for eachLib in MYLIBS:
>    Depends(executable, os.path.join(MYLIBPATH,eachLib)
>
> This is stripped down obviously:  I have install functions/custom builders
> and more.  But you get the idea.  And this works in terms of
> linking/building and does accurately reflect the need to rebuild
> "executable" if MYLIB changes.
>
> But how do I get SCons to build MYLIB if it is missing?   I have an
> SConscript for MYLIB.  Your surprise that this doesn't work leads me to
> believe that my fear was correct:   I am stuck having to read all 1700+
> SConscript files in my library packages (over 2000 counting executables,
> automated unit tests, etc) when I start the building the executable.   I
> can't deal with the huge delay reading that many SConscript files just in
> case I need to build to build one shared library in the course of building
> just one executable.
>
> I was hoping something along the lines of:
>
> for eachLib in MYLIBS:
>    fullSCPath=findRightSConscript(eachLib)
>    SConscript(fullSCPath,blah,etc,so on)
>    Depends(executable, os.path.join(MYLIBPATH,eachLib)
>
>
> But that doesn't work
>
> Thanks in advance!!
>
> Spencer Yost
>
> On Nov 30, 2017, at 3:18 PM, Bill Deegan <bill at baddogconsulting.com>
> wrote:
>
> Spencer,
>
> That should happen automatically.
> Can you post an example SConstruct to show the issue you're having?
>
> -Bill
>
> On Thu, Nov 30, 2017 at 10:21 AM, Spencer Yost <syost at triad.rr.com> wrote:
>
>> I am hoping somebody has tackled this before:
>>
>> While I can obviously use the depends() function to ensure my target
>> rebuilds if the dependency changed, I would like some sort of mechanism to
>> automatically build the dependency if it is missing.
>>
>> Is there functionality in Scons for this that I am missing and or
>> misunderstanding? If not, has someone already built a little extension to
>> handle this already?
>>
>> In my specific use case, I'm looking for a shared library that has not
>> been built yet. This is a common enough use case that I would like to
>> handle it automatically if possible.
>>
>>
>> Spencer Yost
>>
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
> _______________________________________________
> 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/20171130/3f02cc43/attachment.html>


More information about the Scons-users mailing list