| # Copyright 2020 The Pigweed Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| # use this file except in compliance with the License. You may obtain a copy of |
| # the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations under |
| # the License. |
| |
| load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") |
| load("//pw_build:compatibility.bzl", "incompatible_with_mcu") |
| load("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test") |
| |
| package(default_visibility = ["//visibility:public"]) |
| |
| licenses(["notice"]) |
| |
| # Module configuration |
| |
| cc_library( |
| name = "config", |
| hdrs = ["public/pw_containers/config.h"], |
| strip_include_prefix = "public", |
| deps = [":config_override"], |
| ) |
| |
| label_flag( |
| name = "config_override", |
| build_setting_default = "//pw_build:default_module_config", |
| ) |
| |
| # Libraries |
| |
| cc_library( |
| # This group is deprecated. Prefer to depend on individual features rather |
| # than on this collection. |
| name = "pw_containers", |
| deps = [ |
| ":algorithm", |
| ":flat_map", |
| ":inline_deque", |
| ":inline_queue", |
| ":intrusive_list", |
| ":vector", |
| ], |
| ) |
| |
| cc_library( |
| name = "algorithm", |
| hdrs = [ |
| "public/pw_containers/algorithm.h", |
| "public/pw_containers/internal/algorithm_internal.h", |
| ], |
| strip_include_prefix = "public", |
| ) |
| |
| cc_library( |
| name = "intrusive_item", |
| srcs = ["intrusive_item.cc"], |
| hdrs = ["public/pw_containers/internal/intrusive_item.h"], |
| implementation_deps = ["//pw_assert"], |
| strip_include_prefix = "public", |
| ) |
| |
| cc_library( |
| name = "intrusive_list_common", |
| hdrs = [ |
| "public/pw_containers/internal/intrusive_list.h", |
| "public/pw_containers/internal/intrusive_list_item.h", |
| "public/pw_containers/internal/intrusive_list_iterator.h", |
| ], |
| strip_include_prefix = "public", |
| deps = [":intrusive_item"], |
| ) |
| |
| cc_library( |
| name = "intrusive_forward_list", |
| hdrs = ["public/pw_containers/intrusive_forward_list.h"], |
| strip_include_prefix = "public", |
| deps = [ |
| ":config", |
| ":intrusive_list_common", |
| ], |
| ) |
| |
| cc_library( |
| name = "intrusive_list", |
| hdrs = ["public/pw_containers/intrusive_list.h"], |
| strip_include_prefix = "public", |
| deps = [ |
| ":config", |
| ":intrusive_list_common", |
| ":legacy_intrusive_list", |
| ], |
| ) |
| |
| cc_library( |
| name = "legacy_intrusive_list", |
| hdrs = ["public/pw_containers/internal/legacy_intrusive_list.h"], |
| strip_include_prefix = "public", |
| visibility = [":__subpackages__"], |
| deps = [":intrusive_forward_list"], |
| ) |
| |
| cc_library( |
| name = "aa_tree", |
| srcs = [ |
| "aa_tree.cc", |
| "aa_tree_item.cc", |
| ], |
| hdrs = [ |
| "public/pw_containers/internal/aa_tree.h", |
| "public/pw_containers/internal/aa_tree_item.h", |
| "public/pw_containers/internal/aa_tree_iterator.h", |
| ], |
| strip_include_prefix = "public", |
| visibility = [":__subpackages__"], |
| deps = [ |
| ":intrusive_item", |
| "//pw_assert", |
| "//pw_bytes:packed_ptr", |
| "//pw_function", |
| ], |
| ) |
| |
| cc_library( |
| name = "intrusive_map", |
| hdrs = ["public/pw_containers/intrusive_map.h"], |
| strip_include_prefix = "public", |
| deps = [":aa_tree"], |
| ) |
| |
| cc_library( |
| name = "intrusive_multimap", |
| hdrs = ["public/pw_containers/intrusive_multimap.h"], |
| strip_include_prefix = "public", |
| deps = [":aa_tree"], |
| ) |
| |
| cc_library( |
| name = "intrusive_set", |
| hdrs = ["public/pw_containers/intrusive_set.h"], |
| strip_include_prefix = "public", |
| deps = [":aa_tree"], |
| ) |
| |
| cc_library( |
| name = "intrusive_multiset", |
| hdrs = ["public/pw_containers/intrusive_multiset.h"], |
| strip_include_prefix = "public", |
| deps = [":aa_tree"], |
| ) |
| |
| cc_library( |
| name = "iterator", |
| hdrs = ["public/pw_containers/iterator.h"], |
| strip_include_prefix = "public", |
| tags = ["noclangtidy"], |
| ) |
| |
| cc_library( |
| name = "inline_deque", |
| hdrs = [ |
| "public/pw_containers/inline_deque.h", |
| ], |
| strip_include_prefix = "public", |
| deps = [ |
| ":constexpr_tag", |
| ":raw_storage", |
| "//pw_assert", |
| "//pw_preprocessor", |
| "//pw_span", |
| ], |
| ) |
| |
| cc_library( |
| name = "inline_queue", |
| hdrs = [ |
| "public/pw_containers/inline_queue.h", |
| ], |
| strip_include_prefix = "public", |
| deps = [ |
| ":inline_deque", |
| ], |
| ) |
| |
| cc_library( |
| name = "inline_var_len_entry_queue", |
| srcs = ["inline_var_len_entry_queue.c"], |
| hdrs = ["public/pw_containers/inline_var_len_entry_queue.h"], |
| strip_include_prefix = "public", |
| tags = ["noclangtidy"], |
| deps = [ |
| ":constexpr_tag", |
| ":raw_storage", |
| "//pw_assert", |
| "//pw_preprocessor", |
| "//pw_varint", |
| ], |
| ) |
| |
| cc_library( |
| name = "vector", |
| hdrs = [ |
| "public/pw_containers/vector.h", |
| ], |
| strip_include_prefix = "public", |
| deps = [ |
| ":constexpr_tag", |
| "//pw_assert", |
| "//pw_preprocessor", |
| ], |
| ) |
| |
| cc_library( |
| name = "filtered_view", |
| hdrs = ["public/pw_containers/filtered_view.h"], |
| strip_include_prefix = "public", |
| deps = [ |
| "//pw_assert", |
| "//pw_containers", |
| ], |
| ) |
| |
| cc_library( |
| name = "flat_map", |
| hdrs = ["public/pw_containers/flat_map.h"], |
| strip_include_prefix = "public", |
| deps = ["//pw_assert"], |
| ) |
| |
| cc_library( |
| name = "raw_storage", |
| hdrs = [ |
| "public/pw_containers/internal/raw_storage.h", |
| ], |
| strip_include_prefix = "public", |
| visibility = [":__subpackages__"], |
| ) |
| |
| cc_library( |
| name = "constexpr_tag", |
| hdrs = [ |
| "public/pw_containers/internal/constexpr_tag.h", |
| ], |
| strip_include_prefix = "public", |
| visibility = [":__subpackages__"], |
| ) |
| |
| cc_library( |
| name = "test_helpers", |
| srcs = ["test_helpers.cc"], |
| hdrs = ["pw_containers_private/test_helpers.h"], |
| visibility = [":__subpackages__"], |
| deps = ["//pw_assert"], |
| ) |
| |
| cc_library( |
| name = "to_array", |
| hdrs = ["public/pw_containers/to_array.h"], |
| strip_include_prefix = "public", |
| ) |
| |
| cc_library( |
| name = "wrapped_iterator", |
| hdrs = ["public/pw_containers/wrapped_iterator.h"], |
| strip_include_prefix = "public", |
| ) |
| |
| # Unit tests |
| |
| pw_cc_test( |
| name = "algorithm_test", |
| srcs = ["algorithm_test.cc"], |
| deps = [ |
| ":algorithm", |
| ":flat_map", |
| ":intrusive_list", |
| ":vector", |
| "//pw_span", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "filtered_view_test", |
| srcs = ["filtered_view_test.cc"], |
| deps = [ |
| ":algorithm", |
| ":filtered_view", |
| ":flat_map", |
| ":intrusive_list", |
| "//pw_span", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "flat_map_test", |
| srcs = [ |
| "flat_map_test.cc", |
| ], |
| deps = [ |
| ":flat_map", |
| "//pw_polyfill", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "inline_var_len_entry_queue_test", |
| srcs = [ |
| "inline_var_len_entry_queue_test.cc", |
| "pw_containers_private/inline_var_len_entry_queue_test_oracle.h", |
| ], |
| deps = [ |
| ":inline_var_len_entry_queue", |
| "//pw_assert", |
| "//pw_bytes", |
| "//pw_varint", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "vector_test", |
| srcs = [ |
| "vector_test.cc", |
| ], |
| deps = [ |
| ":test_helpers", |
| ":vector", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "inline_deque_test", |
| srcs = [ |
| "inline_deque_test.cc", |
| ], |
| deps = [ |
| ":algorithm", |
| ":inline_deque", |
| ":test_helpers", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "inline_queue_test", |
| srcs = [ |
| "inline_queue_test.cc", |
| ], |
| deps = [ |
| ":algorithm", |
| ":inline_queue", |
| ":test_helpers", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "raw_storage_test", |
| srcs = [ |
| "raw_storage_test.cc", |
| ], |
| deps = [ |
| ":raw_storage", |
| ":test_helpers", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "to_array_test", |
| srcs = ["to_array_test.cc"], |
| deps = [":to_array"], |
| ) |
| |
| pw_cc_test( |
| name = "wrapped_iterator_test", |
| srcs = ["wrapped_iterator_test.cc"], |
| deps = [":wrapped_iterator"], |
| ) |
| |
| pw_cc_test( |
| name = "intrusive_forward_list_test", |
| srcs = ["intrusive_forward_list_test.cc"], |
| deps = [ |
| ":intrusive_forward_list", |
| ":vector", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_preprocessor", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "intrusive_list_test", |
| srcs = ["intrusive_list_test.cc"], |
| deps = [ |
| ":intrusive_list", |
| ":vector", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_preprocessor", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "intrusive_map_test", |
| srcs = ["intrusive_map_test.cc"], |
| deps = [ |
| ":intrusive_map", |
| ":intrusive_multimap", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_span", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "intrusive_multimap_test", |
| srcs = ["intrusive_multimap_test.cc"], |
| deps = [ |
| ":intrusive_map", |
| ":intrusive_multimap", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_span", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "intrusive_set_test", |
| srcs = ["intrusive_set_test.cc"], |
| deps = [ |
| ":intrusive_multiset", |
| ":intrusive_set", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_span", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "intrusive_multiset_test", |
| srcs = ["intrusive_multiset_test.cc"], |
| deps = [ |
| ":intrusive_multiset", |
| ":intrusive_set", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_span", |
| ], |
| ) |
| |
| pw_cc_test( |
| name = "intrusive_item_test", |
| srcs = ["intrusive_item_test.cc"], |
| deps = [ |
| ":intrusive_forward_list", |
| ":intrusive_list", |
| ":intrusive_map", |
| ":intrusive_multimap", |
| ":intrusive_multiset", |
| ":intrusive_set", |
| "//pw_compilation_testing:negative_compilation_testing", |
| "//pw_unit_test", |
| ], |
| ) |
| |
| filegroup( |
| name = "doxygen", |
| srcs = [ |
| "public/pw_containers/algorithm.h", |
| "public/pw_containers/filtered_view.h", |
| "public/pw_containers/inline_deque.h", |
| "public/pw_containers/inline_queue.h", |
| "public/pw_containers/inline_var_len_entry_queue.h", |
| "public/pw_containers/internal/aa_tree.h", |
| "public/pw_containers/internal/intrusive_list.h", |
| "public/pw_containers/intrusive_forward_list.h", |
| "public/pw_containers/intrusive_list.h", |
| "public/pw_containers/intrusive_map.h", |
| "public/pw_containers/intrusive_multimap.h", |
| "public/pw_containers/intrusive_multiset.h", |
| "public/pw_containers/intrusive_set.h", |
| "public/pw_containers/vector.h", |
| ], |
| ) |
| |
| sphinx_docs_library( |
| name = "docs", |
| srcs = [ |
| "Kconfig", |
| "docs.rst", |
| "lists.rst", |
| "maps.rst", |
| "multiple_containers.rst", |
| "queues.rst", |
| "sets.rst", |
| "utilities.rst", |
| "vectors.rst", |
| "//pw_containers/examples:docs", |
| ], |
| prefix = "pw_containers/", |
| target_compatible_with = incompatible_with_mcu(), |
| ) |