blob: 42835a66eaf49e9ce4922a39b86e9dca2dafa568 [file] [log] [blame]
Wyatt Hepler76293e32020-02-07 18:07:19 -08001# 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
Armando Montanezfb3d3fb2020-06-09 18:12:12 -070015import("//build_overrides/pigweed.gni")
16
Alexei Frolovedd2f142020-06-09 19:11:27 -070017import("$dir_pw_build/target_types.gni")
Wyatt Hepler3c4e5de2020-03-03 14:37:52 -080018import("$dir_pw_docgen/docs.gni")
Wyatt Hepler76293e32020-02-07 18:07:19 -080019import("$dir_pw_unit_test/test.gni")
Wyatt Heplerd49f8fe2020-10-15 10:13:47 -070020
Wyatt Hepler100a1602021-10-05 14:02:02 -070021config("public_include_path") {
Wyatt Hepler76293e32020-02-07 18:07:19 -080022 include_dirs = [ "public" ]
23}
24
Armando Montanez516022c2020-05-14 09:12:19 -070025group("pw_containers") {
26 public_deps = [
Kevin Zengb0bb8492021-01-11 21:32:24 -080027 ":flat_map",
Armando Montanez516022c2020-05-14 09:12:19 -070028 ":intrusive_list",
29 ":vector",
30 ]
31}
32
Wyatt Hepler100a1602021-10-05 14:02:02 -070033pw_source_set("filtered_view") {
34 public_configs = [ ":public_include_path" ]
35 public = [ "public/pw_containers/filtered_view.h" ]
36}
37
Kevin Zengb0bb8492021-01-11 21:32:24 -080038pw_source_set("flat_map") {
Wyatt Hepler100a1602021-10-05 14:02:02 -070039 public_configs = [ ":public_include_path" ]
Kevin Zengb0bb8492021-01-11 21:32:24 -080040 public = [ "public/pw_containers/flat_map.h" ]
41}
42
Wyatt Heplerfff3c7c2021-08-17 18:15:10 -070043pw_source_set("to_array") {
44 public_configs = [ ":public_include_path" ]
45 public = [ "public/pw_containers/to_array.h" ]
46}
47
Alexei Frolovedd2f142020-06-09 19:11:27 -070048pw_source_set("vector") {
Wyatt Hepler100a1602021-10-05 14:02:02 -070049 public_configs = [ ":public_include_path" ]
Wyatt Heplerbe37ef02021-03-25 17:45:01 -070050 public_deps = [ dir_pw_assert ]
Rob Mohra0ba54f2020-02-27 11:43:49 -080051 public = [ "public/pw_containers/vector.h" ]
Armando Montanez516022c2020-05-14 09:12:19 -070052}
53
Wyatt Heplerbfb98872021-10-07 21:16:24 -070054pw_source_set("wrapped_iterator") {
55 public_configs = [ ":public_include_path" ]
56 public = [ "public/pw_containers/wrapped_iterator.h" ]
57}
58
Alexei Frolovedd2f142020-06-09 19:11:27 -070059pw_source_set("intrusive_list") {
Wyatt Hepler100a1602021-10-05 14:02:02 -070060 public_configs = [ ":public_include_path" ]
Armando Montanez516022c2020-05-14 09:12:19 -070061 public = [
62 "public/pw_containers/internal/intrusive_list_impl.h",
63 "public/pw_containers/intrusive_list.h",
64 ]
Armando Montanez516022c2020-05-14 09:12:19 -070065 sources = [ "intrusive_list.cc" ]
Kevin Zengb0bb8492021-01-11 21:32:24 -080066 deps = [ dir_pw_assert ]
Wyatt Hepler76293e32020-02-07 18:07:19 -080067}
68
69pw_test_group("tests") {
Armando Montanez516022c2020-05-14 09:12:19 -070070 tests = [
Wyatt Hepler100a1602021-10-05 14:02:02 -070071 ":filtered_view_test",
Kevin Zengb0bb8492021-01-11 21:32:24 -080072 ":flat_map_test",
Armando Montanez516022c2020-05-14 09:12:19 -070073 ":intrusive_list_test",
Wyatt Heplerfff3c7c2021-08-17 18:15:10 -070074 ":to_array_test",
Kevin Zengb0bb8492021-01-11 21:32:24 -080075 ":vector_test",
Wyatt Heplerbfb98872021-10-07 21:16:24 -070076 ":wrapped_iterator_test",
Armando Montanez516022c2020-05-14 09:12:19 -070077 ]
Wyatt Hepler76293e32020-02-07 18:07:19 -080078}
79
Wyatt Hepler100a1602021-10-05 14:02:02 -070080pw_test("filtered_view_test") {
81 sources = [ "filtered_view_test.cc" ]
82 deps = [
83 ":filtered_view",
84 ":intrusive_list",
85 ]
86}
87
Kevin Zengb0bb8492021-01-11 21:32:24 -080088pw_test("flat_map_test") {
89 sources = [ "flat_map_test.cc" ]
90 deps = [ ":flat_map" ]
91}
92
Wyatt Heplerfff3c7c2021-08-17 18:15:10 -070093pw_test("to_array_test") {
94 sources = [ "to_array_test.cc" ]
95 deps = [ ":to_array" ]
96}
97
Wyatt Hepler76293e32020-02-07 18:07:19 -080098pw_test("vector_test") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080099 sources = [ "vector_test.cc" ]
Kevin Zengb0bb8492021-01-11 21:32:24 -0800100 deps = [ ":vector" ]
Wyatt Hepler76293e32020-02-07 18:07:19 -0800101}
Wyatt Hepler3c4e5de2020-03-03 14:37:52 -0800102
Wyatt Heplerbfb98872021-10-07 21:16:24 -0700103pw_test("wrapped_iterator_test") {
104 sources = [ "wrapped_iterator_test.cc" ]
105 deps = [ ":wrapped_iterator" ]
106}
107
Armando Montanez516022c2020-05-14 09:12:19 -0700108pw_test("intrusive_list_test") {
Kevin Zengb0bb8492021-01-11 21:32:24 -0800109 sources = [ "intrusive_list_test.cc" ]
Armando Montanez516022c2020-05-14 09:12:19 -0700110 deps = [
111 ":intrusive_list",
112 "$dir_pw_preprocessor",
113 ]
Armando Montanez516022c2020-05-14 09:12:19 -0700114}
115
Wyatt Hepler3c4e5de2020-03-03 14:37:52 -0800116pw_doc_group("docs") {
117 sources = [ "docs.rst" ]
118}