bfgroup / b2

B2 makes it easy to build C++ projects, everywhere.
https://www.bfgroup.xyz/b2/
Boost Software License 1.0
78 stars 228 forks source link

Access CLI set variables independently. #178

Open grafikrobot opened 2 years ago

grafikrobot commented 2 years ago

Make sure you completed the following tasks

Describe your use case

It's useful to distinguish between variables set in the environment, by the -sX=Y CLI option, and locally or globally in Jam files for configuration use. But it's currently convoluted, i.e. hard, to check if a variable is set because it's given with -sX=Y or in environment as both use the global module to store the variables.

Describe the solution you'd like

Create a way to store the -sX=Y variables separately. Likeliest implementation if to add those variables to a .CLI module like we do with .ENVIRON module.

Flamefire commented 2 years ago

For context: Given a possible setting ICU_PATH it would make sense to have the following order possible:

Currently the combination that env variables and CLI args are returned by module.peek makes this impossible which means that either you cannot overwrite the project-config with -s or an env variable would overwrite the project-config. Both don't make sense from a users perspective.