bazelbuild / bazelbuild/rules_cc

Add `cxx_standard` constraints

Open
#406 8 comments 2 reactions 0 assignees View on GitHub
category: toolchains untriaged
Dominant language
Starlark
Stars
247
Forks
196
PR merge metrics
No merged PRs in 30d

Description

I have wanted to configure targets in such a way that I can pass `-stdc++17` as a default value but remove this flag if a consumer wants to use a different version. Using [--copt](https://bazel.build/reference/command-line-reference#flag--cxxopt) is insufficient as it leads to targets being un-buildable unless consumers specify this on the command line or in their `.bazelrc` files which can be confusing or not feasible.

Would it be reasonable to define some `cxx_standard` constraints somewhere within `rules_cc` that's backed by a string flag such that users can specify on the command line or via a transition what version to use but would otherwise allow maintainers to set meaningful defaults that don't hinder folks who want to use different versions?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.