From f7f320c4940397fb6d31fd29d3673ef6684efb65 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 5 Dec 2023 13:25:56 +0000 Subject: [PATCH] sysbuild: Add support for FILE_SUFFIX Adds supports for sysbuild loading project-specific Kconfiguration fragments that are suffixed with the user-provided value Signed-off-by: Jamie McCrae --- cmake/modules/configuration_files.cmake | 3 --- .../cmake/modules/sysbuild_extensions.cmake | 14 ++++++-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/cmake/modules/configuration_files.cmake b/cmake/modules/configuration_files.cmake index d671b796105..4f2e469ab79 100644 --- a/cmake/modules/configuration_files.cmake +++ b/cmake/modules/configuration_files.cmake @@ -90,9 +90,6 @@ DTC_OVERLAY_FILE=\"dts1.overlay dts2.overlay\"") # The DTC_OVERLAY_FILE variable is now set to its final value. zephyr_boilerplate_watch(DTC_OVERLAY_FILE) -# Watch the FILE_SUFFIX variable for changes too -zephyr_boilerplate_watch(FILE_SUFFIX) - zephyr_get(EXTRA_CONF_FILE SYSBUILD LOCAL VAR EXTRA_CONF_FILE OVERLAY_CONFIG MERGE REVERSE) zephyr_get(EXTRA_DTC_OVERLAY_FILE SYSBUILD LOCAL MERGE REVERSE) zephyr_get(DTS_EXTRA_CPPFLAGS SYSBUILD LOCAL MERGE REVERSE) diff --git a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake index 980c54ef766..fea359f475b 100644 --- a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake +++ b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake @@ -268,14 +268,12 @@ function(ExternalZephyrProject_Add) ) endif() - # Check for sysbuild related configuration fragments. - # The contents of these are appended to the image existing configuration - # when user is not specifying custom fragments. - if(NOT "${CONF_FILE_BUILD_TYPE}" STREQUAL "") - set(sysbuild_image_conf_fragment ${sysbuild_image_conf_dir}/${ZBUILD_APPLICATION}_${CONF_FILE_BUILD_TYPE}.conf) - else() - set(sysbuild_image_conf_fragment ${sysbuild_image_conf_dir}/${ZBUILD_APPLICATION}.conf) - endif() + # Check for sysbuild related configuration fragments. + # The contents of these are appended to the image existing configuration + # when user is not specifying custom fragments. + zephyr_file(CONF_FILES ${sysbuild_image_conf_dir} KCONF sysbuild_image_conf_fragment + NAMES ${ZBUILD_APPLICATION}.conf SUFFIX ${FILE_SUFFIX} + ) if (NOT (${ZBUILD_APPLICATION}_OVERLAY_CONFIG OR ${ZBUILD_APPLICATION}_EXTRA_CONF_FILE) AND EXISTS ${sysbuild_image_conf_fragment}