• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2022 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
15load(
16    "//pw_build:pigweed.bzl",
17    "pw_cc_test",
18)
19
20package(default_visibility = ["//visibility:public"])
21
22licenses(["notice"])
23
24cc_library(
25    name = "pw_intrusive_ptr",
26    srcs = ["ref_counted_base.cc"],
27    hdrs = [
28        "public/pw_intrusive_ptr/internal/ref_counted_base.h",
29        "public/pw_intrusive_ptr/intrusive_ptr.h",
30    ],
31    includes = ["public"],
32    deps = [
33        ":pw_recyclable",
34        "//pw_assert",
35    ],
36)
37
38cc_library(
39    name = "pw_recyclable",
40    hdrs = [
41        "public/pw_intrusive_ptr/recyclable.h",
42    ],
43    includes = ["public"],
44)
45
46pw_cc_test(
47    name = "intrusive_ptr_test",
48    srcs = [
49        "intrusive_ptr_test.cc",
50    ],
51    # TODO: b/260624583 - Fix this for rp2040
52    target_compatible_with = select({
53        "//pw_build/constraints/chipset:rp2040": ["@platforms//:incompatible"],
54        "//conditions:default": [],
55    }),
56    deps = [":pw_intrusive_ptr"],
57)
58
59pw_cc_test(
60    name = "recyclable_test",
61    srcs = [
62        "recyclable_test.cc",
63    ],
64    # TODO: b/260624583 - Fix this for rp2040
65    target_compatible_with = select({
66        "//pw_build/constraints/chipset:rp2040": ["@platforms//:incompatible"],
67        "//conditions:default": [],
68    }),
69    deps = [":pw_intrusive_ptr"],
70)
71