Merge branch 'fix/menuconfig-reload-sdkconfig-json' into 'master'

fix: make sure sdkconfig.json is updated after running the menuconfig

See merge request espressif/esp-idf!41495
This commit is contained in:
Fu Hanxi
2025-08-26 16:36:54 +02:00

View File

@@ -216,30 +216,23 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
set(sdkconfig_json ${config_dir}/sdkconfig.json)
set(sdkconfig_json_menus ${config_dir}/kconfig_menus.json)
set(kconfgen_output_options
--output header ${sdkconfig_header}
--output cmake ${sdkconfig_cmake}
--output json ${sdkconfig_json}
--output json_menus ${sdkconfig_json_menus})
idf_build_get_property(output_sdkconfig __OUTPUT_SDKCONFIG)
if(output_sdkconfig)
execute_process(
COMMAND ${prepare_kconfig_files_command})
execute_process(
COMMAND ${kconfgen_basecommand}
--output header ${sdkconfig_header}
--output cmake ${sdkconfig_cmake}
--output json ${sdkconfig_json}
--output json_menus ${sdkconfig_json_menus}
--output config ${sdkconfig}
RESULT_VARIABLE config_result)
else()
execute_process(
COMMAND ${prepare_kconfig_files_command})
execute_process(
COMMAND ${kconfgen_basecommand}
--output header ${sdkconfig_header}
--output cmake ${sdkconfig_cmake}
--output json ${sdkconfig_json}
--output json_menus ${sdkconfig_json_menus}
RESULT_VARIABLE config_result)
list(APPEND kconfgen_output_options --output config ${sdkconfig})
endif()
execute_process(
COMMAND ${prepare_kconfig_files_command})
execute_process(
COMMAND ${kconfgen_basecommand}
${kconfgen_output_options}
RESULT_VARIABLE config_result)
if(config_result)
message(FATAL_ERROR "Failed to run kconfgen (${kconfgen_basecommand}). Error ${config_result}")
endif()
@@ -298,7 +291,7 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
--env "IDF_ENV_FPGA=${idf_env_fpga}"
--env "IDF_INIT_VERSION=${idf_init_version}"
--dont-write-deprecated
--output config ${sdkconfig}
${kconfgen_output_options}
COMMAND ${TERM_CHECK_CMD}
COMMAND ${CMAKE_COMMAND} -E env
"COMPONENT_KCONFIGS_SOURCE_FILE=${kconfigs_path}"
@@ -318,7 +311,7 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
--env "IDF_TOOLCHAIN=${idf_toolchain}"
--env "IDF_ENV_FPGA=${idf_env_fpga}"
--env "IDF_INIT_VERSION=${idf_init_version}"
--output config ${sdkconfig}
${kconfgen_output_options}
)
# Custom target to run kconfserver from the build tool