2
0
Fork 0
mirror of https://github.com/bazelbuild/rules_cc synced 2024-11-27 20:43:26 +00:00
rules_cc/tests/rule_based_toolchain/args/BUILD
Googler 66613ac5d9 Add support for implicit include directories to rule-based toolchains
BEGIN_PUBLIC

Add support for implicit include directories to rule-based toolchains

Reorients the `cc_toolchain.cxx_builtin_include_directories` attribute so it is expressed as an attribute on `cc_args` and `cc_tool` to signify that the tools or arguments imply include directories that Bazel's include path checker should allowlist. This moves the allowlist to the source of truth that implies these directories.

END_PUBLIC

PiperOrigin-RevId: 671393376
Change-Id: Ide8cae548783726835168adcd3f705028a1f4308
2024-09-05 09:06:15 -07:00

45 lines
1.2 KiB
Python

load("@rules_testing//lib:util.bzl", "util")
load("//cc/toolchains:args.bzl", "cc_args")
load("//tests/rule_based_toolchain:analysis_test_suite.bzl", "analysis_test_suite")
load(":args_test.bzl", "TARGETS", "TESTS")
util.helper_target(
cc_args,
name = "simple",
actions = ["//tests/rule_based_toolchain/actions:all_compile"],
args = [
"--foo",
"foo",
],
data = [
"//tests/rule_based_toolchain/testdata:file1",
"//tests/rule_based_toolchain/testdata:multiple",
],
env = {"BAR": "bar"},
)
util.helper_target(
cc_args,
name = "env_only",
actions = ["//tests/rule_based_toolchain/actions:all_compile"],
data = [
"//tests/rule_based_toolchain/testdata:file1",
"//tests/rule_based_toolchain/testdata:multiple",
],
env = {"BAR": "bar"},
)
util.helper_target(
cc_args,
name = "with_dir",
actions = ["//tests/rule_based_toolchain/actions:all_compile"],
allowlist_include_directories = ["//tests/rule_based_toolchain/testdata:directory"],
args = ["--secret-builtin-include-dir"],
)
analysis_test_suite(
name = "test_suite",
targets = TARGETS,
tests = TESTS,
)