Boost logo

Boost-Build :

Subject: Re: [Boost-build] Checking for property values...
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-05 12:59:16


Brian Ravnsgaard Riis wrote:
> Given
> if [ <some_feature> : $(properties) ] in
> value1 value2 value3 and_so_on
> {
> ...
> }
> The ... part gets evaluated if <some_feature> has a value in the list,
> but also, it seems, if <some_feature> is not present in properties at
> all. Is this intentional? I need the branch to execute only if
> <some_feature> is present *and* is one of value1 value2 etc.

This is an artifact of the way "in" works:


|/a/ in /b/|

    true if all elements of /a/ can be found in /b/, or if /a/ has no

The easiest way around this is to create a named variable:

local values = [ ... ] ;
if $(values)-is-defined && $(values) in value1 value2 ... {

In Christ,
Steven Watanabe

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at