cmake: define and create KCONFIG_BINARY_DIR if it doesn't exists

The Zephyr CMake module kconfig.cmake will create files inside
KCONFIG_BINARY_DIR.

In a default Zephyr build setup, this directory is created by Zephyr
CMake module zephyr_module.cmake. But Zephyr CMake modules are modular
and thus it must be possible to use kconfig module without
zephyr_module.

Thus kconfig.cmake must set and create KCONFIG_BINARY_DIR if it does not
already exists.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2022-08-05 10:13:58 +02:00 committed by Carles Cufí
commit a450c663f2

View file

@ -19,6 +19,9 @@ file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/kconfig/include/config)
set_ifndef(KCONFIG_NAMESPACE "CONFIG")
set_ifndef(KCONFIG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/Kconfig)
file(MAKE_DIRECTORY ${KCONFIG_BINARY_DIR})
# Support multiple SOC_ROOT, remove ZEPHYR_BASE as that is always sourced.
set(kconfig_soc_root ${SOC_ROOT})
list(REMOVE_ITEM kconfig_soc_root ${ZEPHYR_BASE})