mirror of https://github.com/bazelbuild/rules_cc
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 Merge3e6d3b9a4a
intob308aae57f
PiperOrigin-RevId: 248296402
This commit is contained in:
parent
b308aae57f
commit
eeec015f3e
|
@ -71,9 +71,7 @@ def _my_c_archive_impl(ctx):
|
||||||
inputs = depset(
|
inputs = depset(
|
||||||
direct = [object_file],
|
direct = [object_file],
|
||||||
transitive = [
|
transitive = [
|
||||||
# TODO: Use CcToolchainInfo getters when available
|
cc_toolchain.all_files,
|
||||||
# See https://github.com/bazelbuild/bazel/issues/7427.
|
|
||||||
ctx.attr._cc_toolchain.files,
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
outputs = [output_file],
|
outputs = [output_file],
|
||||||
|
|
|
@ -61,9 +61,7 @@ def _my_c_compile_impl(ctx):
|
||||||
env = env,
|
env = env,
|
||||||
inputs = depset(
|
inputs = depset(
|
||||||
items = [source_file],
|
items = [source_file],
|
||||||
# TODO: Use CcToolchainInfo getters when available
|
transitive = [cc_toolchain.all_files],
|
||||||
# See https://github.com/bazelbuild/bazel/issues/7427.
|
|
||||||
transitive = [ctx.attr._cc_toolchain.files],
|
|
||||||
),
|
),
|
||||||
outputs = [output_file],
|
outputs = [output_file],
|
||||||
)
|
)
|
||||||
|
@ -78,5 +76,6 @@ my_c_compile = rule(
|
||||||
"src": attr.label(mandatory = True, allow_single_file = True),
|
"src": attr.label(mandatory = True, allow_single_file = True),
|
||||||
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")),
|
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")),
|
||||||
},
|
},
|
||||||
|
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
|
||||||
fragments = ["cpp"],
|
fragments = ["cpp"],
|
||||||
)
|
)
|
||||||
|
|
|
@ -28,4 +28,5 @@ write_cc_toolchain_cpu = rule(
|
||||||
attrs = {
|
attrs = {
|
||||||
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")),
|
"_cc_toolchain": attr.label(default = Label("@bazel_tools//tools/cpp:current_cc_toolchain")),
|
||||||
},
|
},
|
||||||
|
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue