• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 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_binary",
18    "pw_cc_facade",
19    "pw_cc_library",
20    "pw_cc_test",
21)
22
23package(default_visibility = ["//visibility:public"])
24
25licenses(["notice"])
26
27pw_cc_facade(
28    name = "facade",
29    hdrs = [
30        "public/pw_trace/internal/trace_internal.h",
31        "public/pw_trace/trace.h",
32    ],
33    includes = ["public"],
34    deps = [
35        "//pw_preprocessor",
36    ],
37)
38
39pw_cc_library(
40    name = "pw_trace",
41    deps = [
42        ":facade",
43        "@pigweed_config//:pw_trace_backend",
44    ],
45)
46
47pw_cc_library(
48    name = "backend_multiplexer",
49    visibility = ["@pigweed_config//:__pkg__"],
50    deps = ["//pw_trace:null"],
51)
52
53pw_cc_library(
54    name = "null",
55    hdrs = [
56        "public/pw_trace/internal/null.h",
57        "public_overrides/pw_trace_backend/trace_backend.h",
58    ],
59    includes = [
60        "public",
61        "public_overrides",
62    ],
63    deps = [
64        "//pw_preprocessor",
65        "//pw_trace:facade",
66    ],
67)
68
69pw_cc_test(
70    name = "trace_backend_compile_test",
71    srcs = [
72        "trace_backend_compile_test.cc",
73        "trace_backend_compile_test_c.c",
74    ],
75    deps = [
76        ":pw_trace",
77        "//pw_preprocessor",
78        "//pw_unit_test",
79    ],
80)
81
82pw_cc_test(
83    name = "trace_facade_test",
84    srcs = [
85        "pw_trace_test/fake_backend.h",
86        "pw_trace_test/public_overrides/pw_trace_backend/trace_backend.h",
87        "trace_facade_test.cc",
88    ],
89    includes = [
90        "pw_trace_test",
91        "pw_trace_test/public_overrides",
92    ],
93    deps = [
94        ":pw_trace",
95        "//pw_preprocessor",
96        "//pw_unit_test",
97    ],
98)
99
100pw_cc_test(
101    name = "trace_zero_facade_test",
102    srcs = [
103        "pw_trace_zero/public_overrides/pw_trace_backend/trace_backend.h",
104        "trace_backend_compile_test.cc",
105        "trace_backend_compile_test_c.c",
106    ],
107    includes = [
108        "pw_trace_zero",
109        "pw_trace_zero/public_overrides",
110    ],
111    deps = [
112        ":facade",
113        "//pw_preprocessor",
114        "//pw_unit_test",
115    ],
116)
117
118pw_cc_library(
119    name = "trace_null_test",
120    srcs = [
121        "trace_null_test.cc",
122        "trace_null_test_c.c",
123    ],
124    deps = [
125        ":pw_trace",
126        "//pw_preprocessor",
127        "//pw_unit_test",
128    ],
129)
130
131pw_cc_library(
132    name = "pw_trace_sample_app",
133    srcs = ["example/sample_app.cc"],
134    hdrs = ["example/public/pw_trace/example/sample_app.h"],
135    includes = ["example/public"],
136    # TODO(b/258071921): Fix puzzling compiler errors
137    tags = ["manual"],
138    deps = [
139        "//pw_ring_buffer",
140        "//pw_trace",
141    ],
142)
143
144pw_cc_binary(
145    name = "trace_example_basic",
146    srcs = ["example/basic.cc"],
147    # TODO(b/258071921): Fix puzzling compiler errors
148    tags = ["manual"],
149    deps = [
150        ":pw_trace_sample_app",
151        "//pw_log",
152    ],
153)
154