xref: /aosp_15_r20/external/pigweed/pw_preprocessor/BUILD.gn (revision 61c4878ac05f98d0ceed94b57d316916de578985)
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
15import("//build_overrides/pigweed.gni")
16
17import("$dir_pw_build/module_config.gni")
18import("$dir_pw_build/target_types.gni")
19import("$dir_pw_docgen/docs.gni")
20import("$dir_pw_unit_test/test.gni")
21
22declare_args() {
23  # The build target that overrides the default configuration options for this
24  # module. This should point to a source set that provides defines through a
25  # public config (which may -include a file or add defines directly).
26  pw_preprocessor_CONFIG = pw_build_DEFAULT_MODULE_CONFIG
27}
28
29config("public_include_path") {
30  include_dirs = [ "public" ]
31}
32
33pw_source_set("pw_preprocessor") {
34  public_configs = [ ":public_include_path" ]
35  public = [
36    "public/pw_preprocessor/apply.h",
37    "public/pw_preprocessor/arguments.h",
38    "public/pw_preprocessor/boolean.h",
39    "public/pw_preprocessor/compiler.h",
40    "public/pw_preprocessor/concat.h",
41    "public/pw_preprocessor/util.h",
42  ]
43  public_deps = [ dir_pw_polyfill ]
44  sources = [
45    "public/pw_preprocessor/internal/apply_macros.h",
46    "public/pw_preprocessor/internal/arg_count_impl.h",
47  ]
48}
49
50pw_source_set("arch") {
51  public_configs = [ ":public_include_path" ]
52  public = [ "public/pw_preprocessor/arch.h" ]
53  public_deps = [ pw_preprocessor_CONFIG ]
54}
55
56pw_doc_group("docs") {
57  inputs = [ "Kconfig" ]
58  sources = [ "docs.rst" ]
59}
60
61# All pw_preprocessor test binaries.
62pw_test_group("tests") {
63  tests = [
64    ":arguments_test",
65    ":boolean_test",
66    ":compiler_test",
67    ":concat_test",
68    ":util_test",
69  ]
70}
71
72pw_test("arguments_test") {
73  deps = [ ":pw_preprocessor" ]
74  sources = [ "arguments_test.cc" ]
75}
76
77pw_test("boolean_test") {
78  deps = [ ":pw_preprocessor" ]
79  sources = [ "boolean_test.cc" ]
80}
81
82pw_test("compiler_test") {
83  deps = [ ":pw_preprocessor" ]
84  sources = [ "compiler_test.cc" ]
85}
86
87pw_test("concat_test") {
88  deps = [ ":pw_preprocessor" ]
89  sources = [ "concat_test.cc" ]
90}
91
92pw_test("util_test") {
93  deps = [ ":pw_preprocessor" ]
94  sources = [ "util_test.cc" ]
95}
96