1 # Copyright 2020 The Pigweed Authors
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
7 # https://www.apache.org/licenses/LICENSE-2.0
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
15 import("//build_overrides/pigweed.gni")
17 import("$dir_pw_build/target_types.gni")
18 import("$dir_pw_docgen/docs.gni")
19 import("$dir_pw_third_party/nanopb/nanopb.gni")
20 import("$dir_pw_unit_test/test.gni")
23 include_dirs = [ "public" ]
27 pw_source_set("method") {
28 public_configs = [ ":public" ]
29 public = [ "public/pw_rpc/internal/nanopb_method.h" ]
30 sources = [ "nanopb_method.cc" ]
39 pw_source_set("method_union") {
40 public_configs = [ ":public" ]
41 public = [ "public/pw_rpc/internal/nanopb_method_union.h" ]
44 "$dir_pw_rpc/raw:method_union",
48 pw_source_set("client") {
49 public_configs = [ ":public" ]
54 public = [ "public/pw_rpc/nanopb_client_call.h" ]
55 sources = [ "nanopb_client_call.cc" ]
58 pw_source_set("common") {
59 public_deps = [ dir_pw_bytes ]
60 public_configs = [ ":public" ]
61 public = [ "public/pw_rpc/internal/nanopb_common.h" ]
62 sources = [ "nanopb_common.cc" ]
64 if (dir_pw_third_party_nanopb != "") {
65 public_deps += [ "$dir_pw_third_party/nanopb" ]
69 pw_source_set("test_method_context") {
70 public_configs = [ ":public" ]
71 public = [ "public/pw_rpc/nanopb_test_method_context.h" ]
79 pw_source_set("internal_test_utils") {
80 public = [ "pw_rpc_nanopb_private/internal_test_utils.h" ]
82 if (dir_pw_third_party_nanopb != "") {
83 public_deps += [ "$dir_pw_third_party/nanopb" ]
87 pw_source_set("echo_service") {
88 public_configs = [ ":public" ]
89 public_deps = [ "..:protos.nanopb_rpc" ]
90 sources = [ "public/pw_rpc/echo_service_nanopb.h" ]
93 pw_doc_group("docs") {
94 sources = [ "docs.rst" ]
97 pw_test_group("tests") {
101 ":echo_service_test",
102 ":method_lookup_test",
103 ":nanopb_method_test",
104 ":nanopb_method_union_test",
105 ":stub_generation_test",
109 pw_test("client_call_test") {
112 ":internal_test_utils",
113 "..:test_protos.nanopb",
116 sources = [ "nanopb_client_call_test.cc" ]
117 enable_if = dir_pw_third_party_nanopb != ""
120 pw_test("codegen_test") {
123 ":internal_test_utils",
124 ":test_method_context",
126 "..:test_protos.nanopb_rpc",
129 sources = [ "codegen_test.cc" ]
130 enable_if = dir_pw_third_party_nanopb != ""
133 pw_test("nanopb_method_test") {
135 ":internal_test_utils",
138 "..:test_protos.nanopb",
141 sources = [ "nanopb_method_test.cc" ]
142 enable_if = dir_pw_third_party_nanopb != ""
145 pw_test("method_lookup_test") {
148 ":test_method_context",
149 "..:test_protos.nanopb_rpc",
151 "../raw:test_method_context",
153 sources = [ "method_lookup_test.cc" ]
154 enable_if = dir_pw_third_party_nanopb != ""
157 pw_test("nanopb_method_union_test") {
159 ":internal_test_utils",
161 "..:test_protos.nanopb",
164 sources = [ "nanopb_method_union_test.cc" ]
165 enable_if = dir_pw_third_party_nanopb != ""
168 pw_test("echo_service_test") {
172 ":test_method_context",
174 sources = [ "echo_service_test.cc" ]
175 enable_if = dir_pw_third_party_nanopb != ""
178 pw_test("stub_generation_test") {
179 deps = [ "..:test_protos.nanopb_rpc" ]
180 sources = [ "stub_generation_test.cc" ]
181 enable_if = dir_pw_third_party_nanopb != ""