Skip to content

Commit ba905d0

Browse files
pdgendtkartben
authored andcommitted
cmake: extensions: Check no arguments are given to zephyr_library
The zephyr_library macro does not expect any arguments, add a check for that and similar for zephyr_library_named for no unexpected additional arguments. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent 775696c commit ba905d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/modules/extensions.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ endmacro()
428428

429429
# Constructor with a directory-inferred name
430430
macro(zephyr_library)
431+
zephyr_check_no_arguments(zephyr_library ${ARGN})
432+
431433
zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name)
432434
zephyr_library_named(${lib_name})
433435
endmacro()
@@ -452,6 +454,8 @@ endmacro()
452454

453455
# Constructor with an explicitly given name.
454456
macro(zephyr_library_named name)
457+
zephyr_check_no_arguments(zephyr_library_named ${ARGN})
458+
455459
# This is a macro because we need add_library() to be executed
456460
# within the scope of the caller.
457461
set(ZEPHYR_CURRENT_LIBRARY ${name})

0 commit comments

Comments
 (0)