[Scons-users] Depends(...) function some questions and hello!

Bill Deegan bill at baddogconsulting.com
Tue May 31 11:51:23 EDT 2016


On Tue, May 31, 2016 at 12:48 AM, pholat <pholat at gmail.com> wrote:

> Hi All,
>
> I'm pholat and recently rewrote half of our Build system to SCons (
> compilation part) and would love to share few notices and ask some
> questions.
>
> 1) Depends(..) from empty object
>
> http://stackoverflow.com/questions/37477440/scons-dependencies-in-sconstruct?noredirect=1#comment62560274_37477440
> When user adds depends manually there is no warning or error on empty
> dependency. I find it misleading.
> pseudo code example
>
> SConcritpt:
> a = SConstruct(<SConstruct1 path>)
> b = SConstruct(<SConstruct2 path>)
> Depends(a,b) # SConstruct1 doesn't return a thing, no warning/error here
>
> SConstruct1:
> #empty
>
> SConstruct2:
> env = Environment(...)
> wal = env.Program(...)
> Return('wal')
>
> end of example
>
> As in buildsystem I edited&developed I had at least 20 SConscripts where
> dependencies are added in for loop. I'm still a bit confused:
> When install path from SConscript1 will be added to LIBPATH in SConscript2
> will dependencies be solved right? Even so, what with custom actions in
> functions which are executed with Builder(..) ( like from the example:
> http://scons.org/doc/0.97/HTML/scons-user/x2435.html ) Where parts of
> libraries are removed, where object name stays the same, only smaller.
>
>
As I stated in the stackoverflow posting, you shouldn't need to use
explicit Depends() for programs to depend on libraries.
All you need to do is set the LIBPATH to point to the diretory(ies) where
the librarie(s) are located (or installed to), and LIBS to the list of
libraries you want. (Note that you can have the library name as XYZ when
the library file name is libXYZ.a and scons will do the correct thing for
each platform)

If that's not working correcty you can use scons --tree=prune to see the
dependencies that SCons is detecting.

Using Depend() is usually a sign that:
a) you have a builder and lack an emitter to specify what the output files
are when it generates files other than the named TARGET
b) you have a dependency not being picked up by a scanner. Once again if
this is from your custom builder, you may want to write a scanner to read
whatever the source file(s) are and find the dependencies (think scanning C
file for #include's)

-Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160531/16e9e9c3/attachment-0001.html>


More information about the Scons-users mailing list