Skip to content

Commit 6409964

Browse files
keithcopybara-github
authored andcommitted
Add additional_compiler_inputs to cc_binary
Copybara Import from #542 BEGIN_PUBLIC Add additional_compiler_inputs to cc_binary (#542) Closes #542 END_PUBLIC COPYBARA_INTEGRATE_REVIEW=#542 from keith:ks/add-additional_compiler_inputs-to-cc_binary eff786c PiperOrigin-RevId: 845251652 Change-Id: I87fc5a4bd2bc72dfe3bf93fcf1858b3f1b3eba1e
1 parent be107bf commit 6409964

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

cc/private/rules_impl/attrs.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@ Dependencies that are only made available to the C++ linker command.
210210
For example, compiled Windows .res files can be provided here to be embedded in
211211
the binary target.
212212
</p>
213+
""",
214+
),
215+
"additional_compiler_inputs": attr.label_list(
216+
allow_files = True,
217+
flags = ["ORDER_INDEPENDENT", "DIRECT_COMPILE_TIME_INPUT"],
218+
doc = """
219+
Any additional files you might want to pass to the compiler command line, such as sanitizer
220+
ignorelists, for example. Files specified here can then be used in copts with the
221+
$(location) function.
213222
""",
214223
),
215224
"win_def_file": attr.label(

cc/private/rules_impl/cc_binary.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ def cc_binary_impl(ctx, additional_linkopts, force_linkstatic = False):
547547
module_interfaces = cc_helper.get_cpp_module_interfaces(ctx),
548548
compilation_contexts = compilation_context_deps,
549549
code_coverage_enabled = cc_helper.is_code_coverage_enabled(ctx = ctx),
550+
additional_inputs = ctx.files.additional_compiler_inputs,
550551
)
551552
precompiled_file_objects = cc_common.create_compilation_outputs(
552553
objects = depset(precompiled_files[0]), # objects

cc/private/rules_impl/cc_library.bzl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -888,15 +888,6 @@ prefix is added.
888888
889889
<p>This attribute is only legal under <code>third_party</code>.
890890
"""),
891-
"additional_compiler_inputs": attr.label_list(
892-
allow_files = True,
893-
flags = ["ORDER_INDEPENDENT", "DIRECT_COMPILE_TIME_INPUT"],
894-
doc = """
895-
Any additional files you might want to pass to the compiler command line, such as sanitizer
896-
ignorelists, for example. Files specified here can then be used in copts with the
897-
$(location) function.
898-
""",
899-
),
900891
"alwayslink": attr.bool(default = False, doc = """
901892
If 1, any binary that depends (directly or indirectly) on this C++
902893
library will link in all the object files for the files listed in

0 commit comments

Comments
 (0)