0

How can I set a variable in Jamfile, that's value would depend on used feature ?

That is, I am using feature library:

import feature : feature ;

feature myoption : A B C : symmetric propagated ;

Now I want to set a global variable depending on value?

constant MY_VARIABLE : >>HERE VALUE DEPENDING ON <myoption> VALUE<< ;

How this can be done ?

Marc Andreson
  • 3,405
  • 5
  • 35
  • 51

1 Answers1

0

In Boost.Build, the expression "<myoption> value" doesn't make much sense unless given a concrete target's context. Different concrete targets can be built with different values for <myoption> during the same build invocation. Those different concrete targets can even come from the same metatarget, yet still have different values for <myoption>. If you can provide an example of what you are trying to do, that includes targets and specifies how MY_CONSTANT is to be used for them, then perhaps I can come up with a solution.

Edit: Here is the relevant FAQ entry: How do I get the current value of feature in Jamfile?

usta
  • 6,699
  • 3
  • 22
  • 39