|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-01-04 06:00:06
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.
HTH,
Volodya
>
> Thanks again
>
> TEMPLIE Cédric
>
>
>
>
> 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