Skip to content

CMakeLists.txt: Improve overlay search rules#146

Closed
soburi wants to merge 1 commit intozephyrproject-rtos:nextfrom
soburi:overlay_search_rule
Closed

CMakeLists.txt: Improve overlay search rules#146
soburi wants to merge 1 commit intozephyrproject-rtos:nextfrom
soburi:overlay_search_rule

Conversation

@soburi
Copy link
Copy Markdown
Member

@soburi soburi commented Jan 31, 2026

The latest Zephyr update requires path separator insertion, so we've updated it accordingly.
We've also made changes to handle board revisions.

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>
@soburi soburi marked this pull request as ready for review January 31, 2026 13:27
Copilot AI review requested due to automatic review settings January 31, 2026 13:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates how Arduino variants and devicetree overlays are located to align with recent Zephyr changes and to support per‑board revisions.

Changes:

  • In the root CMakeLists.txt, normalize NORMALIZED_BOARD_TARGET and adjust variant_dir lookup to prefer variants/${BOARD} with a fallback to variants/${NORMALIZED_BOARD_TARGET}, improving compatibility with Zephyr’s updated board naming/path rules.
  • In all Arduino sample CMakeLists.txt, change DTC_OVERLAY_FILE handling to first look for a ${NORMALIZED_BOARD_TARGET}_${BOARD_REVISION}.overlay and fall back to the base ${NORMALIZED_BOARD_TARGET}.overlay, so board revisions can use dedicated overlays.
  • Keep behavior safe when no module-specific overlay exists by not forcing DTC_OVERLAY_FILE if neither the revision-specific nor the base overlay file is present.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
CMakeLists.txt Normalizes NORMALIZED_BOARD_TARGET (replacing __ with _) and updates variant directory selection to try variants/${BOARD} first, then variants/${NORMALIZED_BOARD_TARGET}, with an updated fatal error message if neither exists.
samples/threads_arduino/CMakeLists.txt Adds conditional logic to set DTC_OVERLAY_FILE to a board‑revision overlay if it exists, otherwise to the base overlay, for the threads Arduino sample.
samples/spi_controller/CMakeLists.txt Same overlay selection logic as above, applied to the SPI controller sample.
samples/serial_event/CMakeLists.txt Same overlay selection logic as above, applied to the serial event sample.
samples/i2cdemo/CMakeLists.txt Same overlay selection logic as above, applied to the I²C demo sample.
samples/hello_arduino/CMakeLists.txt Same overlay selection logic as above, applied to the hello Arduino sample.
samples/fade/CMakeLists.txt Same overlay selection logic as above, applied to the fade sample.
samples/button_press_led/CMakeLists.txt Same overlay selection logic as above, applied to the button‑press‑LED sample.
samples/blinky_arduino/CMakeLists.txt Same overlay selection logic as above, applied to the blinky Arduino sample.
samples/attach_interrupt/CMakeLists.txt Same overlay selection logic as above, applied to the attach‑interrupt sample.
samples/analog_input/CMakeLists.txt Same overlay selection logic as above, applied to the analog input sample.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@soburi soburi closed this Feb 1, 2026
@soburi soburi deleted the overlay_search_rule branch February 1, 2026 14:08
@soburi soburi restored the overlay_search_rule branch February 1, 2026 14:08
@soburi soburi deleted the overlay_search_rule branch February 3, 2026 14:13
soburi pushed a commit to soburi/ArduinoCore-zephyr that referenced this pull request Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants