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 <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2024-05-23 14:37:09 +02:00 committed by Fabio Baltieri
commit e65c6328ce

View file

@ -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().