Commit ba905d04 authored by Pieter De Gendt's avatar Pieter De Gendt Committed by Benjamin Cabé
Browse files

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: default avatarPieter De Gendt <pieter.degendt@basalte.be>
parent 775696c2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -428,6 +428,8 @@ endmacro()

# Constructor with a directory-inferred name
macro(zephyr_library)
  zephyr_check_no_arguments(zephyr_library ${ARGN})

  zephyr_library_get_current_dir_lib_name(${ZEPHYR_BASE} lib_name)
  zephyr_library_named(${lib_name})
endmacro()
@@ -452,6 +454,8 @@ endmacro()

# Constructor with an explicitly given name.
macro(zephyr_library_named name)
  zephyr_check_no_arguments(zephyr_library_named ${ARGN})

  # This is a macro because we need add_library() to be executed
  # within the scope of the caller.
  set(ZEPHYR_CURRENT_LIBRARY ${name})