Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-10-08 00:08:17

> It feels like this should be easy, but I can't quite make it work. I
> have some set of source associated with feature-X that I would like
> compiled when the user defines USE_FEATURE_X. From what I can tell,
> this will define that variable:
> bjam define=USE_FEATURE_X
> However, I can't figure out how to use that to "enable" the optional
> sources. It seems that using two aliases should do the trick, but I
> can't figure out the syntax. For instance:
> alias feature-x-sources ;
> alias feature-x-sources : : if-defined(USE_FEATURE_X) ;
> exe extreme-pong : feature-x-sources ;
> It's the "if-defined" part I can't figure out.

You should use something line <X>on in requirement for the second
"feature-x-sources" alternative. Before that, you'll have to declare the "X"
feature, too. I attach an example which does it. When I run


only one file is compiled, and when I run

bjam X=on

another one is compiled as well. Is that OK?

- Volodya

 --Boundary-00=_Bv5g/I9PMXG7Ei0 Content-Type: application/x-zip;
Content-Transfer-Encoding: base64
Content-Disposition: attachment;

[Attachment content not displayed.] --Boundary-00=_Bv5g/I9PMXG7Ei0--

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at