Commit e1c1d1da authored by Torsten Rasmussen's avatar Torsten Rasmussen Committed by Carles Cufi
Browse files

cmake: make find_package(ZephyrUnittest...) REQUIRED



This commit is a followup to PR #25808 which updates the tests to
ensure the REQUIRED keyword is also used for the ZephyrUnitest package.

This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry.

Signed-off-by: default avatarTorsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
parent a8e06558
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -9,10 +9,10 @@
# one of those lines:
#
# find_package(Zephyr)
# find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
# find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
#
# The `HINTS $ENV{ZEPHYR_BASE}` variant is required for any application inside
# the Zephyr repository.
# The `REQUIRED HINTS $ENV{ZEPHYR_BASE}` variant is required for any application
# inside the Zephyr repository.
#
# It exists to reduce boilerplate code that Zephyr expects to be in
# application CMakeLists.txt code.
+1 −1
Original line number Diff line number Diff line
@@ -2,4 +2,4 @@

project(base64)
set(SOURCES main.c)
find_package(ZephyrUnittest HINTS $ENV{ZEPHYR_BASE})
find_package(ZephyrUnittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
+1 −1
Original line number Diff line number Diff line
@@ -2,4 +2,4 @@

project(crc)
set(SOURCES main.c)
find_package(ZephyrUnittest HINTS $ENV{ZEPHYR_BASE})
find_package(ZephyrUnittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
+1 −1
Original line number Diff line number Diff line
@@ -4,4 +4,4 @@ project(base64)
set(SOURCES
  main.c
  )
find_package(ZephyrUnittest HINTS $ENV{ZEPHYR_BASE})
find_package(ZephyrUnittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
+1 −1
Original line number Diff line number Diff line
@@ -7,4 +7,4 @@ set(SOURCES
  dlist.c
  sflist.c
  )
find_package(ZephyrUnittest HINTS $ENV{ZEPHYR_BASE})
find_package(ZephyrUnittest REQUIRED HINTS $ENV{ZEPHYR_BASE})
Loading