Skip to content

Commit

Permalink
sysbuild: check for existence of APPLICATION_CONFIG_DIR
Browse files Browse the repository at this point in the history
Check for existence of APPLICATION_CONFIG_DIR in sysbuild.
sysbuild.conf is an optional file, meaning that sysbuild will not fail
if APPLICATION_CONFIG_DIR points to a non-existing folder.

A normal Zephyr build already fails when passing an invalid
APPLICATION_CONFIG_DIR but only because it cannot find a required
prj.conf in the folder.

Checking the existence of APPLICATION_CONFIG_DIR in sysbuild and fail
the build when a non-existing folder is passed to sysbuild ensures
sysbuild behaves similar to a normal Zephyr build regarding a
non-existing folder, while still allow sysbuild.conf itself to be
optional.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
  • Loading branch information
tejlmand authored and nashif committed Jun 27, 2024
1 parent ed8d70c commit 6f5b183
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions share/sysbuild/cmake/modules/sysbuild_kconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ if(NOT DEFINED SB_CONF_FILE)
set(SB_CONF_FILE ${CMAKE_CURRENT_BINARY_DIR}/empty.conf)
endif()

if(NOT EXISTS "${APPLICATION_CONFIG_DIR}")
message(FATAL_ERROR "${APPLICATION_CONFIG_DIR} (APPLICATION_CONFIG_DIR) doesn't exist. "
"Unable to lookup sysbuild.conf or other related sysbuild configuration files. "
"Please ensure APPLICATION_CONFIG_DIR points to a valid location."
)
endif()

# Empty files to make kconfig.py happy.
file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/empty.conf)
set(APPLICATION_SOURCE_DIR ${sysbuild_toplevel_SOURCE_DIR})
Expand Down

0 comments on commit 6f5b183

Please sign in to comment.