Commit f8e0a0c5 authored by Martí Bolívar's avatar Martí Bolívar Committed by Anas Nashif
Browse files

cmake: extensions: add assert_not()



To be used in a later patch.

Signed-off-by: default avatarMarti Bolivar <marti@opensourcefoundries.com>
parent 0fba4bf2
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -801,6 +801,17 @@ macro(assert test comment)
  endif()
endmacro()

# Usage:
#   assert_not(FLASH_SCRIPT "FLASH_SCRIPT has been removed; use BOARD_FLASH_RUNNER")
#
# will cause a FATAL_ERROR and print an errorm essage if the first
# espression is true
macro(assert_not test comment)
  if(${test})
    message(FATAL_ERROR "Assertion failed: ${comment}")
  endif()
endmacro()

# Usage:
#   assert_exists(CMAKE_READELF)
#