From 508071f35090343819e259793a6428487de41b7c Mon Sep 17 00:00:00 2001 From: William Vinnicombe Date: Tue, 15 Oct 2024 17:36:37 +0100 Subject: [PATCH] Attempt to fix bazel build in same way as pico_flash works with pico_bootrom_headers --- src/BUILD.bazel | 1 + src/rp2_common/hardware_rcp/BUILD.bazel | 13 +++++++++++++ src/rp2_common/pico_bootrom/BUILD.bazel | 1 + 3 files changed, 15 insertions(+) diff --git a/src/BUILD.bazel b/src/BUILD.bazel index 58d564ba2..a397b486507 100644 --- a/src/BUILD.bazel +++ b/src/BUILD.bazel @@ -19,6 +19,7 @@ alias( "//src/rp2_common/boot_bootrom_headers:__pkg__", "//src/rp2_common/hardware_boot_lock:__pkg__", "//src/rp2_common/pico_flash:__pkg__", + "//src/rp2_common/hardware_rcp:__pkg__", ], ) diff --git a/src/rp2_common/hardware_rcp/BUILD.bazel b/src/rp2_common/hardware_rcp/BUILD.bazel index 750ae819e..6f8be1be3 100644 --- a/src/rp2_common/hardware_rcp/BUILD.bazel +++ b/src/rp2_common/hardware_rcp/BUILD.bazel @@ -2,6 +2,19 @@ load("//bazel:defs.bzl", "compatible_with_rp2") package(default_visibility = ["//visibility:public"]) +# Picotool needs this (transitively through +# //src/rp2_common/pico_bootrom:pico_bootrom_headers), so we can't strictly +# constrain compatibility. +cc_library( + name = "hardware_rcp_headers", + hdrs = ["include/hardware/rcp.h"], + includes = ["include"], + visibility = ["//src/rp2_common/pico_bootrom:__pkg__"], + deps = [ + "//src:pico_platform_internal", + ], +) + cc_library( name = "hardware_rcp", hdrs = ["include/hardware/rcp.h"], diff --git a/src/rp2_common/pico_bootrom/BUILD.bazel b/src/rp2_common/pico_bootrom/BUILD.bazel index 53a24b105..1463216d3 100644 --- a/src/rp2_common/pico_bootrom/BUILD.bazel +++ b/src/rp2_common/pico_bootrom/BUILD.bazel @@ -18,6 +18,7 @@ cc_library( "//src/rp2_common/boot_bootrom_headers", "//src/rp2_common/hardware_boot_lock:hardware_boot_lock_headers", "//src/rp2_common/pico_flash:pico_flash_headers", + "//src/rp2_common/hardware_rcp:hardware_rcp_headers", ] + select({ "//bazel/constraint:host": ["//src/host/hardware_sync"], "//conditions:default": ["//src/rp2_common/hardware_sync"],