Boost logo

Boost-Build :

Subject: Re: [Boost-build] The rule "constant"
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2017-03-12 23:08:58


On 03/12/2017 04:40 PM, Deane Yang via Boost-build wrote:
> According to the documentation:
> constant
> Sets project-wide constant. Takes two parameters: variable name and a value
> and makes the specified variable name accessible in this Jamfile and any
> child Jamfiles.
> The second sentence appears to imply that the constant is local to the
> Jamfile in which it is defined and its child Jamfiles.

That is the intent.

> However, as far as I
> can tell, the constant is in fact global and its value are visible to
> parent and sibling Jamfiles. So if I try to define a constant with the same
> name in a sibling Jamfile, the value of the constant will be the same in
> both Jamfiles (I'm not sure how Boost Build decides which value to use).
> Is this really the desired behavior? How do I work around this?

  I cannot reproduce your problem. constant
seems to behave as documented for me. Do you have
a small test project that demonstrates it?

In Christ,
Steven Watanabe

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