[Scons-users] VariantDir not working

Dirk Bächle tshortik at gmx.de
Sat Jun 28 14:56:43 EDT 2014


Ronex,

On 28.06.2014 19:53, Ronex Dicapriyo wrote:
> Hi,
>
> Please look below for the SConstruct and SConscript implementation:
>
thanks for the additional infos and examples.

> [...]
> Suppose module_1 depends on module_2 and module_3 libraries:
> Then in module_1/SConscript I need to bring/run first the library 
> target of module_2 and module_3:
>
> module_1/SConscript:
> SConscript(['module_2/SConscript', 'module_3/SConscript'], export='env')
> module_1_lib = env.StaticLibrary(target='module_1', source=src_files)
> env.Depend(module_1_lib, module_2_lib)
> env.Depend(module_1_lib, module_3_lib)
>
> I think above implementaton of module_1/SConscript make sure to 
> execute the
> module_2_lib and module_3_lib targets and then build library for module_1.
As Bill tried to explain to you in the other thread, this shouldn't be 
necessary. In your example above, the "module_2_lib" isn't used as input 
to the static library "module_1_lib", so why should "module1" depend on 
"module2"?

>
> Here I need build directory should be created inside all the modules 
> separately.(i.e module_1/build , module_2/build and module_2/build)
>
>
> I found the above use of VariantDir in scons 2.31. user manual 
> chapter-15, sections-4,5.
>

These sections also explain that if you use VariantDir directly, you 
have to specify your sources and targets as if you are building in your 
output directory. This is why your syntax is not correct and files are 
still created in the "src" folder. You have to use

   env.Program(target='build/hello', source=src_list)

in your SConscript, which is a little awkward to use...which is why we 
always propose the "variant_dir" approach as default method.

Regards,

Dirk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140628/a11fad3f/attachment.html>


More information about the Scons-users mailing list