[Scons-users] How to put varient dir totally out side of the Source tree

Bill Deegan bill at baddogconsulting.com
Thu Aug 1 16:07:26 EDT 2024


Subrata,

ls -l BUILD_TEST
ls -l BUILD_TEST/*

scons --tree=prune BUILD_TEST

What output does that yield?

I don't see a directory "build" in your SConstruct blurb..

On Thu, Aug 1, 2024 at 12:04 PM Subrata Dasgupta via Scons-users <
scons-users at scons.org> wrote:

> Hi Mats,
> First of all thanks for the suggestion.
>
> My source code have multiple levels.I kept multiple SConstruct files
> within various source tree and internally calling them as required. This
> worked so far fine, SCons was able to understand the source dependency and
> fire compilation in correct order when building within the source tree.
>
> Then I tried to build using variant_dir to separate build output and
> source. Then lots of issues are coming. For an example some times it give
> following error.
>
> scons: *** 'build' already has a source directory: 'Lib1'
>
> Above error goes away if I call SConscript like below from the top
> SConstruct file. Other SConstruct files within sub folders do not contain
> variant_dir argument.
>
> env.SConscript('Lib1/SConstruct', variant_dir='BUILD_TEST/Lib1')
> env.SConscript('Prog/SConstruct', variant_dir='BUILD_TEST/Prog')
>
> But with the above changes now scons will only try to build the Prog not
> the Lib1.
>
> Please suggest how to resolve the issue.
>
> Thanks
> Subrata
>
>
>
> From: Mats Wichmann <mats at wichmann.us>
> Sent: Thu, 01 Aug 2024 02:02:52
> To: scons-users at scons.org
> Subject: Re: [Scons-users] How to put varient dir totally out side of the
> Source tree
>
> On 7/31/24 13:12, Subrata Dasgupta via Scons-users wrote:
> > Hi All,
> > I am new to Scons. I am currently trying to build a project using Scons.
> > Build within source tree is working for me. I kept multiple SConstruct
> > files within various source tree and internally calling them as required.
> >
> > But I am not sure how to separate the build output and source using
> > VariantDir call when variant_dir is totally out side of the source tree.
> >
> > Please suggest how to achieve this. A small example will be very helpful.
>
> This has to do with target selection. SCons does not by default select
> targets outside the tree, so if you put the variantdir outside, then
> nothing in the variantdir will be built by default - you have to tell
> it.  To see if this is your problem, try a build like this:
>
> scons /
>
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240801/edcef199/attachment.htm>


More information about the Scons-users mailing list