[Scons-users] SConscripts getting read but not run
William Blevins
wblevins001 at gmail.com
Wed Jun 3 16:24:34 EDT 2015
You shouldn't need to call Depends explicitly. Please see "scons
--tree=<option>" and make sure the dependency tree appears to be generated
correctly. You should see your libs as dependencies even without the
explicit Depends call.
I would consider changing your directory structure to look like:
root
|
+- SConstruct
|
+--- app
| +- SConscript
| +- main.c
|
+--- l1
| +- SConscript
| +- <several .c and .h files>
|
+--- l2
+- SConscript
+- <more .c and .h files>
This will resolve your default target problems among other things. SCons
behaves best when the SConstruct exists at the "root-level" of the build
filesystem.
Lookup how SCons handles targets. The email listing I linked previously
briefly discussed this.
V/R,
William
On Wed, Jun 3, 2015 at 1:27 PM, Javier Llopis <javier at correo.com> wrote:
> Thank you very much, William.
>
> The link to the archives you point to, does look like a very similar
> problem.
>
> I managed to look at the FAQ using Google's lovely cache. It does not give
> a straight, usable answer to my problem but it did inspire me and after
> some playing around, I turns out if I explicitly specify the dependencies
> using Depends() everything works! I'd update the wiki to include my case,
> but it's down :(
>
> Thank you again
>
> J
>
>
>
> On Wed, Jun 3, 2015 at 17:55, William Blevins <wblevins001 at gmail.com>
> wrote:
>
> Normally I would say that your question is answered in
> http://www.scons.org/wiki/FrequentlyAskedQuestions but the wiki is down
> due to DOS Attacks probably.
>
> Here is a list to a previous mailing list discussion which will probably
> answer your question:
> http://thread.gmane.org/gmane.comp.programming.tools.scons.user/26756
>
> V/R,
> William
>
> On Wed, Jun 3, 2015 at 12:02 PM, Javier Llopis <javier at correo.com> wrote:
>
>
> Hello,
>
> I'm a scons newbie, and I realise this may have been asked before although
> I have done quite a bit of -so far- fruitless searching.
>
> I have the following directory structure for an app that depends on two
> libraries.
>
> root
> |
> +--- app
> | +- SConstruct
> | +- main.c
> |
> +--- l1
> | +- SConscript
> | +- <several .c and .h files>
> |
> +--- l2
> +- SConscript
> +- <more .c and .h files>
>
> My problem is that the SConscript files are being read but not executed.
>
> app/SConstruct:
>
> SConscript(dirs=["../l1", "../l2"])
> Program("main", "main.c",
> CPPPATH=["../l1/include", "../l2"],
> LIBS=["../l1/lib/lib1", "../l2/lib2"])
>
> l1/SConscript:
>
> src = Glob("src/*.c")
> StaticLibrary("lib\lib1", src, CPPPATH="include")
>
> l2/SConscript:
>
> src = Glob("*.c")
> StaticLibrary("lib2", src)
>
> Output of scons:
>
> C:\Users\j\t\ap>scons
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> cl /Fomain.obj /c main.c /nologo /IC:\Users\j\t\l1\include
> /IC:\Users\j\t\l2
> main.c
> link /nologo /OUT:main.exe ../l1/lib/lib1.lib ../l2/lib2.lib main.obj
> LINK : fatal error LNK1181: cannot open input file '../l1/lib/lib1.lib'
> scons: *** [main.exe] Error 1181
> scons: building terminated because of errors.
>
> The Link error happens because ../l1/lib/lib1.lib wasn't built in the
> first place.
>
> Any ideas?
>
> Thanks
>
> Javier Llopis
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
>
> _______________________________________________
> 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/20150603/ad2675a5/attachment-0001.html>
More information about the Scons-users
mailing list