• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2024 The Pigweed Authors
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7#     https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
15load("//cc_toolchain:defs.bzl", "pw_cc_flag_group", "pw_cc_flag_set")
16load(":test_flag_sets.bzl", "test_flag_sets")
17
18package(default_visibility = ["//cc_toolchain/tests:__subpackages__"])
19
20pw_cc_flag_set(
21    name = "foo",
22    actions = ["//actions:c_compile"],
23    flags = ["--foo"],
24)
25
26pw_cc_flag_set(
27    name = "bar",
28    actions = ["//actions:c_compile"],
29    flags = ["--bar"],
30)
31
32pw_cc_flag_set(
33    name = "baz",
34    actions = ["//actions:c_compile"],
35    flags = ["--baz"],
36)
37
38pw_cc_flag_set(
39    name = "multiple_actions",
40    actions = [
41        "//actions:all_c_compiler_actions",
42        "//actions:all_cpp_compiler_actions",
43    ],
44    flags = ["--foo"],
45)
46
47pw_cc_flag_set(
48    name = "env",
49    actions = ["//actions:c_compile"],
50    env = {"foo": "%{bar}"},
51    env_expand_if_available = "bar",
52)
53
54pw_cc_flag_group(
55    name = "flag_group",
56    flags = [
57        "-bar",
58        "%{bar}",
59    ],
60    iterate_over = "bar",
61)
62
63pw_cc_flag_set(
64    name = "wraps_flag_group",
65    actions = ["//actions:c_compile"],
66    flag_groups = [":flag_group"],
67)
68
69test_flag_sets(
70    name = "test_flag_sets",
71)
72