Boost logo

Boost-Build :

Subject: Re: [Boost-build] bjam - two outputs from the same file
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2010-06-04 01:44:50

Rao, Anant" wrote:
>If I have a source file that
>generates two types of output, is it possible to generate them using bjam?
>Say, foo.cpp is like this:
>void f()
>#if defined(EXE)
>int main()
> f();
>Now, using the same file, I want
>to generate a binary (by defining EXE) as well as a lib.
>How do I declare the targets in
>a bjam file?

I'd use something like this (typed directly in email, untested):

import feature ;
feature.feature build-exe : no yes : link-incompatible composite optional propagated ;
feature.compose <build-exe>yes : <define>EXE ;

lib mylib : foo.cpp ;
exe myexe : foo.cpp : <build-exe>yes ;

Please let me know how that does work.


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