Subject: Re: [Boost-build] Confused with conditional rule
From: Vladimir Prus (ghost_at_[hidden])
Date: 2011-09-23 04:36:58
On Friday, September 23, 2011 02:20:50 Dmitry Timoshenko wrote:
> Following conditional rule produces an error
> rule use-complex-xml-properties ( properties * )
> if --use-complex-xml in [ modules.peek : ARGV ] ||
> <define>UNICOMM_USE_COMPLEX_XML in $(properties)
> local result = <library>/smart//smart_data ;
> if ! <define>UNICOMM_USE_COMPLEX_XML in $(properties)
> # if uncomment this line below the bjam exits with the error
> # error: Can not evaluate conditional properties
> # result += <define>UNICOMM_USE_COMPLEX_XML ;
> return $(result) ;
> why when I uncomment the line
> 'result += <define>UNICOMM_USE_COMPLEX_XML ;'
> I get the error?
> Please could anybody tell me what am I doing wrong?
The evaluation of conditional requirements is done iteratively, until
nothing changes. On the first pass, your rule returns <define>UNICOMM_USE_COMPLEX_XML.
On the second pass, it sees the define is already there and does not add such
define. Boost.Build interprets it as if the rule has changed it's mind, and the
define should not really be there and makes another path, until it hits a limit
on the number of passes. Can you try to removing:
if ! <define>UNICOMM_USE_COMPLEX_XML in $(properties)
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build: http://boost.org/boost-build2
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