mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
fix(cmakev2/kconfig): remove --env-file argument from base kconfgen command
The current base kconfgen command is stored in the __BASE_KCONFGEN_CMD build property, and it includes the --env-file option pointing to the `build/config.env` file. The `build/config.env` file does not separate component configuration files into included and excluded components, because it is created before any executable is added and we need it for the initial sdkconfig generation. The global `build/config.env` can be used for every sdkconfig format (cmake, json, txt), but not for the kconfig_menus.json format, because kconfig_menus.json relies on the Kconfig layout and hierarchy. Let's allow specifying the --env-file for each kconfgen invocation and remove it from the base kconfgen command. This allows you to specify an --env-file for each executable, each with its own config.env file. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -588,7 +588,6 @@ function(__create_base_kconfgen_command sdkconfig sdkconfig_defaults)
|
||||
idf_build_get_property(python PYTHON)
|
||||
idf_build_get_property(root_kconfig __ROOT_KCONFIG)
|
||||
idf_build_get_property(root_sdkconfig_rename __ROOT_SDKCONFIG_RENAME)
|
||||
idf_build_get_property(config_env_path __CONFIG_ENV_PATH)
|
||||
idf_build_get_property(target IDF_TARGET)
|
||||
|
||||
# Set up defaults arguments
|
||||
@@ -609,8 +608,7 @@ function(__create_base_kconfgen_command sdkconfig sdkconfig_defaults)
|
||||
--sdkconfig-rename "${root_sdkconfig_rename}"
|
||||
--config "${sdkconfig}"
|
||||
${defaults_args}
|
||||
--env "IDF_BUILD_V2=y"
|
||||
--env-file "${config_env_path}")
|
||||
--env "IDF_BUILD_V2=y")
|
||||
|
||||
# Store base command as a build property
|
||||
idf_build_set_property(__BASE_KCONFGEN_CMD "${base_kconfgen_cmd}")
|
||||
@@ -627,6 +625,7 @@ function(__run_kconfgen)
|
||||
idf_build_get_property(base_kconfgen_cmd __BASE_KCONFGEN_CMD)
|
||||
idf_build_get_property(kconfgen_outputs_cmd __KCONFGEN_OUTPUTS_CMD)
|
||||
idf_build_get_property(sdkconfig SDKCONFIG)
|
||||
idf_build_get_property(config_env_path __CONFIG_ENV_PATH)
|
||||
|
||||
# Create full command with output file paths
|
||||
set(kconfgen_cmd ${base_kconfgen_cmd} ${kconfgen_outputs_cmd})
|
||||
@@ -634,6 +633,7 @@ function(__run_kconfgen)
|
||||
idf_dbg("Running kconfgen: ${kconfgen_cmd}")
|
||||
execute_process(
|
||||
COMMAND ${kconfgen_cmd}
|
||||
--env-file "${config_env_path}"
|
||||
RESULT_VARIABLE kconfgen_result
|
||||
)
|
||||
|
||||
@@ -736,6 +736,7 @@ function(idf_create_menuconfig executable)
|
||||
--env "IDF_INIT_VERSION=${idf_init_version}"
|
||||
--dont-write-deprecated
|
||||
${kconfgen_outputs_cmd}
|
||||
--env-file "${config_env_dir}/config.env"
|
||||
# Check terminal capabilities
|
||||
COMMAND ${python} "${idf_path}/tools/check_term.py"
|
||||
# Run menuconfig
|
||||
@@ -758,6 +759,7 @@ function(idf_create_menuconfig executable)
|
||||
--env "IDF_ENV_FPGA=${idf_env_fpga}"
|
||||
--env "IDF_INIT_VERSION=${idf_init_version}"
|
||||
${kconfgen_outputs_cmd}
|
||||
--env-file "${config_env_dir}/config.env"
|
||||
USES_TERMINAL
|
||||
COMMENT "Running menuconfig..."
|
||||
)
|
||||
@@ -802,6 +804,7 @@ endfunction()
|
||||
#]]
|
||||
function(idf_create_save_defconfig)
|
||||
idf_build_get_property(prepare_cmd __PREPARE_KCONFIG_CMD)
|
||||
idf_build_get_property(config_env_path __CONFIG_ENV_PATH)
|
||||
idf_build_get_property(kconfgen_cmd __BASE_KCONFGEN_CMD)
|
||||
|
||||
add_custom_target(save-defconfig
|
||||
@@ -811,6 +814,7 @@ function(idf_create_save_defconfig)
|
||||
COMMAND ${kconfgen_cmd}
|
||||
--dont-write-deprecated
|
||||
--output savedefconfig "${CMAKE_SOURCE_DIR}/sdkconfig.defaults"
|
||||
--env-file "${config_env_path}"
|
||||
USES_TERMINAL
|
||||
COMMENT "Saving defconfig..."
|
||||
VERBATIM
|
||||
|
||||
Reference in New Issue
Block a user