[Scons-users] VariantDir not working

Ronex Dicapriyo ronex_89 at yahoo.in
Sat Jun 28 23:09:39 EDT 2014


Hello,

Thanks for reply.




On Sunday, 29 June 2014 12:26 AM, Dirk Bächle <tshortik at gmx.de> wrote:
 
[...]

 
>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.
Sorry, I am too abstract in terms of explaining details. Here I am using this dependencies because when I build module_2_lib and module_3_lib it copies some headers and other things into common directory, from the common directory location module_1_lib uses them. FOr that I have defined CPPPATH accordingly :

module_1_lib =
            env.StaticLibrary(target='module_1', source=src_files, CPPPATH=<inc_list>)

So, I need them to be built before, because libraries created for modle_2 and module_3 also gets copied into common location, and further in the script module_1_lib, module_2_lib and module_3_lib gets used to build ".so" with some addition object(".o") files.

I am working on a project, which doesn't allow me to share details for that I am using smal segment of examples in the mail closely related yo the stuffs that I am using in a large source list.

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.
>
Using target as 'build/hello' it generated executable in build but objects are still generated into src directory ?

Do I need to create objects separately and then used them into Program builder ?

src_list = Glob(os.path.join('src', '*.cpp')
# Now I need to replace '.cpp' into .o, to create target list, how can I do that ?
obj_list = [os.path.splitext(file) for file in src_list]

This doesn't work, any idea how to do this ?


Regards,
Ronex___________________________________________
Scons-users mailing list
Scons-users at scons.org
http://four.pairlist.net/mailman/listinfo/scons-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140629/3e5967d3/attachment-0003.html>


More information about the Scons-users mailing list