90e236581e
Fixes: #40389 This commit implements zephyr_get(<variable>). The purpose of zephyr_get(<variable>) is to ensure a uniform way to handle variables which can be defined as: - CMake cache variable, for example `-D<var>=<value>`. - Environment variable - Locally in CMakeLists.txt file before `find_package(Zephyr)` It furthermore ensures that if an environment setting hides a local setting then a warning is printed. using zephyr_get(<var>) removes the need for constructs like: set_ifndef(<var> "$ENV{<var>}") set(<var> ${<var>} CACHE PATH "") if(NOT DEFINED <var>) set(<var> $ENV{<var>}) endif() if (NOT DEFINED ENV{<var>}) message(FATAL_ERROR <error>) endif() and also ensures identical preference order for variables used in Zephyr 1. cache 2. environment 3. local scope var It also ensures the variables supported through environment can also be set using `-D<var>=<value>` Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no> |
||
---|---|---|
.. | ||
arch.cmake | ||
boards.cmake | ||
ccache.cmake | ||
configuration_files.cmake | ||
doc.cmake | ||
dts.cmake | ||
extensions.cmake | ||
FindDeprecated.cmake | ||
FindDtc.cmake | ||
FindHostTools.cmake | ||
FindTargetTools.cmake | ||
FindZephyr-sdk.cmake | ||
kconfig.cmake | ||
kernel.cmake | ||
python.cmake | ||
root.cmake | ||
shields.cmake | ||
soc.cmake | ||
unittest.cmake | ||
user_cache.cmake | ||
version.cmake | ||
west.cmake | ||
zephyr_default.cmake | ||
zephyr_module.cmake |