Boost logo

Boost-Build :

From: TEMPLIE Cédric (cedric.templie_at_[hidden])
Date: 2005-01-04 07:11:18


Vladimir Prus wrote:
> On Monday 03 January 2005 14:02, TEMPLIE Cédric wrote:
>
>
>>I want to build 2 exe with same sources, the only difference is a DEFINE
>>tag, I do the following, but there is an error...
>>
>># Build the project from source files
>>exe SendBug
>
> ........
>
>> <define>INTERNAL_BUILD
>> ;
>>
>># Build the project from source files (public version)
>>exe SendBug_public
>
> .....
>
>> <define>PUBLIC_BUILD
>> ;
>>
>>The following error occured :
>>
>>error: Duplicate name of actual target:
>><pbin\msvc\debug\threading-multi>Base64.obj
>>error: previous virtual target { msvc%msvc.compile.c++-Base64.OBJ {
>>Base64.CPP } }
>>error: created from
>>error: another virtual target { msvc%msvc.compile.c++-Base64.OBJ {
>>Base64.CPP } }
>>error: created from
>>error: added properties: <define>PUBLIC_BUILD
>>error: removed properties: <define>INTERNAL_BUILD
>>
>>I understand why, but I don't need a specific variant to build that,
>>what can I do ?
>
>
> You have two approaches.
>
> 1. Introduce a new feature:
>
> feature my_public_build : yes no : propagated composite ;
> feature.compose <my_public_build>yes : <define>PUBLIC_BUILD ;
> feature.compose <my_public_build>no : <define>INTERNAL_BUILD ;
>
> The 'my_public_build' feature will be present in target path, and you'll be
> able to compile a single source with two values of the feature.
>
> 2. Explicitly change the locations for the two exes in questions:
>
> exe SendBug : ... : <location-prefix>SendBug ......
> exe SendBug_public : .... : <location-prefix>SendBug_public .......
>
> This will add additional element in front of target path and error will
> disappear too.
>
> The preferred variant depends on your use case. If public/internal distinction
> makes sense for a lot of targets, I'd use feature. If it's only relevant to
> SendBug exe, I'd use location-prefix.

I use the 2nd solution, and it works, thank you very much.

But I don't know why, know insteand of building only the exe, it builds
also a lib... do you know why ?

>
> HTH,
> Volodya
>
>
>
>
>>Thanks again
>>
>>TEMPLIE Cédric
>>
>>
>>
>>
>>Yahoo! Groups Links
>>
>>
>>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>

 


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