conditionals on |
|
List Info Thread: conditionals on
|
||||||||||||||||||||||||||||
|
|
|
| conditionals on <define>? | |
![]() Austria |
2007-08-29 02:59:50 |
Say I have a lib targets: lib program_options : $(sources) : <define>PROGRAM_OPTIONS_DYN_LINK:<link>shared ; lib coollib : $(cool_srces) : <define>COOL_DYN_LINK:<link>shared ; and an exe target: exe myapp : mysrc.cpp program_options coollib : <define>PROGRAM_OPTIONS_DYN_LINK ; The idea is to control which library is been linked static, and which is to be linked as shared lib. However, although Boost.Build does not complain, the conditional doesn't seem to evaluate. Any hints welcome! Btw.: What is the recommended way to specify mixed link type at all? I.e. exe myapp : src.cpp lib1 lib2 ; How do I specify lib1 is to link statically while lib2 shared? Roland aka speedsnail _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build a> |
|
| Re: conditionals on <define>? | |
| 2007-08-29 08:28:47 | |
Roland Schwarz wrote:
> Say I have a lib targets:
>
> lib program_options : $(sources) :
>
<define>PROGRAM_OPTIONS_DYN_LINK:<link>shared ;
>
> lib coollib : $(cool_srces) :
<define>COOL_DYN_LINK:<link>shared ;
>
> and an exe target:
>
> exe myapp : mysrc.cpp program_options coollib :
> <define>PROGRAM_OPTIONS_DYN_LINK ;
>
> The idea is to control which library is been linked
static, and which is
> to be linked as shared lib.
>
> However, although Boost.Build does not complain, the
conditional doesn't
> seem to evaluate.
>
> Any hints welcome!
>
> Btw.: What is the recommended way to specify mixed link
type at all?
> I.e.
> exe myapp : src.cpp lib1 lib2 ;
> How do I specify lib1 is to link statically while lib2
shared?
>
> Roland aka speedsnail
You should be able to do "exe myapp : src.cpp
lib1/<link>static
lib2/<link>shared ;", I believe -- I haven't been
able to find where I
did that before.
If you want it controlled by a feature, I think you'll have
to make your
own, since <define> isn't one of the features that
differentiate between
builds. Something like this _might_ work:
feature program_options_link : shared static ;
lib program_options : $(sources) :
<program_options_link>shared:<link>shared
<program_options_link>static:<link>static ;
exe myapp : mysrc.cpp program_options coollib :
<program_options_link>shared ;
Phillip
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
a>
|
|
| Re: conditionals on <define>? | |
![]() Austria |
2007-08-29 09:08:40 |
Phillip Seaver wrote: > You should be able to do "exe myapp : src.cpp lib1/<link>static > lib2/<link>shared ;", I believe -- I haven't been able to find where I > did that before. Thank you, works like a charm. And it's documented too |
|
about | contact Other archives ( Real Estate discussion Medical topics )