feat(cmakev2/kconfig): Added support for Kconfig target creation

The following functions are added to tools/cmakev2/kconfig.cmake:
- __create_kconfig_targets(): Calls other target creation functions.
- __create_menuconfig_target(): Creates menuconfig target.
- __create_confserver_target(): Creates confserver target.
- __create_save_defconfig_target(): Creates save-defconf target.
This commit is contained in:
Sudeep Mohanty
2025-11-04 07:48:12 +01:00
committed by Frantisek Hrbata
parent be176a0a6d
commit 5235b32232
2 changed files with 16 additions and 1 deletions
+2
View File
@@ -355,6 +355,8 @@ __generate_sdkconfig()
# This will be done iteratively until the component manager resolves all sdkconfig
# related dependencies.
# Create Kconfig targets
__create_kconfig_targets()
# Include sdkconfig.cmake
idf_build_get_property(sdkconfig_cmake __SDKCONFIG_CMAKE)
+14 -1
View File
@@ -531,6 +531,19 @@ function(__create_menuconfig_target)
set(kconfigs_path "${build_dir}/kconfigs.in")
set(kconfigs_projbuild_path "${build_dir}/kconfigs_projbuild.in")
# Newer versions of esp-idf-kconfig renamed menuconfig to esp_menuconfig
# Order matters here, we want to use esp_menuconfig if it is available
execute_process(
COMMAND "${python}" -c "import esp_menuconfig"
RESULT_VARIABLE ESP_MENUCONFIG_AVAILABLE
OUTPUT_QUIET ERROR_QUIET
)
if(ESP_MENUCONFIG_AVAILABLE EQUAL 0)
set(MENUCONFIG_CMD "${python}" -m esp_menuconfig)
else()
set(MENUCONFIG_CMD "${python}" -m menuconfig)
endif()
add_custom_target(menuconfig
# Prepare Kconfig source files
COMMAND ${prepare_cmd}
@@ -553,7 +566,7 @@ function(__create_menuconfig_target)
"IDF_TOOLCHAIN=${toolchain}"
"IDF_ENV_FPGA=${idf_env_fpga}"
"IDF_INIT_VERSION=${idf_init_version}"
${python} -m menuconfig "${root_kconfig}"
${MENUCONFIG_CMD} "${root_kconfig}"
# Post-menuconfig: insert deprecated options for backward compatibility
COMMAND ${kconfgen_cmd}
--env "IDF_TARGET=${target}"