• 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
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/arguments.h",
37    "public/pw_preprocessor/boolean.h",
38    "public/pw_preprocessor/compiler.h",
39    "public/pw_preprocessor/concat.h",
40    "public/pw_preprocessor/util.h",
41  ]
42  sources = [ "public/pw_preprocessor/internal/arg_count_impl.h" ]
43}
44
45pw_source_set("arch") {
46  public_configs = [ ":public_include_path" ]
47  public = [ "public/pw_preprocessor/arch.h" ]
48  public_deps = [ pw_preprocessor_CONFIG ]
49}
50
51pw_doc_group("docs") {
52  sources = [ "docs.rst" ]
53}
54
55# All pw_preprocessor test binaries.
56pw_test_group("tests") {
57  tests = [
58    ":arguments_test",
59    ":boolean_test",
60    ":compiler_test",
61    ":concat_test",
62    ":util_test",
63  ]
64}
65
66pw_test("arguments_test") {
67  deps = [ ":pw_preprocessor" ]
68  sources = [ "arguments_test.cc" ]
69}
70
71pw_test("boolean_test") {
72  deps = [ ":pw_preprocessor" ]
73  sources = [ "boolean_test.cc" ]
74}
75
76pw_test("compiler_test") {
77  deps = [ ":pw_preprocessor" ]
78  sources = [ "compiler_test.cc" ]
79}
80
81pw_test("concat_test") {
82  deps = [ ":pw_preprocessor" ]
83  sources = [ "concat_test.cc" ]
84}
85
86pw_test("util_test") {
87  deps = [ ":pw_preprocessor" ]
88  sources = [ "util_test.cc" ]
89}
90