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