bazelbuild / rules_cc

C++ Rules for Bazel
https://bazel.build
Apache License 2.0
181 stars 89 forks source link

Feature flags for common compiler options (e.g. C++ standard) #139

Open paulherman opened 2 years ago

paulherman commented 2 years ago

Description of the problem / feature request:

Allow customizing common flags (e.g. standard version) via features.

Feature requests: what underlying problem are you trying to solve with this feature?

I want to not add compiler dependent flags to .bazelrc nor to my rules. Instead, I believe some of the common options (e.g. --std=c++17) could be best modelled by features. Moreover, this would add clear documentation w.r.t. what's the default standard on each toolchain as opposed to being hardcoded (https://github.com/bazelbuild/rules_cc/search?q=%22-std%3Dc%2B%2B%22).

Have you found anything relevant by searching the web?