[Scons-users] include dir with scons variant_dir handling

Hua Yanghao huayanghao at gmail.com
Thu Jul 12 10:44:30 EDT 2018


After digging into a bit more, it looks like C builders will scan for
included dependencies (not sure how this is done reliably and how deep
include case are handled), and only those used header files are copied
to build folder. And from --tree=all it clearly shows scons knows
these files being used and a dependency is in place.

Seems if I want this to happen for HDL files I then need to either
write a scanner, or simply makes each and every hdl files depends on
the entire include files if I want the include files to be copied
properly. I will give this a try but not sure if this is the best way
to do it. Otherwise writing a scanner I don't understand how to make
it reliable without using a real HDL compiler.
On Thu, Jul 12, 2018 at 4:22 PM Hua Yanghao <huayanghao at gmail.com> wrote:
>
> This works as to expand CPPPATH into a list of path however this is
> not taking care of copying include files into build directory.
>
> any idea?
> On Thu, Jul 12, 2018 at 4:05 PM Hua Yanghao <huayanghao at gmail.com> wrote:
> >
> > This is the magic? '_CPPINCFLAGS'  : '$( ${_concat(INCPREFIX, CPPPATH,
> > INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)'
> >
> > So I guess I need to generate and use this _CPPINCFLAGS in my builder
> > and define my own INCPREFIX/SUFFIX and it should do? Will give it a
> > try quickly.
> > On Thu, Jul 12, 2018 at 4:00 PM Hua Yanghao <huayanghao at gmail.com> wrote:
> > >
> > > Hi Bill,
> > > Yes, I am using SConscript("path/to/SConscript", variant_dir="build"),
> > > and apparently the CPPPATH is only taken care in my C code build, not
> > > for my HDL builds.
> > > And I even want something like "INCPATH" instead of "CPPPATH", and
> > > generates not "-Ipath/to/my/include" but also other formats e.g.
> > > "+incdir+path/to/my/include".
> > >
> > > Any idea?
> > >
> > > Best Regards,
> > > Yanghao
> > > On Thu, Jul 12, 2018 at 2:31 PM Bill Deegan <bill at baddogconsulting.com> wrote:
> > > >
> > > > so you're using SConscript('src/SConscript',variant_dir='build') for example?
> > > > You shouldn't need to do anything to make this work with any builder.
> > > >
> > > > -Bill
> > > >
> > > > On Thu, Jul 12, 2018 at 4:06 AM, Hua Yanghao <huayanghao at gmail.com> wrote:
> > > >>
> > > >> Dear Scons Users and Developers,
> > > >> I am using scons variant_dir so all builds (including a replica of the
> > > >> original file, e.g. duplicate=1 by default) output in a separate
> > > >> folder.
> > > >>
> > > >> This works out of box for C include files, which also have a nice
> > > >> duplicate in the output directory (I am not using scanners so I guess
> > > >> all C include files are duplicated). However now I am enabling new
> > > >> customized builders, which also have a similar concept of include path
> > > >> and include files, how can I achieve the same as for C code
> > > >> compilation, e.g. to have include path and its files dupliated in the
> > > >> output folder?
> > > >>
> > > >> Thanks for any tips before I dive into the source code.
> > > >>
> > > >> Best Regards,
> > > >> Yanghao Hua
> > > >> _______________________________________________
> > > >> 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


More information about the Scons-users mailing list