[Scons-users] VariantDir not working

Bill Deegan bill at baddogconsulting.com
Mon Jun 30 18:37:23 EDT 2014


Ronex,

If you are trying to force order on SCons.. YOU ARE DOING IT WRONG.

If you are specifying SCons logic to copy headers into an area in one
module that another module will need. SCons will figure that out and do
things in the appropriate order.
Given the appropriate env.Install(header_dir, headerfilesfrom module 1) and
the appropriate CPPPATH including header_dir, the source scanner will
figure out that the header files which will or may already be in header_dir
get there by your env.Install() call and do that first before trying to
compile source files which depend on it.

-Bill


On Sun, Jun 29, 2014 at 2:49 AM, Dirk Bächle <tshortik at gmx.de> wrote:

>  Ronex,
>
>
> On 29.06.2014 05:09, Ronex Dicapriyo wrote:
>
>
>    On Sunday, 29 June 2014 12:26 AM, Dirk Bächle <tshortik at gmx.de>
> <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 kind of understand what you're trying to do here. Your project
> seems to be big enough to bring a lot of junk with it...and whose project
> doesn't ;) .
>
>     [...]
>
> 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')
>
>
> No, just apply the same basic pattern for the executable to the
> source/object files, and use:
>
>   scr_list = Glob(os.path.join('build','*.cpp'))
>
>
> instead.
>
> Regards,
>
> Dirk
>
>
> _______________________________________________
> 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/20140630/ec3cb0b4/attachment.html>


More information about the Scons-users mailing list