Boost logo

Boost-Build :

From: Pedro Ferreira (pedro.ferreira_at_[hidden])
Date: 2005-05-19 03:35:03


> That's sort of what I want but I'd really prefer to have the
> conditional based on the OS or based on a defined value in a header
> file. Is this even possible?

Sure:

local lwsock32-name = ;
if [ os.name ] = NT
{
lwsock32-name = wsock32 ;
}
else if [ os.name ] = MACOSX
{
lwsock32-name = xpto ;
}

(...)

lib lwsock32 : : <name>$(lwsock32-name) ;

Pedro

> --- In jamboost_at_[hidden], "Pedro Ferreira"
> <pedro.ferreira_at_m...> wrote:
>> 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
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>

 


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