[Scons-users] how to use parhs properly

daggs daggs at gmx.com
Mon Jul 4 13:55:09 EDT 2022


Greetings MAts,

> Sent: Sunday, July 03, 2022 at 7:14 PM
> From: "Mats Wichmann" <mats at wichmann.us>
> To: "SCons users mailing list" <scons-users at scons.org>, "daggs" <daggs at gmx.com>
> Subject: Re: [Scons-users] how to use parhs properly
>
> On 7/3/22 03:05, daggs wrote:
> > Greetings,
> >
> > the project I'm working is using scons and looks like this tree-wise:
> >
> > root
> >    src
> >      a
> >      b
> >      c
> >      h
> >    tools
> >      d
> >
> > modules a to c are compiled directly using scons (the other are shell cmds or just code folders).
> > I think I understand how the structure works, e.g.
> > $O/$mode/a/..., $O/$mode/b/..., $O/$mode/c/... for objects and $T/$mode/a/..., $T/$mode/b/..., $T/$mode/c/... for targets
> > as I'm working with variantdir.
> >
> > thing is, I'm not sure how to address the paths, relative to root or absolute.
> > whenever I use absolute and post here questions, I get a remark that I should use relative.
> > but if I need to include root/src/h in both a and b modules, I must use absolute path or else scons will generate invalid include path.
> >
> > so, what is the proper way to work?
>
> Could you elaborate? Seem to be a few details missing.
>
> Adding the path #root/src/h to CPPPATH should work fine.  unless...
>
> unless you're using VariantDir() directly.  The reason using VariantDir
> directly is, ummm, "unfortunate" is that the paths to things in the
> variant in this circumstance are visible. It you instead use an
> SConscript() call to set the variant directory, you don't have this
> problem, as now the remapping happens "behind the scenes".
>

my invocation is SConscript(folder + '/SConscript', variant_dir = mode + "/" + folder, duplicate = 0, exports = 'src_env mode')
it is issued from the SConscript file under src

my CPPPATH is as follows:
CPPPATH = [ os.getcwd(), os.getcwd() + "/hdr", os.getcwd() + "/3rdparty", os.getcwd() + "/3rdparty/include" ]

Dagg


More information about the Scons-users mailing list