Quantcast

The rule "constant"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

The rule "constant"

Boost - Build mailing list
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. 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? 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The rule "constant"

Boost - Build mailing list
AMDG

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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Loading...