|
Boost-Build : |
Subject: Re: [Boost-build] Conditional targets not resolving properly
From: Vladimir Prus (ghost_at_[hidden])
Date: 2009-09-14 05:01:09
On Thursday 10 September 2009 Johan Larsson wrote:
> Hello.
>
> As part of a project, I have a library with an associated Jamfile I need to
> build. I want to build this particular library as a static lib, so I've
> added <link>static to the project requirements in the Jamfile for the
> library. So far so good.
>
> However, I also want to exclude a particular source file from the library if
> I use a particular toolset (gcc in this case). So I've created two targets;
> one with all the sources and no particular requirements, and one without the
> source file in question with <toolset>gcc added as a requirement, like so:
>
>
>
> project A
> : requirements
> <link>static
> <toolset>gcc:<cxxflags>-DNO_SMART
> : usage-requirements
> <linkflags>-lA
> <include>.
> ;
>
> alias commonsources
> : (snip)
> ;
>
> lib libA
> : commonsources
> SOURCE.cpp
> ;
>
> lib libA
> : commonsources
> : <toolset>gcc
> ;
>
> The problem is that when building with a toolset that is not gcc, bjam fails
> to find an appropriate target. The output it gives me is as follows:
> error: No best alternative for ./libA
> next alternative: required properties: <link>static
> not matched
> next alternative: required properties: <link>static <toolset>gcc
> not matched
Johan,
you are running into a known issue:
https://zigzag.lvk.cs.msu.su:7813/boost.build/ticket/16
Can you let me know if the workarounds suggested by Matthew and Phillip
work for you?
Thanks,
Volodya
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