Skip to content
Snippets Groups Projects
Unverified Commit 6ff3e4fa authored by armandomontanez's avatar armandomontanez Committed by GitHub
Browse files

Expand bazel build to include configuration options and broader support. (#1731)

* Add host Bazel build

Updates target_compatible_with across the repo to ensure that wildcard
builds for both host and rp2040 succeed.

* Get unit tests building

* Add Python script to identify build system differences

Uses the build system tags to make it easier to identify differences
between the CMake and Bazel builds.

* Temporarily disable pico divider test

* Support PICO_BARE_METAL in Bazel

* Support PICO_NO_GC_SECTIONS in Bazel

* Support boot2 configuration in Bazel

Adds support for PICO_DEFAULT_BOOT_STAGE2 and
PICO_DEFAULT_BOOT_STAGE2_FILE in the Bazel build.

* Allowlist some CMake-only options

* Support CXX configuration options in Bazel

* Move multiple_choice_flag.bzl

* Support all pico boards

* Support linking multiple stdio implementations

Changes the Bazel build so stdio implementations are no longer mutually
exclusive.

* Add PICO_BOOT_STAGE2_LINK_IMAGE

* Support PICO_CMSIS_PATH in Bazel

* Support PICO_USE_DEFAULT_MAX_PAGE_SIZE in Bazel

* Silence PICO_CMSIS_VENDOR and PICO_CMSIS_DEVICE differences

* Support PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS in Bazel

* Properly support version defines

* Support embedding binary info in Bazel

* Embed build type in binary

* Support different linker scripts in Bazel build

* Finish out missing PICO_BUILD_DEFINE in Bazel build

* Support PICO_NO_TARGET_NAME

* Reorganize initial configuration options in Bazel

Cleans up and reorganizes some of the initial configuration options
added to the Bazel build so everything is consistent.

* Add builds for pioasm and elf2uf2

* Use Python rules from rules_python

* Actually link in output formats in pioasm tool

* Make tools have public visibility

* Add UF2 Bazel aspect

* Add TODOs for pioasm/uf2 helpers

* Fix compile flag typo

* Update Bazel SDK configuration strings to match recent CMake changes

* Fix pico_divider test

* Clean up straggling TODOs

* Clarify pico_stdio_test compatibility

* Initial Bazel Pico W support

* Add new files from develop

* Clean up compatibility expressions in Bazel build

* Clean up rp2 constraint handling in Bazel

* More Bazel docs cleanup

* Format Bazel build files

* Consolidate transitions in the Pico SDK

* Make every _allowlist_function_transition explicit

* More docs cleanup

* Add a few missing defines

* Improve PICO_CONFIG_HEADER correctness in Bazel

* Minor docs clarifications
parent 0dc17e51
No related branches found
No related tags found
No related merge requests found
Showing
with 462 additions and 86 deletions
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -5,6 +7,7 @@ cc_library( ...@@ -5,6 +7,7 @@ cc_library(
srcs = ["watchdog.c"], srcs = ["watchdog.c"],
hdrs = ["include/hardware/watchdog.h"], hdrs = ["include/hardware/watchdog.h"],
includes = ["include"], includes = ["include"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base:pico_base_interface", "//src/common/pico_base:pico_base_interface",
"//src/common/pico_base:pico_platform", "//src/common/pico_base:pico_platform",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -5,6 +7,7 @@ cc_library( ...@@ -5,6 +7,7 @@ cc_library(
srcs = ["xosc.c"], srcs = ["xosc.c"],
hdrs = ["include/hardware/xosc.h"], hdrs = ["include/hardware/xosc.h"],
includes = ["include"], includes = ["include"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base:pico_base_interface", "//src/common/pico_base:pico_base_interface",
"//src/common/pico_base:pico_platform", "//src/common/pico_base:pico_platform",
......
load("//bazel:defs.bzl", "compatible_with_rp2", "incompatible_with_config")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
name = "pico_async_context", name = "pico_async_context",
srcs = [ srcs = ["async_context_base.c"],
"async_context_base.c",
"async_context_freertos.c",
"async_context_poll.c",
"async_context_threadsafe_background.c",
],
hdrs = [ hdrs = [
"include/pico/async_context.h", "include/pico/async_context.h",
"include/pico/async_context_base.h", "include/pico/async_context_base.h",
"include/pico/async_context_freertos.h",
"include/pico/async_context_poll.h",
"include/pico/async_context_threadsafe_background.h",
], ],
includes = ["include"], includes = ["include"],
# Missing deps for: target_compatible_with = compatible_with_rp2(),
# FreeRTOS.h deps = [
# semphr.h "//src/common/pico_base",
# timers.h "//src/common/pico_time",
tags = ["manual"], ],
)
cc_library(
name = "pico_async_context_freertos",
srcs = ["async_context_freertos.c"],
hdrs = ["include/pico/async_context_freertos.h"],
includes = ["include"],
target_compatible_with = compatible_with_rp2() + incompatible_with_config(
"//bazel/constraint:pico_freertos_unset",
),
deps = [
":pico_async_context",
"//bazel/config:PICO_FREERTOS_LIB",
"//src/common/pico_base",
"//src/common/pico_sync",
"//src/common/pico_time",
"//src/rp2_common/hardware_irq",
],
)
cc_library(
name = "pico_async_context_poll",
srcs = ["async_context_poll.c"],
hdrs = ["include/pico/async_context_poll.h"],
includes = ["include"],
target_compatible_with = compatible_with_rp2(),
deps = [
":pico_async_context",
"//src/common/pico_base",
"//src/common/pico_sync",
"//src/common/pico_time",
],
)
cc_library(
name = "pico_async_context_threadsafe_background",
srcs = ["async_context_threadsafe_background.c"],
hdrs = ["include/pico/async_context_threadsafe_background.h"],
includes = ["include"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
":pico_async_context",
"//src/common/pico_base", "//src/common/pico_base",
"//src/common/pico_sync", "//src/common/pico_sync",
"//src/common/pico_time", "//src/common/pico_time",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -16,6 +18,7 @@ cc_library( ...@@ -16,6 +18,7 @@ cc_library(
"-Wl,--wrap=__clzsi2", "-Wl,--wrap=__clzsi2",
"-Wl,--wrap=__clzll", "-Wl,--wrap=__clzll",
], ],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_bit_ops:pico_bit_ops_headers", "//src/common/pico_bit_ops:pico_bit_ops_headers",
"//src/rp2_common/pico_bootrom", "//src/rp2_common/pico_bootrom",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -8,6 +10,7 @@ cc_library( ...@@ -8,6 +10,7 @@ cc_library(
"include/pico/bootrom/sf_table.h", "include/pico/bootrom/sf_table.h",
], ],
includes = ["include"], includes = ["include"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base:pico_base_interface", "//src/common/pico_base:pico_base_interface",
"//src/common/pico_base:pico_platform", "//src/common/pico_base:pico_platform",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
name = "pico_bootsel_via_double_reset", name = "pico_bootsel_via_double_reset",
srcs = ["pico_bootsel_via_double_reset.c"], srcs = ["pico_bootsel_via_double_reset.c"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base", "//src/common/pico_base",
"//src/common/pico_binary_info", "//src/common/pico_binary_info",
......
load("//bazel:defs.bzl", "compatible_with_pico_w", "incompatible_with_config")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
# Prefer these aliases to directly referencing @btstack, as it's possible that
# name may change.
alias(
name = "pico_btstack_base",
actual = "@btstack//:pico_btstack_base",
)
alias(
name = "pico_btstack_ble",
actual = "@btstack//:pico_btstack_ble",
)
alias(
name = "pico_btstack_classic",
actual = "@btstack//:pico_btstack_classic",
)
alias(
name = "pico_btstack_sbc_encoder",
actual = "@btstack//:pico_btstack_classic",
)
alias(
name = "pico_btstack_bnep_lwip",
actual = "@btstack//:pico_btstack_bnep_lwip",
)
alias(
name = "pico_btstack_bnep_lwip_sys_freertos",
actual = "@btstack//:pico_btstack_bnep_lwip_sys_freertos",
)
cc_library( cc_library(
name = "pico_btstack", name = "pico_btstack_flash_bank",
srcs = [ srcs = ["btstack_flash_bank.c"],
"btstack_flash_bank.c", hdrs = ["include/pico/btstack_flash_bank.h"],
"btstack_run_loop_async_context.c",
"btstack_stdin_pico.c",
],
hdrs = [
"include/pico/btstack_flash_bank.h",
"include/pico/btstack_run_loop_async_context.h",
],
includes = ["include"], includes = ["include"],
# Missing deps for: target_compatible_with = compatible_with_pico_w(),
# btstack_config.h
# btstack_run_loop.h
# btstack_stdin.h
# hal_flash_bank.h
tags = ["manual"],
deps = [ deps = [
":pico_btstack_base",
"//src/common/pico_base", "//src/common/pico_base",
"//src/rp2_common/pico_flash",
],
)
cc_library(
name = "btstack_run_loop_async_context",
srcs = ["btstack_run_loop_async_context.c"],
hdrs = ["include/pico/btstack_run_loop_async_context.h"],
includes = ["include"],
target_compatible_with = compatible_with_pico_w(),
deps = [
"//src/rp2_common/hardware_sync", "//src/rp2_common/hardware_sync",
"//src/rp2_common/pico_async_context", "//src/rp2_common/pico_async_context",
"//src/rp2_common/pico_flash", "@btstack//:pico_btstack_base",
],
)
cc_library(
name = "pico_btstack_stdin",
srcs = ["btstack_stdin_pico.c"],
target_compatible_with = incompatible_with_config(
"//bazel/constraint:pico_btstack_config_unset",
) + compatible_with_pico_w(),
deps = [
"//src/common/pico_base",
"//src/rp2_common/pico_stdio", "//src/rp2_common/pico_stdio",
], ],
) )
load("@pico-sdk//bazel:defs.bzl", "incompatible_with_config")
package(default_visibility = ["//visibility:public"])
_DISABLE_WARNINGS = [
"-Wno-cast-qual",
"-Wno-format",
"-Wno-maybe-uninitialized",
"-Wno-null-dereference",
"-Wno-sign-compare",
"-Wno-stringop-overflow",
"-Wno-suggest-attribute=format",
"-Wno-type-limits",
"-Wno-unused-parameter",
]
cc_library(
name = "pico_btstack_base",
srcs = [
"3rd-party/md5/md5.c",
"3rd-party/micro-ecc/uECC.c",
"3rd-party/rijndael/rijndael.c",
"3rd-party/segger-rtt/SEGGER_RTT.c",
"3rd-party/segger-rtt/SEGGER_RTT_printf.c",
"3rd-party/yxml/yxml.c",
"platform/embedded/btstack_tlv_flash_bank.c",
"platform/embedded/hci_dump_embedded_stdout.c",
"platform/embedded/hci_dump_segger_rtt_stdout.c",
"src/ad_parser.c",
"src/btstack_audio.c",
"src/btstack_base64_decoder.c",
"src/btstack_crypto.c",
"src/btstack_hid_parser.c",
"src/btstack_linked_list.c",
"src/btstack_memory.c",
"src/btstack_memory_pool.c",
"src/btstack_resample.c",
"src/btstack_ring_buffer.c",
"src/btstack_run_loop.c",
"src/btstack_run_loop_base.c",
"src/btstack_slip.c",
"src/btstack_tlv.c",
"src/btstack_tlv_none.c",
"src/btstack_util.c",
"src/hci.c",
"src/hci_cmd.c",
"src/hci_dump.c",
"src/hci_event.c",
"src/l2cap.c",
"src/l2cap_signaling.c",
"src/mesh/gatt-service/mesh_provisioning_service_server.c",
"src/mesh/gatt-service/mesh_proxy_service_server.c",
],
hdrs = glob(["**/*.h"]),
copts = _DISABLE_WARNINGS,
includes = [
".",
"3rd-party/md5",
"3rd-party/micro-ecc",
"3rd-party/rijndael",
"3rd-party/segger-rtt",
"3rd-party/yxml",
"platform/embedded",
"src",
],
target_compatible_with = incompatible_with_config(
"@pico-sdk//bazel/constraint:pico_btstack_config_unset",
),
deps = ["@pico-sdk//bazel/config:PICO_BTSTACK_CONFIG"],
)
cc_library(
name = "pico_btstack_ble",
srcs = [
"src/ble/att_db.c",
"src/ble/att_db_util.c",
"src/ble/att_dispatch.c",
"src/ble/att_server.c",
"src/ble/gatt-service/ancs_client.c",
"src/ble/gatt-service/battery_service_client.c",
"src/ble/gatt-service/battery_service_server.c",
"src/ble/gatt-service/cycling_power_service_server.c",
"src/ble/gatt-service/cycling_speed_and_cadence_service_server.c",
"src/ble/gatt-service/device_information_service_client.c",
"src/ble/gatt-service/device_information_service_server.c",
"src/ble/gatt-service/heart_rate_service_server.c",
"src/ble/gatt-service/hids_client.c",
"src/ble/gatt-service/hids_device.c",
"src/ble/gatt-service/nordic_spp_service_server.c",
"src/ble/gatt-service/ublox_spp_service_server.c",
"src/ble/gatt_client.c",
"src/ble/le_device_db_memory.c",
"src/ble/le_device_db_tlv.c",
"src/ble/sm.c",
],
copts = _DISABLE_WARNINGS,
deps = [":pico_btstack_base"],
)
cc_library(
name = "pico_btstack_classic",
srcs = [
"src/classic/a2dp.c",
"src/classic/a2dp_sink.c",
"src/classic/a2dp_source.c",
"src/classic/avdtp.c",
"src/classic/avdtp_acceptor.c",
"src/classic/avdtp_initiator.c",
"src/classic/avdtp_sink.c",
"src/classic/avdtp_source.c",
"src/classic/avdtp_util.c",
"src/classic/avrcp.c",
"src/classic/avrcp_browsing.c",
"src/classic/avrcp_browsing_controller.c",
"src/classic/avrcp_browsing_target.c",
"src/classic/avrcp_controller.c",
"src/classic/avrcp_cover_art_client.c",
"src/classic/avrcp_media_item_iterator.c",
"src/classic/avrcp_target.c",
"src/classic/btstack_cvsd_plc.c",
"src/classic/btstack_link_key_db_tlv.c",
"src/classic/btstack_sbc_plc.c",
"src/classic/device_id_server.c",
"src/classic/gatt_sdp.c",
"src/classic/goep_client.c",
"src/classic/goep_server.c",
"src/classic/hfp.c",
"src/classic/hfp_ag.c",
"src/classic/hfp_gsm_model.c",
"src/classic/hfp_hf.c",
"src/classic/hfp_msbc.c",
"src/classic/hid_device.c",
"src/classic/hid_host.c",
"src/classic/hsp_ag.c",
"src/classic/hsp_hs.c",
"src/classic/obex_iterator.c",
"src/classic/obex_message_builder.c",
"src/classic/obex_parser.c",
"src/classic/pan.c",
"src/classic/pbap_client.c",
"src/classic/rfcomm.c",
"src/classic/sdp_client.c",
"src/classic/sdp_client_rfcomm.c",
"src/classic/sdp_server.c",
"src/classic/sdp_util.c",
"src/classic/spp_server.c",
],
copts = _DISABLE_WARNINGS,
deps = [":pico_btstack_base"],
)
cc_library(
name = "pico_btstack_sbc_encoder",
srcs = [
"3rd-party/bluedroid/encoder/srce/sbc_analysis.c",
"3rd-party/bluedroid/encoder/srce/sbc_dct.c",
"3rd-party/bluedroid/encoder/srce/sbc_dct_coeffs.c",
"3rd-party/bluedroid/encoder/srce/sbc_enc_bit_alloc_mono.c",
"3rd-party/bluedroid/encoder/srce/sbc_enc_bit_alloc_ste.c",
"3rd-party/bluedroid/encoder/srce/sbc_enc_coeffs.c",
"3rd-party/bluedroid/encoder/srce/sbc_encoder.c",
"3rd-party/bluedroid/encoder/srce/sbc_packing.c",
"src/classic/btstack_sbc_encoder_bluedroid.c",
],
copts = _DISABLE_WARNINGS,
includes = ["3rd-party/bluedroid/decoder/include"],
deps = [":pico_btstack_base"],
)
cc_library(
name = "pico_btstack_bnep_lwip",
srcs = [
"platform/lwip/bnep_lwip.c",
"src/classic/bnep.c",
],
copts = _DISABLE_WARNINGS,
includes = ["platform/lwip"],
deps = [":pico_btstack_base"],
)
cc_library(
name = "pico_btstack_bnep_lwip_sys_freertos",
srcs = [
"platform/lwip/bnep_lwip.c",
"src/classic/bnep.c",
],
copts = _DISABLE_WARNINGS,
defines = [
"LWIP_PROVIDE_ERRNO=1",
"PICO_LWIP_CUSTOM_LOCK_TCPIP_CORE=1",
],
includes = [
"platform/freertos",
"platform/lwip",
],
deps = [":pico_btstack_base"],
)
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
name = "pico_cxx_options", name = "pico_cxx_options",
target_compatible_with = compatible_with_rp2(),
) )
load("//bazel:defs.bzl", "compatible_with_pico_w", "incompatible_with_config")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
# Tuple is async_context type and whether or not lwip is enabled.
_CONFIGURATIONS = [
("freertos", False),
("freertos", True),
("poll", False),
("poll", True),
("threadsafe_background", False),
("threadsafe_background", True),
]
# This produces the following labels:
# pico_cyw43_arch_sys_freertos
# pico_cyw43_arch_lwip_sys_freertos
# pico_cyw43_arch_poll
# pico_cyw43_arch_lwip_poll
# pico_cyw43_arch_threadsafe_background
# pico_cyw43_arch_lwip_threadsafe_background
#
# This is done rather than having intermediate libraries because the defines
# for a given configuration must be applied to both .c files.
[
cc_library( cc_library(
name = "pico_cyw43_arch", name = "pico_cyw43_arch_" + ("lwip_" if use_lwip else "") + kind,
srcs = [ srcs = [
"cyw43_arch.c", "cyw43_arch.c",
"cyw43_arch_freertos.c", "cyw43_arch_{}.c".format(kind),
"cyw43_arch_poll.c",
"cyw43_arch_threadsafe_background.c",
], ],
hdrs = [ hdrs = [
"include/pico/cyw43_arch.h", "include/pico/cyw43_arch.h",
"include/pico/cyw43_arch/arch_freertos.h", "include/pico/cyw43_arch/arch_{}.h".format(kind),
"include/pico/cyw43_arch/arch_poll.h", ],
"include/pico/cyw43_arch/arch_threadsafe_background.h", defines = [
"LIB_PICO_CYW43_ARCH=1",
"PICO_CYW43_ARCH_{}=1".format(kind.upper()),
"CYW43_LWIP={}".format(1 if use_lwip else 0),
], ],
includes = ["include"], includes = ["include"],
# Missing deps for: target_compatible_with = compatible_with_pico_w() + (
# cyw43.h incompatible_with_config("//bazel/constraint:pico_freertos_unset") if kind == "freertos" else []
# cyw43_country.h ),
# cyw43_ll.h
# cyw43_stats.h
tags = ["manual"],
deps = [ deps = [
"//src/common/pico_base", "//src/common/pico_base",
"//src/rp2_common/pico_async_context", "//src/rp2_common/pico_async_context:pico_async_context_{}".format(kind),
"//src/rp2_common/pico_cyw43_driver", "//src/rp2_common/pico_cyw43_driver",
"//src/rp2_common/pico_lwip", "//src/rp2_common/pico_lwip",
"//src/rp2_common/pico_unique_id", "//src/rp2_common/pico_unique_id",
], ] + (
["//src/rp2_common/pico_lwip:pico_lwip_freertos"] if kind == "freertos" else ["//src/rp2_common/pico_lwip:pico_lwip_nosys"]
),
)
for kind, use_lwip in _CONFIGURATIONS
]
alias(
name = "pico_cyw43_arch_none",
actual = ":pico_cyw43_arch_threadsafe_background",
) )
load("//bazel:defs.bzl", "compatible_with_pico_w", "pico_generate_pio_header")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library(
name = "cyw43_configport",
hdrs = ["include/cyw43_configport.h"],
includes = ["include"],
deps = [
"//src/common/pico_base",
"//src/common/pico_time",
"//src/rp2_common/hardware_gpio",
],
)
cc_library( cc_library(
name = "pico_cyw43_driver", name = "pico_cyw43_driver",
srcs = [ srcs = [
...@@ -10,42 +23,33 @@ cc_library( ...@@ -10,42 +23,33 @@ cc_library(
"cyw43_driver.c", "cyw43_driver.c",
], ],
hdrs = [ hdrs = [
"include/cyw43_configport.h",
"include/pico/btstack_chipset_cyw43.h", "include/pico/btstack_chipset_cyw43.h",
"include/pico/btstack_cyw43.h", "include/pico/btstack_cyw43.h",
"include/pico/btstack_hci_transport_cyw43.h", "include/pico/btstack_hci_transport_cyw43.h",
"include/pico/cyw43_driver.h", "include/pico/cyw43_driver.h",
], ],
includes = ["include"], includes = ["include"],
# Missing deps for: target_compatible_with = compatible_with_pico_w(),
# ble/le_device_db_tlv.h
# btstack_chipset.h
# btstack_memory.h
# btstack_tlv.h
# btstack_tlv_flash_bank.h
# classic/btstack_link_key_db_tlv.h
# cyw43.h
# cyw43_bus_pio_spi.pio.h
# cyw43_debug_pins.h
# cyw43_internal.h
# cyw43_spi.h
# hci.h
# hci_dump.h
# hci_dump_embedded_stdout.h
# hci_dump_segger_rtt_stdout.h
# hci_transport.h
tags = ["manual"],
deps = [ deps = [
":cyw43_bus_pio",
":cyw43_configport",
"//bazel/config:PICO_BTSTACK_CONFIG",
"//src/common/pico_base", "//src/common/pico_base",
"//src/common/pico_time",
"//src/rp2_common/hardware_clocks", "//src/rp2_common/hardware_clocks",
"//src/rp2_common/hardware_dma", "//src/rp2_common/hardware_dma",
"//src/rp2_common/hardware_gpio",
"//src/rp2_common/hardware_irq", "//src/rp2_common/hardware_irq",
"//src/rp2_common/hardware_pio", "//src/rp2_common/hardware_pio",
"//src/rp2_common/hardware_sync", "//src/rp2_common/hardware_sync",
"//src/rp2_common/pico_async_context", "//src/rp2_common/pico_async_context",
"//src/rp2_common/pico_btstack", "//src/rp2_common/pico_btstack:btstack_run_loop_async_context",
"//src/rp2_common/pico_btstack:pico_btstack_base",
"//src/rp2_common/pico_btstack:pico_btstack_flash_bank",
"//src/rp2_common/pico_unique_id", "//src/rp2_common/pico_unique_id",
"@cyw43-driver//:cyw43_driver",
], ],
) )
pico_generate_pio_header(
name = "cyw43_bus_pio",
srcs = ["cyw43_bus_pio_spi.pio"],
)
load("@pico-sdk//bazel:defs.bzl", "compatible_with_pico_w")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "cyw43_driver",
srcs = [
"src/cyw43_ctrl.c",
"src/cyw43_ll.c",
"src/cyw43_lwip.c",
"src/cyw43_stats.c",
],
hdrs = glob(["**/*.h"]),
defines = ["CYW43_ENABLE_BLUETOOTH=1"],
includes = [
"firmware",
"src",
],
target_compatible_with = compatible_with_pico_w(),
deps = [
"@pico-sdk//src/rp2_common/pico_cyw43_driver:cyw43_configport",
"@pico-sdk//src/rp2_common/pico_lwip",
],
)
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -11,6 +13,7 @@ cc_library( ...@@ -11,6 +13,7 @@ cc_library(
"-Wl,--wrap=__aeabi_uidivmod", "-Wl,--wrap=__aeabi_uidivmod",
"-Wl,--wrap=__aeabi_uldivmod", "-Wl,--wrap=__aeabi_uldivmod",
], ],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/rp2_common/hardware_divider", "//src/rp2_common/hardware_divider",
"//src/rp2_common/pico_platform", "//src/rp2_common/pico_platform",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -73,6 +75,7 @@ cc_library( ...@@ -73,6 +75,7 @@ cc_library(
"-Wl,--wrap=log1p", "-Wl,--wrap=log1p",
"-Wl,--wrap=fma", "-Wl,--wrap=fma",
], ],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base", "//src/common/pico_base",
"//src/rp2_common/hardware_divider", "//src/rp2_common/hardware_divider",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
name = "pico_fix", name = "pico_fix",
target_compatible_with = compatible_with_rp2(),
) )
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -5,6 +7,7 @@ cc_library( ...@@ -5,6 +7,7 @@ cc_library(
srcs = ["rp2040_usb_device_enumeration.c"], srcs = ["rp2040_usb_device_enumeration.c"],
hdrs = ["include/pico/fix/rp2040_usb_device_enumeration.h"], hdrs = ["include/pico/fix/rp2040_usb_device_enumeration.h"],
includes = ["include"], includes = ["include"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base", "//src/common/pico_base",
"//src/common/pico_time", "//src/common/pico_time",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -5,10 +7,7 @@ cc_library( ...@@ -5,10 +7,7 @@ cc_library(
srcs = ["flash.c"], srcs = ["flash.c"],
hdrs = ["include/pico/flash.h"], hdrs = ["include/pico/flash.h"],
includes = ["include"], includes = ["include"],
# Missing deps for: target_compatible_with = compatible_with_rp2(),
# FreeRTOS.h
# task.h
tags = ["manual"],
deps = [ deps = [
"//src/common/pico_base", "//src/common/pico_base",
"//src/common/pico_time", "//src/common/pico_time",
...@@ -16,5 +15,8 @@ cc_library( ...@@ -16,5 +15,8 @@ cc_library(
"//src/rp2_common/hardware_flash", "//src/rp2_common/hardware_flash",
"//src/rp2_common/hardware_sync", "//src/rp2_common/hardware_sync",
"//src/rp2_common/pico_multicore", "//src/rp2_common/pico_multicore",
], ] + select({
"//bazel/constraint:pico_freertos_unset": [],
"//conditions:default": ["//bazel/config:PICO_FREERTOS_LIB"],
}),
) )
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -73,6 +75,7 @@ cc_library( ...@@ -73,6 +75,7 @@ cc_library(
"-Wl,--wrap=log1pf", "-Wl,--wrap=log1pf",
"-Wl,--wrap=fmaf", "-Wl,--wrap=fmaf",
], ],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base", "//src/common/pico_base",
"//src/rp2_common/hardware_divider", "//src/rp2_common/hardware_divider",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -5,6 +7,7 @@ cc_library( ...@@ -5,6 +7,7 @@ cc_library(
srcs = ["i2c_slave.c"], srcs = ["i2c_slave.c"],
hdrs = ["include/pico/i2c_slave.h"], hdrs = ["include/pico/i2c_slave.h"],
includes = ["include"], includes = ["include"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/rp2_common/hardware_i2c", "//src/rp2_common/hardware_i2c",
"//src/rp2_common/hardware_irq", "//src/rp2_common/hardware_irq",
......
load("//bazel:defs.bzl", "compatible_with_rp2")
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
cc_library( cc_library(
...@@ -6,6 +8,7 @@ cc_library( ...@@ -6,6 +8,7 @@ cc_library(
hdrs = ["include/pico/int64_ops.h"], hdrs = ["include/pico/int64_ops.h"],
includes = ["include"], includes = ["include"],
linkopts = ["-Wl,--wrap=__aeabi_lmul"], linkopts = ["-Wl,--wrap=__aeabi_lmul"],
target_compatible_with = compatible_with_rp2(),
deps = [ deps = [
"//src/common/pico_base", "//src/common/pico_base",
"//src/rp2_common/pico_platform", "//src/rp2_common/pico_platform",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment