• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 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("@rules_cc//cc:cc_library.bzl", "cc_library")
16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library")
17load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
18load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24cc_library(
25    name = "pw_preprocessor",
26    hdrs = [
27        "public/pw_preprocessor/apply.h",
28        "public/pw_preprocessor/arguments.h",
29        "public/pw_preprocessor/boolean.h",
30        "public/pw_preprocessor/compiler.h",
31        "public/pw_preprocessor/concat.h",
32        "public/pw_preprocessor/internal/apply_macros.h",
33        "public/pw_preprocessor/internal/arg_count_impl.h",
34        "public/pw_preprocessor/util.h",
35    ],
36    strip_include_prefix = "public",
37    deps = ["//pw_polyfill"],
38)
39
40cc_library(
41    name = "cortex_m",
42    hdrs = [
43        "public/pw_preprocessor/arch.h",
44    ],
45    strip_include_prefix = "public",
46    deps = [":config_override"],
47)
48
49label_flag(
50    name = "config_override",
51    build_setting_default = "//pw_build:default_module_config",
52)
53
54pw_cc_test(
55    name = "boolean_test",
56    srcs = ["boolean_test.cc"],
57    deps = [":pw_preprocessor"],
58)
59
60pw_cc_test(
61    name = "compiler_test",
62    srcs = ["compiler_test.cc"],
63    deps = [":pw_preprocessor"],
64)
65
66pw_cc_test(
67    name = "concat_test",
68    srcs = ["concat_test.cc"],
69    deps = [":pw_preprocessor"],
70)
71
72pw_cc_test(
73    name = "util_test",
74    srcs = ["util_test.cc"],
75    deps = [":pw_preprocessor"],
76)
77
78pw_cc_test(
79    name = "arguments_test",
80    srcs = ["arguments_test.cc"],
81    deps = [":pw_preprocessor"],
82)
83
84filegroup(
85    name = "doxygen",
86    srcs = [
87        "public/pw_preprocessor/apply.h",
88        "public/pw_preprocessor/compiler.h",
89    ],
90)
91
92sphinx_docs_library(
93    name = "docs",
94    srcs = [
95        "Kconfig",
96        "docs.rst",
97    ],
98    prefix = "pw_preprocessor/",
99    target_compatible_with = incompatible_with_mcu(),
100)
101