Environment for config

533 Views Asked by At

bazel build --config cxx20 --config opts ...

I want to default to --config cxx20 --config opts. However I cannot change .bazelrc because other users use different configs. Is there a environment variable for config like BAZEL_CXXOPTS?

export BAZEL_???="--config cxx20 --config opts"

3

There are 3 best solutions below

0
Sjoerd Visscher On BEST ANSWER

The usual solution for this is to create a .bazelrc.user file and add a line try-import %workspace%/.bazelrc.user to your .bazelrc file.

0
rds On

You can place your own configuration in $HOME/.bazelrc

0
rds On

You can also consider using an alias in your shell, like

alias bb='bazel build --config cxx20 --config opts'