Skip to content

Commit

Permalink
Add ctx argument to cc_common.configure_features
Browse files Browse the repository at this point in the history
In order to migrate C++ rules to platforms, we need the access to the C++
configuration fragment in Starlark APIs. All existing APIs have already access
to it, but cc_common.configure_features doesn't. This change adds a
ctx argument to configure_features.

This is the migration needed for
bazelbuild/bazel#7793, and is part of the effort for
bazelbuild/bazel#6516.

If the rule doesn't depend on cpp fragment yet, you will have to add `fragments
=['cpp']` argument to the rule() call.

Note that this behavior is only available in Bazel 0.25 (to be released this month).

RELNOTES: None.
PiperOrigin-RevId: 243587074
  • Loading branch information
Googler authored and copybara-github committed May 8, 2019
1 parent 42491c6 commit e836c3e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions aspect/intellij_info_impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def collect_c_toolchain_info(target, ctx, semantics, ide_info, ide_info_file, ou
cxxopts = []
conlyopts = []
feature_configuration = cc_common.configure_features(
ctx = ctx,
cc_toolchain = cpp_toolchain,
requested_features = ctx.features,
unsupported_features = ctx.disabled_features + UNSUPPORTED_FEATURES,
Expand Down

0 comments on commit e836c3e

Please sign in to comment.