xref: /aosp_15_r20/external/pigweed/pw_elf/BUILD.bazel (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1# Copyright 2024 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("//pw_unit_test:pw_cc_test.bzl", "pw_cc_test")
16
17package(default_visibility = ["//visibility:public"])
18
19licenses(["notice"])
20
21cc_library(
22    name = "reader",
23    srcs = [
24        "reader.cc",
25    ],
26    hdrs = [
27        "public/pw_elf/internal/elf.h",
28        "public/pw_elf/internal/reader_impl.h",
29        "public/pw_elf/internal/stream_utils.h",
30        "public/pw_elf/reader.h",
31    ],
32    strip_include_prefix = "public",
33    deps = [
34        "//pw_assert",
35        "//pw_bytes",
36        "//pw_log",
37        "//pw_result",
38        "//pw_status",
39        "//pw_stream",
40    ],
41)
42
43pw_cc_test(
44    name = "reader_test",
45    srcs = [
46        "reader_test.cc",
47    ],
48    data = [
49        # TODO(jrreinhart): Move this file to this module.
50        "//pw_tokenizer/py:elf_reader_test_binary.elf",
51    ],
52    local_defines = [
53        "TEST_ELF_FILE_PATH=\\\"$(execpath //pw_tokenizer/py:elf_reader_test_binary.elf)\\\"",
54    ],
55    deps = [
56        ":reader",
57        "//pw_bytes",
58        "//pw_stream",
59        "//pw_stream:std_file_stream",
60    ],
61)
62
63# Bazel does not yet support building docs.
64filegroup(
65    name = "docs",
66    srcs = ["docs.rst"],
67)
68
69filegroup(
70    name = "doxygen",
71    srcs = [
72        "public/pw_elf/reader.h",
73    ],
74)
75