Re: how to use parhs properly

daggs <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <trinity-12728eb1-43d3-4ec3-b47f-f08a1099eadd-1656957309477@3c-app-mailcom-bs02>
Greetings MAts,

> Sent: Sunday, July 03, 2022 at 7:14 PM
> From: "Mats Wichmann" <[email protected]>
> To: "SCons users mailing list" <[email protected]>, "daggs" <[email protected]>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.