|
Boost-Build : |
Subject: Re: [Boost-build] different macros for same object file
From: Yelve Yakut (yelve_at_[hidden])
Date: 2009-11-27 03:54:08
Hi Volodya,
thanks for the reply. After a small change it worked. With the given
commands, bjam tries to build two applications with the same name, it
seems. Thus I had to do the following:
exe linapp : [ glob ./src/*.c ] [ glob ./src/*.cpp ] dependencies sharedmem ;
exe rtapp : [ glob ./src/*.c ] [ glob ./src/*.cpp ] dependencies sharedmem ;
install dist : linapp rtapp/<realtime>on : <location>. ;
Regards,
Yelve
On Thu, Nov 26, 2009 at 20:41, Vladimir Prus <ghost_at_[hidden]> wrote:
> On Thursday 26 November 2009 21:47:35 Yelve Yakut wrote:
>
>> Hi
>>
>> I'd like to be able to build two different versions of the same
>> project, depending on macro definitions. (see example below)
>> The object files differ depending on a <define> and the problem is
>> that boost is using the same folder for object files and can not tell
>> which file is affected by the definition and has to be compiled anew.
>> Is there a way to tell boost to use another bin directory for the other project?
>>
>>
>> In the following example the compilation of two projects will result
>> in the very same executable, depending on which project has been
>> compiled first.
>>
>> Regards,
>> Yelve Yakut
>>
>> Example:
>>
>> ---- Jamroot ---
>>
>> alias sharedmem : ...... ;
>>
>> alias dependencies : .... ;
>>
>> exe linuxapp : [ glob ./src/*.c ] [ glob ./src/*.cpp ] dependencies sharedmem ;
>> install linux : linuxapp : <location>./ ;
>>
>> exe realtimeapp : [ glob ./src/*.c ] [ glob ./src/*.cpp ] dependencies
>> sharedmem : <define>CONTROL_SYSTEM <define>PREEMPT_PATCH ;
>> install realtime : realtimeapp : <location>./ ;
>
> Hi Yelve,
>
> try the following:
>
> import feature ;
> feature.feature realtime : off on : composite propagated ;
> feature.compose <realtime>on : <define>CONTROL_SYSTEM <define>PREEMPT_PATCH ;
>
> exe app : [ glob ./src/*.c ] [ glob ./src/*.cpp ] dependencies sharedmem ;
> install dist : app app/<realtime>on : <location>. ;
>
> This way, you introduce a feature with a fixed set of values to control your build
> mode, and <realtime>on> will expand to defines you need. And because this new feature
> has specific set of values, it can be -- and will be -- represented in target paths.
>
> HTH,
> Volodya
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
>
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