[Scons-users] Making SConscript dependent on another SConscript's target present in the same directory (target depency across SConscripts files)

Bill Deegan bill at baddogconsulting.com
Tue Jun 24 12:49:34 EDT 2014


Ronex,

It sounds like you are failing to grasp a very fundamental feature of SCons.
You do not tell scons what order to execute commands in directly.
You specify sources and targets and then SCons will figure out the best
order to run them in based on all dependencies in the system.

If you are getting the "two different..." error, then likely you are
thinking that you would just end up with the last command being run after
all the others and being the final result.  That is not the case here.
SCons detects that you are trying to do multiple actions to the same target
with different logic and errors out.

You need to ensure that when you are calling SConscript with different
values that those values always result in any targets being to different
files or directories.

-Bill


On Mon, Jun 23, 2014 at 6:03 AM, Ronex Dicapriyo <ronex_89 at yahoo.in> wrote:

>
>
> In addition to my previous mail, here scons also geneate error while
> copying library as below:
> Installing source ['<path_of_module>/lib_rel/<libname>.a', '
> '<path_of_module>/lib_dbg/<libname>.a] into target
> ['<path_of_common_folder>/<folder_name>/<libname>.a']: target and source
> lists must have same length.
>
> As in the error what I undersatnd is here scons generates list of two
> source and trying to copy into a single option target, For creating library
> following kind of code is used in Sconscript:
> if(env[shared] == True):
>    SharedLib()
> else:
>     StaticLib()
>
> This SConscript called with two different environment objects (release and
> debug).
> I also noticed manu warning for this:
>
> scons: warning: Two different environments were specified for target
> <path_of_common_folder>/<module_name>/<lib_name>.a,
>     but they appear to have the same action: installFunc(target, source,
> env)
> File "<path_of_module>/SConscript", line 52, in <module>
>
> scons: warning: Two different environments were specified for target
> <path_of_common_folder>/<module_name>/<docs_folder>,
>     but they appear to have the same action: installFunc(target, source,
> env)
> File "<path_of_module>/SConscript", line 52, in <module>
>
>
> Kindly revert to me with solution. Thanks in advance for all the help and
> pointers.
>
>
>
>
>
>
>
>
>   On Monday, 23 June 2014 5:44 PM, Ronex Dicapriyo <ronex_89 at yahoo.in>
> wrote:
>
>
>
> Hi,
>
>
> Let me try to explain my problem :
>
> I have created a SConstruct file which is used to basic setup(variant_dir
> - in case of static library set to <path_of_module>/lib/ where as for
> shared libraries it's set to <path_of_module>/dll/)
> This top level SConstruct used to call SConscript files present for
> different modules.
> say [module_1, module_2, module_3]
>
> Requirement for SConscript:
> 1) It should create shared and static library of a modules for both
> release and debug build.
>     location of shared libraries should be <path_of_module>/dll/
>     location of static    libraries should be <path_of_module>/lib/
>      [
>         For this while calling SConscript from SConstruct I am calling it
> four times for each combinations :
>           (i) release-shared (variant_dir = <path_of_module>/dll)
>           (ii) release-static   (variant_dir = <path_of_module>/lib)
>           (iii) debug-shared (variant_dir = <path_of_module>/dll)
>           (iv)debug-static     (variant_dir = <path_of_module>/lib)
>     ]
> 2) If modules has some dependencies then it should first build the
> dependent module
>     (like module_1 depends on module_2 then module_2 should be build
> first from module_1's SConscript)
>
> 3) Each SConscript copies the created library and some other directories
> of the module in some common place. Now how should I use intsall here in
> module/SConscript ?
>  Because SConscript gets called four times and what is the proper way to
> implement such functionality using scons. say if insall used to copy
> library generated in a call of SConscript and few directories likes
> include, docs, etc..
>
> For this I was thinking to implement different SConscript in the same
> folder for install only and want to make it dependent on another Sconscript
> which generates library.
> It could have one more benefit say if modules have interdependency it will
> first call SConscript for install and then from  it, it would invoke
> library creation.
>
> Kindly suggest me the way to implement and use scons as per my requirement.
>
> 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/20140624/7445ab92/attachment-0001.html>


More information about the Scons-users mailing list