Add opt-in CMakeLists.txt exporting a dotbot_libs INTERFACE target#20
Closed
geonnave wants to merge 3 commits into
Closed
Add opt-in CMakeLists.txt exporting a dotbot_libs INTERFACE target#20geonnave wants to merge 3 commits into
geonnave wants to merge 3 commits into
Conversation
…rget AI-assisted: Claude Opus 4.7
AI-assisted: Claude Opus 4.7
…RFACE dotbot-libs is the deepest shared dep across the workspace's CMake firmware repos, so centralizing the nrfx / CMSIS_5 pin here gives every downstream consumer one source of truth instead of redeclaring the same FetchContent block in each. dotbot_libs propagates the headers transitively; a lighter dotbot_nordic INTERFACE is exposed for consumers (e.g. swarmit bootloader, netcore) that ship their own startup and want the headers without dotbot-libs's cpu.c. AI-assisted: Claude Opus 4.7
Contributor
Author
|
Closing this for now as premature, just as other cmake PRs of last week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First step toward CMake +
gcc-arm-none-eabisupport in dotbot-libs. Adds a top-levelCMakeLists.txtexporting adotbot_libsINTERFACE target that downstream CMake projects can consume:Strictly additive. Existing SES
.emProjectprojects continue to work unchanged — no source file moved, no build flag set globally. Only consumers that opt into CMake see this target.Why INTERFACE +
target_sourcesinstead of STATICdotbot-libs source files behave differently per consumer — most notably
bsp/gpio.hflips betweenNRF_P0_SandNRF_P0_NSbased onNRF_TRUSTZONE_NONSECURE. A single STATIC library compiled once can't serve both bare and TrustZone-non-secure apps in the same build. INTERFACE +target_sourceslets each consumer compile the same sources under its own define set, which matters when a project mixes both modes (e.g., a CMake-based version of swarmit-firmware would have a secure bootloader and a non-secure sandbox app side by side).Scope of this first cut
Only sources that have been validated under
gcc-arm-none-eabifor nRF5340 app core (via theproto-dotbot-firmwareprototype, against real DotBot v3 hardware):bsp/nrf/:board.c,gpio.c,pwm.c,timer.cdrv/:motors/motors.c,rgbled/rgbled.cSubsequent PRs (separate, smaller, easier to review) will add:
lh2_defaultvslh2_nrf5340_net,radio_defaultvsradio_nrf5340_app)control_loop,lh2,hdlc,imu, sensorscrypto/nrf_cc310/blobConsumer responsibilities
Documented in the
CMakeLists.txtheader comment:gcc-arm-none-eabirecommended; the prototype uses Homebrew'sgcc-arm-embeddedcask on macOS).FetchContentNordicSemiconductor/nrfx(usemdk/) andARM-software/CMSIS_5(useCMSIS/Core/Include).Reset_Handler.Validated
Three CMake targets in the
proto-dotbot-firmwareprototype have been switched from hand-listing dotbot-libs sources totarget_link_libraries(... dotbot_libs), rebuilt cleanly:The sandbox build correctly inherits
NRF_TRUSTZONE_NONSECUREfrom its own target — same dotbot-libs sources compile differently per consumer, which is exactly the property INTERFACE buys us.