• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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_bloat/bloat.gni")
18import("$dir_pw_build/target_types.gni")
19import("$dir_pw_docgen/docs.gni")
20import("$dir_pw_unit_test/test.gni")
21
22config("default_config") {
23  include_dirs = [ "public" ]
24  visibility = [ ":*" ]
25}
26
27pw_source_set("pw_bytes") {
28  public_configs = [ ":default_config" ]
29  public = [
30    "public/pw_bytes/array.h",
31    "public/pw_bytes/byte_builder.h",
32    "public/pw_bytes/endian.h",
33    "public/pw_bytes/span.h",
34    "public/pw_bytes/units.h",
35  ]
36  sources = [ "byte_builder.cc" ]
37  public_deps = [
38    dir_pw_preprocessor,
39    dir_pw_status,
40  ]
41}
42
43pw_test_group("tests") {
44  tests = [
45    ":array_test",
46    ":byte_builder_test",
47    ":endian_test",
48    ":units_test",
49  ]
50  group_deps = [
51    "$dir_pw_preprocessor:tests",
52    "$dir_pw_status:tests",
53  ]
54}
55
56pw_test("array_test") {
57  deps = [ ":pw_bytes" ]
58  sources = [ "array_test.cc" ]
59}
60
61pw_test("byte_builder_test") {
62  deps = [ ":pw_bytes" ]
63  sources = [ "byte_builder_test.cc" ]
64}
65
66pw_test("endian_test") {
67  deps = [ ":pw_bytes" ]
68  sources = [ "endian_test.cc" ]
69}
70
71pw_test("units_test") {
72  deps = [ ":pw_bytes" ]
73  sources = [ "units_test.cc" ]
74}
75
76pw_doc_group("docs") {
77  sources = [ "docs.rst" ]
78  report_deps = [ ":byte_builder_size_report" ]
79}
80
81pw_size_report("byte_builder_size_report") {
82  title = "Using pw::ByteBuilder"
83
84  binaries = [
85    {
86      target = "size_report:with_byte_builder"
87      base = "size_report:without_byte_builder"
88      label = "Using ByteBuilder vs not using it"
89    },
90  ]
91}
92