xref: /aosp_15_r20/external/pigweed/pw_bloat/py/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("@rules_python//python:defs.bzl", "py_library")
16load("//pw_build:compatibility.bzl", "incompatible_with_mcu")
17load("//pw_build:python.bzl", "pw_py_binary")
18
19package(default_visibility = ["//visibility:public"])
20
21licenses(["notice"])
22
23py_library(
24    name = "pw_bloat",
25    srcs = [
26        "pw_bloat/bloat.py",
27        "pw_bloat/bloaty_config.py",
28        "pw_bloat/label.py",
29        "pw_bloat/label_output.py",
30    ],
31    data = ["@bloaty//:all"],
32    imports = ["."],
33    deps = [
34        "//pw_cli/py:pw_cli",
35        "@python_packages//pyelftools",
36        "@rules_python//python/runfiles",
37    ],
38)
39
40pw_py_binary(
41    name = "bloat",
42    srcs = ["pw_bloat/__main__.py"],
43    main = "pw_bloat/__main__.py",
44    target_compatible_with = incompatible_with_mcu(),
45    deps = [":pw_bloat"],
46)
47