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

Subrata Dasgupta subrata_usha at rediffmail.com
Thu Aug 1 15:04:39 EDT 2024


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240801/7c693da2/attachment.htm>


More information about the Scons-users mailing list