[Scons-users] SCons is only installing .lib part of SharedLibrary on Windows when target is specified

Gary Oberbrunner garyo at oberbrunner.com
Fri Feb 1 12:58:53 EST 2013


On Fri, Feb 1, 2013 at 11:28 AM, Dan Pidcock <dan.pidcock at googlemail.com>wrote:


> On 1 February 2013 15:33, Gary Oberbrunner <garyo at oberbrunner.com> wrote:

> >

> > On Fri, Feb 1, 2013 at 10:24 AM, Dan Pidcock <dan.pidcock at googlemail.com

> >

> > wrote:

> >>

> >> However, looking through the --taskmastertrace output did show that

> >> the DLL wasn't even being considered when just the application was

> >> being built, but the .lib was being considered.

> >

> >

> > This is correct behavior -- you don't need the .dll to link the .exe.

> Your

> > Install should pick up both, however, and I think it is.

> > You're using Default(), which tells SCons what to build if you don't

> specify

> > any targets on the cmd line. In your run 1, though, you do specify a

> target

> > (your exe) -- so it builds only what's needed to build that target.

> >

> > Maybe what you want is Alias('all', ...) instead of Default(), and then

> say

> > Default(Alias('all')) to build all by default?

>

> I think I understand: Currently what I have tells SCons to install the

> library when no target is specified, but when I specify a target I

> still need to tell it to install the library?

>


Correct. SCons will only build what it's told to. Default() is only used
when no command-line targets are specified. And further, if there's no
Default(), everything under the current dir is built.


>

> How do I do the latter?

>

> I tried:

> Alias('all', sampleApplicationEnv.Install(binDir, sampleApplication))

> Default(Alias('all'))

> in the application SConscript

> and:

> Alias('all', sampleLibraryEnv.Install(binDir, sampleLibrary))

> Default(Alias('all'))

> in the library SConscript

> but that also only installed the .lib and not the .dll

>


That should have worked. Print out sampleLibraryEnv.Install(binDir,
sampleLibrary)) and see if it's a list containing your dll.
Do the printing like this:
stuff=sampleLibraryEnv.Install(binDir, sampleLibrary))
print [str(x) for x in stuff]
because the elements of the list are Nodes, and you need to print their
string representations. If your DLL is in that list, then it should get
into the alias, and thence into the default (which of course is only used
if you don't specify a target).

--
Gary
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20130201/8eee9e43/attachment.html>


More information about the Scons-users mailing list