From e65c6328ce32195296ef4138f19e38c0be26ef45 Mon Sep 17 00:00:00 2001 From: Torsten Rasmussen Date: Thu, 23 May 2024 14:37:09 +0200 Subject: [PATCH] sysbuild: use ARGN instead of ARGV1 Use of ARGV1 is undefined when number of arguments to function is less than 2. Therefore switch to ARGN which holds arguments beyond required arguments. If there are no optional arguments, then ARGN is just an empty list, thus making it safe to use. Signed-off-by: Torsten Rasmussen --- share/sysbuild/cmake/modules/sysbuild_extensions.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake index ce0af2fe7b3..acbc5706e69 100644 --- a/share/sysbuild/cmake/modules/sysbuild_extensions.cmake +++ b/share/sysbuild/cmake/modules/sysbuild_extensions.cmake @@ -661,7 +661,7 @@ function(sysbuild_add_subdirectory source_dir) " (expected at most 2, got ${ARGC})" ) endif() - set(binary_dir ${ARGV1}) + set(binary_dir ${ARGN}) # Update SYSBUILD_CURRENT_SOURCE_DIR in this scope, to support nesting # of sysbuild_add_subdirectory() and even regular add_subdirectory().