Update rules_cc for --incompatible_enable_cc_toolchain_resolution

[Copybara import of https://github.com/bazelbuild/rules_cc/pull/14]

https://github.com/bazelbuild/bazel/issues/7260
Merge 3e6d3b9a4a into b308aae57f

PiperOrigin-RevId: 248296402
This commit is contained in:
Googler 2019-05-15 02:19:24 -07:00 committed by Copybara-Service
parent b308aae57f
commit eeec015f3e
3 changed files with 4 additions and 6 deletions

View File

@ -71,9 +71,7 @@ def _my_c_archive_impl(ctx):
inputs = depset(
direct = [object_file],
transitive = [
# TODO: Use CcToolchainInfo getters when available
# See https://github.com/bazelbuild/bazel/issues/7427.
ctx.attr._cc_toolchain.files,
cc_toolchain.all_files,
],
),
outputs = [output_file],

View File

@ -61,9 +61,7 @@ def _my_c_compile_impl(ctx):
env = env,
inputs = depset(
items = [source_file],
# TODO: Use CcToolchainInfo getters when available
# See https://github.com/bazelbuild/bazel/issues/7427.
transitive = [ctx.attr._cc_toolchain.files],
transitive = [cc_toolchain.all_files],
),
outputs = [output_file],
)
@ -78,5 +76,6 @@ my_c_compile = rule(
"src": attr.label(mandatory = True, allow_single_file = True),
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")),
},
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
fragments = ["cpp"],
)

View File

@ -28,4 +28,5 @@ write_cc_toolchain_cpu = rule(
attrs = {
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")),
},
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
)