blob: 80b3cc6cea459cf0c5e240c7c3e3de085a6eb9a9 [file] [log] [blame]
Wyatt Hepler1e636732021-06-14 18:30:13 -07001# Copyright 2021 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_docgen/docs.gni")
18import("$dir_pw_protobuf_compiler/proto.gni")
19import("$dir_pw_unit_test/test.gni")
20
Wyatt Hepler610f0622021-06-15 14:47:33 -070021config("public_include_path") {
22 include_dirs = [ "public" ]
23 visibility = [ ":*" ]
24}
25
26pw_source_set("pw_transfer") {
Wyatt Hepler610f0622021-06-15 14:47:33 -070027 public_configs = [ ":public_include_path" ]
28 public_deps = [
Alexei Frolovf93cb262021-07-14 16:05:15 -070029 ":proto.raw_rpc",
Wyatt Hepler610f0622021-06-15 14:47:33 -070030 "$dir_pw_containers:intrusive_list",
31 dir_pw_assert,
Alexei Frolovf93cb262021-07-14 16:05:15 -070032 dir_pw_bytes,
33 dir_pw_result,
Wyatt Hepler610f0622021-06-15 14:47:33 -070034 dir_pw_status,
35 dir_pw_stream,
36 ]
Alexei Frolovf93cb262021-07-14 16:05:15 -070037 deps = [
38 ":proto.pwpb",
39 dir_pw_log,
Alexei Frolov563946f2021-08-05 18:58:48 -070040 dir_pw_varint,
Alexei Frolovf93cb262021-07-14 16:05:15 -070041 ]
42 public = [
43 "public/pw_transfer/handler.h",
44 "public/pw_transfer/transfer.h",
45 ]
46 sources = [
47 "chunk.cc",
Alexei Frolov563946f2021-08-05 18:58:48 -070048 "context.cc",
49 "public/pw_transfer/internal/context.h",
Alexei Frolovf93cb262021-07-14 16:05:15 -070050 "pw_transfer_private/chunk.h",
51 "transfer.cc",
52 ]
53 friend = [ ":*" ]
Wyatt Hepler610f0622021-06-15 14:47:33 -070054}
55
Wyatt Hepler1e636732021-06-14 18:30:13 -070056pw_proto_library("proto") {
57 sources = [ "transfer.proto" ]
Alexei Frolov0c94fc22021-07-08 16:05:24 -070058 python_package = "py"
59 prefix = "pw_transfer"
Wyatt Hepler1e636732021-06-14 18:30:13 -070060}
61
62pw_test_group("tests") {
Alexei Frolovf93cb262021-07-14 16:05:15 -070063 tests = [
64 ":handler_test",
65 ":transfer_test",
66 ]
Wyatt Hepler610f0622021-06-15 14:47:33 -070067}
68
69pw_test("handler_test") {
70 sources = [ "handler_test.cc" ]
71 deps = [ ":pw_transfer" ]
Wyatt Hepler1e636732021-06-14 18:30:13 -070072}
73
Alexei Frolovf93cb262021-07-14 16:05:15 -070074pw_test("transfer_test") {
75 sources = [ "transfer_test.cc" ]
76 deps = [
77 ":proto.pwpb",
78 ":pw_transfer",
79 "$dir_pw_rpc/raw:test_method_context",
80 ]
81}
82
Wyatt Hepler1e636732021-06-14 18:30:13 -070083pw_doc_group("docs") {
84 sources = [ "docs.rst" ]
85 inputs = [ "transfer.proto" ]
86}
Wyatt Hepler22530402021-07-30 23:40:40 -070087
88pw_executable("test_rpc_server") {
89 sources = [ "test_rpc_server.cc" ]
90 deps = [
91 ":pw_transfer",
92 "$dir_pw_rpc/system_server",
93 "$dir_pw_rpc/system_server:socket",
94 dir_pw_log,
95 ]
96}