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

cmake: extensions: Add macro helper for functions to have no arguments



Add zephyr_check_no_arguments that macros and functions can call to check
that no arguments are given.

Signed-off-by: default avatarPieter De Gendt <pieter.degendt@basalte.be>
parent fae619a9
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -5739,6 +5739,20 @@ macro(zephyr_check_flags_exclusive function prefix)
  endif()
endmacro()

#
# Helper macro for verifying that no unexpected arguments are provided.
#
# A FATAL_ERROR will be raised if any unexpected argument is given.
#
# Usage:
#   zephyr_check_no_arguments(<function_name> ${ARGN})
#
macro(zephyr_check_no_arguments function)
  if(${ARGC} GREATER 1)
    message(FATAL_ERROR "${function} called with unexpected argument(s): ${ARGN}")
  endif()
endmacro()

########################################################
# 7. Linkable loadable extensions (llext)
########################################################