[Scons-users] use of abspath

Bill Deegan bill at baddogconsulting.com
Fri Aug 11 15:50:35 EDT 2017


if 'caconnectivitymanager.c' is in foo/bar/src, then if you change to:

    ca_common_src = [File(f) for f in [
        'caconnectivitymanager.c',
        'cainterfacecontroller.c',
        'camessagehandler.c',
        'canetworkconfigurator.c',
        'caprotocolmessage.c',
        'caqueueingthread.c',
        'caretransmission.c',
    ]]

You can probably skip all the rest of the file path munging.
File will assume the path specified is relative to current SConscript (Or
SConstruct if that's where it's invoked)

-Bill

On Fri, Aug 11, 2017 at 11:34 AM, Mats Wichmann <mats at wichmann.us> wrote:

> On 08/11/2017 12:01 PM, Bill Deegan wrote:
> > is FOO_SRC going to end up in a list of sources for a builder?
>
> yes.
>
> > If so,
> >
> > src_files = [ File(s) for s in list_of_local_src_files]  # where entries
> in
> > list are like 'blah.c'
> > Should suffice.
>
> well, the first step is sort of like that, so in foo/bar/src we may see
>
>     ca_common_src = [
>         'caconnectivitymanager.c',
>         'cainterfacecontroller.c',
>         'camessagehandler.c',
>         'canetworkconfigurator.c',
>         'caprotocolmessage.c',
>         'caqueueingthread.c',
>         'caretransmission.c',
>     ]
>
>     connectivity_env.AppendUnique(CA_SRC=ca_common_src)
>
> but then based on options, that script may go on and invoke a script a
> further level down, which does the dance I mentioned.  I know it's
> trying to stuff the subdir name in with those files - because the
> builder is eventually invoked at the higher level - without hardcoding it.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170811/301b334e/attachment-0001.html>


More information about the Scons-users mailing list