Boost logo

Boost-Build :

From: Pedro Ferreira (pedro.ferreira_at_[hidden])
Date: 2005-05-18 03:51:38


Hi,

> Hi I need to include the wsock32 libraries conditionally when I'm
> building a project on windows (and I don't want to link it in when I'm
> in linux)...
>
> I'm sure this is very trivial but I'm having a very hard time figuring
> out how to actually do it, I have something like the following:
>
> project client
> : requirements <include>../common ;
>
> lib lwsock32 : : <name>wsock32 ;
>
> exe myClient
> : client.cc
> lwsock32
> ;
>
> That works fine, but what I need is to actually include a conditional
> in bjam v2, in order to load it (only in windows)... something like
> <toolset>gcc:<library>lwsock32
> but using some variable instead.
> Any help would be greatly appreciated.

I'm not really sure if this is what you intend (it's still too early in the
morning...) but, if you want to include the lib if using msvc and not
include it if gcc, you can do this:

lib lwsock32 : : <name>wsock32 <toolset>msvc ;

alias lwsock32 : : <toolset>msvc ;

exe myClient
: client.cc
lwsock32
;

HTH,

Pedro

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk