pico_btstack: allow pico_btstack_make_gatt_header to be called more than once per target #2951
No reviewers
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk!2951
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-btstack-make-gatt-header-multiple"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #2829.
pico_btstack_make_gatt_header()(insrc/rp2_common/pico_btstack/CMakeLists.txt) builds its internal custom-target name as"${TARGET_LIB}_gatt_header", which collides on the second call with the sameTARGET_LIB. Configure fails with:This prevents a single executable / library from owning more than one
.gattfile. The reporter even proposed the one-line fix - disambiguate the target name with the.gattfile's base name (already extracted intoGATT_NAMEa few lines above):GATT_BINARY_DIRand the include directory added viatarget_include_directoriesare derived fromTARGET_GATT, so each.gattfile also gets its own output directory automatically.End-to-end verification
Out-of-tree consumer (rp2350 / pico2_w) that calls the function twice on a single executable target:
origin/develop(no fix)gatt_double_a_gatt_headerandgatt_double_b_gatt_headerrunscompile_gatt.pytwice, producinggenerated/gatt_double_a_gatt_header/a.handgenerated/gatt_double_b_gatt_header/b.hwith the respective.gattcontentsCompatibility
The custom-target name and its derived
GATT_BINARY_DIRchange shape, but neither is part of the public API - they're internal to the function and only consumed bytarget_include_directoriesandadd_dependenciesinside the same function body. The generated header name (${GATT_NAME}.h) is unchanged, so#include \"foo.h\"continues to work the same way.Test plan
origin/developwith an out-of-tree consumer that calls the function twice (got the duplicate-target error)._gatt_headersub-targets build, producing two distinct*.hfiles.cmake --build buildforPICO_PLATFORM=rp2040 PICO_BOARD=pico(no in-tree consumer of this function, so this confirms there is no syntax regression).Change looks ok. Please remove "Co-Authored-By: Claude" line from commit message
Force-pushed to drop the
Co-Authored-Bytrailer. New HEAD:9779911e.@peterharperuk please merge if u r haopy