Skip to content
Permalink
Browse files

cmake: add handling for shield config and shield/board overlays

Shields can often be very complex to setup in a generic way for several
boards to support.  Let's allow shields to have their own .conf files
as well as specialized overlays per board (when needed).

Signed-off-by: Michael Scott <mike@foundries.io>
  • Loading branch information...
mike-scott authored and nashif committed May 17, 2019
1 parent 21e9b0f commit 421b4262818917fcc9f0fbfdd8d6c17844227991
Showing with 28 additions and 0 deletions.
  1. +27 −0 cmake/app/boilerplate.cmake
  2. +1 −0 cmake/kconfig.cmake
@@ -316,6 +316,33 @@ foreach(root ${BOARD_ROOT})
else()
list(APPEND NOT_FOUND_SHIELD_LIST ${s})
endif()

# search for shield/boards/board.overlay file
if(EXISTS ${shield_dir}/${s}/boards/${BOARD}.overlay)
# add shield/board overlay to the shield overlays list
list(APPEND
shield_dts_files
${shield_dir}/${s}/boards/${BOARD}.overlay
)
endif()

# search for shield/shield.conf file
if(EXISTS ${shield_dir}/${s}/${s}.conf)
# add shield.conf to the shield config list
list(APPEND
shield_conf_files
${shield_dir}/${s}/${s}.conf
)
endif()

# search for shield/boards/board.conf file
if(EXISTS ${shield_dir}/${s}/boards/${BOARD}.conf)
# add HW specific board.conf to the shield config list
list(APPEND
shield_conf_files
${shield_dir}/${s}/boards/${BOARD}.conf
)
endif()
endforeach()
endif()
endforeach()
@@ -112,6 +112,7 @@ set(
merge_config_files
${BOARD_DEFCONFIG}
${CONF_FILE_AS_LIST}
${shield_conf_files}
${OVERLAY_CONFIG_AS_LIST}
${EXTRA_KCONFIG_OPTIONS_FILE}
${config_files}

0 comments on commit 421b426

Please sign in to comment.
You can’t perform that action at this time.