cmake: Set PYTHON_EXECUTABLE env var with kconfig
In order to be able to invoke Python from Kconfig files, set the path to the Python executable (which can be python, python3, py -3, etc) as an environment variable so that Kconfig shell invocations can use it like: config MY_OPTION string "My option string" default "$(shell,$(PYTHON_EXECUTABLE) \ $(ZEPHYR_BASE)\scripts\script.py)" Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
325954de8f
commit
8ba60342cf
1 changed files with 2 additions and 0 deletions
|
@ -23,6 +23,7 @@ endif()
|
||||||
set(ENV{srctree} ${ZEPHYR_BASE})
|
set(ENV{srctree} ${ZEPHYR_BASE})
|
||||||
set(ENV{KERNELVERSION} ${KERNELVERSION})
|
set(ENV{KERNELVERSION} ${KERNELVERSION})
|
||||||
set(ENV{KCONFIG_CONFIG} ${DOTCONFIG})
|
set(ENV{KCONFIG_CONFIG} ${DOTCONFIG})
|
||||||
|
set(ENV{PYTHON_EXECUTABLE} ${PYTHON_EXECUTABLE})
|
||||||
|
|
||||||
# Set environment variables so that Kconfig can prune Kconfig source
|
# Set environment variables so that Kconfig can prune Kconfig source
|
||||||
# files for other architectures
|
# files for other architectures
|
||||||
|
@ -33,6 +34,7 @@ set(ENV{SOC_DIR} ${SOC_DIR})
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
menuconfig
|
menuconfig
|
||||||
${CMAKE_COMMAND} -E env
|
${CMAKE_COMMAND} -E env
|
||||||
|
PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
|
||||||
srctree=${ZEPHYR_BASE}
|
srctree=${ZEPHYR_BASE}
|
||||||
KERNELVERSION=${KERNELVERSION}
|
KERNELVERSION=${KERNELVERSION}
|
||||||
KCONFIG_CONFIG=${DOTCONFIG}
|
KCONFIG_CONFIG=${DOTCONFIG}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue