diff --git a/bazel/config/BUILD.bazel b/bazel/config/BUILD.bazel index 4e622af5c..3d75654eb 100644 --- a/bazel/config/BUILD.bazel +++ b/bazel/config/BUILD.bazel @@ -186,6 +186,12 @@ int_flag( build_setting_default = 0, ) +# PICO_BAZEL_CONFIG: PICO_TINYUSB_CONFIG, [Bazel only] The library that provides TinyUSB config header (e.g. tusb_config.h), default=//src/rp2_common/pico_stdio_usb:tusb_config, group=build +label_flag( + name = "PICO_TINYUSB_CONFIG", + build_setting_default = "//src/rp2_common/pico_stdio_usb:tusb_config", +) + # PICO_BAZEL_CONFIG: PICO_TINYUSB_LIB, [Bazel only] The library that provides TinyUSB, default=@tinyusb//:tinyusb, group=build label_flag( name = "PICO_TINYUSB_LIB", diff --git a/src/rp2_common/pico_stdio_usb/BUILD.bazel b/src/rp2_common/pico_stdio_usb/BUILD.bazel index be9506554..1e8817142 100644 --- a/src/rp2_common/pico_stdio_usb/BUILD.bazel +++ b/src/rp2_common/pico_stdio_usb/BUILD.bazel @@ -24,6 +24,9 @@ cc_library( hdrs = ["include/tusb_config.h"], includes = ["include"], target_compatible_with = compatible_with_rp2(), + deps = [ + ":pico_stdio_usb_headers", + ], ) pico_sdk_define( @@ -43,10 +46,6 @@ cc_library( hdrs = ["include/pico/stdio_usb.h"], includes = ["include"], target_compatible_with = compatible_with_rp2(), - visibility = [ - ":__pkg__", - "//src/rp2_common/tinyusb:__pkg__", - ], deps = [ ":LIB_PICO_STDIO_USB", ":PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS", diff --git a/src/rp2_common/tinyusb/BUILD.bazel b/src/rp2_common/tinyusb/BUILD.bazel index 4accbb5ef..fcc0405a2 100644 --- a/src/rp2_common/tinyusb/BUILD.bazel +++ b/src/rp2_common/tinyusb/BUILD.bazel @@ -15,6 +15,7 @@ cc_library( includes = ["include"], target_compatible_with = compatible_with_rp2(), deps = [ + "//bazel/config:PICO_TINYUSB_CONFIG", "//src/common/pico_binary_info", "//src/common/pico_stdlib_headers", "//src/common/pico_sync", @@ -30,7 +31,6 @@ cc_library( "//src/rp2_common/pico_stdio_semihosting", "//src/rp2_common/pico_stdio_uart", "//src/rp2_common/pico_stdio_usb:pico_stdio_usb_headers", - "//src/rp2_common/pico_stdio_usb:tusb_config", "//src/rp2_common/pico_unique_id", ], )