1load("//bazel:defs.bzl", "compatible_with_rp2")
2
3package(default_visibility = ["//visibility:public"])
4
5# Picotool needs this, so we can't strictly constrain platform compatibility.
6cc_library(
7    name = "pico_bootrom_headers",
8    hdrs = [
9        "include/pico/bootrom.h",
10        "include/pico/bootrom/lock.h",
11        "include/pico/bootrom/sf_table.h",
12        "include/pico/bootrom_constants.h",
13    ],
14    includes = ["include"],
15    tags = ["manual"],
16    visibility = ["@picotool//:__subpackages__"],
17    deps = [
18        "//src/rp2_common/boot_bootrom_headers",
19        "//src/rp2_common/hardware_boot_lock:hardware_boot_lock_headers",
20        "//src/rp2_common/pico_flash:pico_flash_headers",
21    ] + select({
22        "//bazel/constraint:host": ["//src/host/hardware_sync"],
23        "//conditions:default": ["//src/rp2_common/hardware_sync"],
24    }),
25)
26
27cc_library(
28    name = "pico_bootrom",
29    srcs = [
30        "bootrom.c",
31        "bootrom_lock.c",
32    ],
33    implementation_deps = [
34        "//src/common/boot_picobin_headers",
35        "//src/common/boot_picoboot_headers",
36        "//src/rp2_common/hardware_sync",
37        "//src/rp2_common/pico_runtime_init",
38    ],
39    target_compatible_with = compatible_with_rp2(),
40    deps = [
41        ":pico_bootrom_headers",
42    ] + select({
43        "//bazel/constraint:host": [
44        ],
45        "//conditions:default": [
46            "//src/rp2_common:pico_platform_internal",
47        ],
48    }),
49)
50