diff --git a/share/sysbuild/cmake/domains.cmake b/share/sysbuild/cmake/domains.cmake index 68cbd8c63df..a4905e6e111 100644 --- a/share/sysbuild/cmake/domains.cmake +++ b/share/sysbuild/cmake/domains.cmake @@ -6,6 +6,10 @@ set(domains_yaml "default: ${DEFAULT_IMAGE}") set(domains_yaml "${domains_yaml}\nbuild_dir: ${CMAKE_BINARY_DIR}") set(domains_yaml "${domains_yaml}\ndomains:") foreach(image ${IMAGES}) + get_target_property(image_is_build_only ${image} BUILD_ONLY) + if(image_is_build_only) + continue() + endif() set(domains_yaml "${domains_yaml}\n - name: ${image}") set(domains_yaml "${domains_yaml}\n build_dir: $") endforeach() diff --git a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake index bdf8f88b805..c4e90f96135 100644 --- a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake +++ b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake @@ -125,10 +125,13 @@ endfunction() # For example, -DCONF_FILES= will be passed on to the # MAIN_APP unmodified. # BOOTLOADER indicates this app is a bootloader +# BUILD_ONLY : Mark the application as build-only. If evaluates to +# true, then this application will be excluded from flashing +# and debugging. # function(ExternalZephyrProject_Add) set(app_types MAIN BOOTLOADER) - cmake_parse_arguments(ZBUILD "" "APPLICATION;BOARD;BOARD_REVISION;SOURCE_DIR;APP_TYPE" "" ${ARGN}) + cmake_parse_arguments(ZBUILD "" "APPLICATION;BOARD;BOARD_REVISION;SOURCE_DIR;APP_TYPE;BUILD_ONLY" "" ${ARGN}) if(ZBUILD_UNPARSED_ARGUMENTS) message(FATAL_ERROR @@ -279,6 +282,10 @@ function(ExternalZephyrProject_Add) " requires BOARD." ) endif() + + if(DEFINED ZBUILD_BUILD_ONLY) + set_target_properties(${ZBUILD_APPLICATION} PROPERTIES BUILD_ONLY ${ZBUILD_BUILD_ONLY}) + endif() endfunction() # Usage: