CMakeLists.txt: Improve overlay search rules#150
CMakeLists.txt: Improve overlay search rules#150DhruvaG2000 merged 1 commit intozephyrproject-rtos:nextfrom
Conversation
The latest Zephyr update requires path separator insertion, so we've updated it accordingly. We've also made changes to handle board revisions. Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR updates CMakeLists.txt files across the codebase to improve overlay search rules for compatibility with the latest Zephyr updates. The changes implement path separator handling (converting double underscores to single underscores) and add support for board revision-specific overlay files.
Changes:
- Modified main CMakeLists.txt to replace double underscores with single underscores in NORMALIZED_BOARD_TARGET and update variant directory search logic
- Added board revision support to all sample CMakeLists.txt files, allowing revision-specific overlay files to take precedence over generic ones
- Updated error messages to reflect new search paths
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Adds string replacement for path separators and updates variant directory search to check BOARD first, then NORMALIZED_BOARD_TARGET |
| samples/threads_arduino/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/spi_controller/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/serial_event/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/i2cdemo/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/hello_arduino/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/fade/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/button_press_led/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/blinky_arduino/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/attach_interrupt/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
| samples/analog_input/CMakeLists.txt | Adds conditional overlay file search supporting board revisions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
There's a lot more this time too. |
|
@soburi I was wondering, what should be our strategy with backward compatibility? Like if someone's using an older version of zephyr and things may break for them right? Do we only support the bleeding edge of zephyr RTOS? |
First of all, this software is still in development and has not yet been officially released. From this perspective, I see no choice but to update to the latest Zephyr at this time. Zephyr does not guarantee permanent API compatibility, so I think we'll follow that. The migration guide clearly states API changes, so backward compatibility may not be maintained "if necessary." So, while realistically, frequent API changes are not a good idea, I think it's reasonable to make changes if necessary by providing an acceptable migration path. In the long term, I think we'll release ArduinoCore-Zephyr versions corresponding to Zephyr releases and clearly indicate the support period. Note: This PR change should not affect backward compatibility. |
The latest Zephyr update requires path separator insertion, so we've updated it accordingly.
We've also made changes to handle board revisions.