Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2005-09-20 14:46:38


> Conditions and alternatives
>
> Sometimes, particular relationships need to be maintained among a
> target's build properties. This can be achieved with conditional
> requirement.
^^^^^^^^^^^
"requirements"

> For example, you might want to set specific #defines when a library
> is built as shared, or when a target's release variant is built
> in release mode.
^^^^^^^^^^^^^^^
strike that.

Swap the order of the last two sentences.

>
> lib network : network.cpp
> : <link>shared:<define>NEWORK_LIB_SHARED
> <variant>release:<define>EXTRA_FAST
> ;
>
> In the example above, whenever network is built with <link>shared,
> <define>NEWORK_LIB_SHARED will be in its properties, too.

Add:
"Also, whenever its release variant is built, <define>EXTRA_FAST
will appear in its properties"
>
> Sometimes the ways a target is built are so different that describing
> them using conditional requirements would be hard. For example,
> imagine that a library actually uses different source files depending
> on the toolset used to build it. We can express this situation using
> target alternatives:
>
> lib demangler : dummy_demangler.cpp ; # alternative 1
> lib demangler : demangler_gcc.cpp : <toolset>gcc ; # alternative 2
> lib demangler : demangler_msvc.cpp : <toolset>msvc ; # alternative 3
>
> In the example above, when built with gcc or msvc, demangler will use
> a source file specific to the toolset. Otherwise, it will use a
> generic source file, dummy_demangler.cpp.

Does it select the best match, or what? The reader needs to get at
least a very rough sense of how the alternative selection process
works at this point.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

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