change(conf): add MINIMAL_BUILD note to menuconfig and sdkconfig

With MINIMAL_BUILD enabled, menuconfig will only display configuration
options for components included in the build through main component
dependencies. This means that configuration options for excluded
components will not appear in menuconfig. This might be confusing, as
most examples currently do not use a trimmed build, and all components
detected by the build system are available in menuconfig, even if their
configuration has no effect because the components may not be linked or
used. Adding a note in the components menu of menuconfig could help
users realize they need to add a component to the main component
requirements to see its configuration options. Unfortunately, Kconfig
does not support multiline comments, so there are three separate
comments intended to adequately describe the potentially missing
component configurations.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata 2024-10-23 16:26:12 +02:00
parent 2cc4310243
commit da1a99d5ed
2 changed files with 16 additions and 0 deletions

View File

@ -668,6 +668,13 @@ mainmenu "Espressif IoT Development Framework Configuration"
endmenu # Compiler Options
menu "Component config"
comment "!!! MINIMAL_BUILD is enabled !!!"
depends on "${IDF_MINIMAL_BUILD}"
comment "Only common components and those transitively required by the main component are listed"
depends on "${IDF_MINIMAL_BUILD}"
comment "If a component configuration is missing, please add it to the main component's requirements"
depends on "${IDF_MINIMAL_BUILD}"
source "$COMPONENT_KCONFIGS_SOURCE_FILE"
endmenu

View File

@ -129,6 +129,13 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
idf_build_get_property(idf_toolchain IDF_TOOLCHAIN)
idf_build_get_property(idf_path IDF_PATH)
idf_build_get_property(idf_env_fpga __IDF_ENV_FPGA)
idf_build_get_property(idf_minimal_build MINIMAL_BUILD)
if(idf_minimal_build)
set(idf_minimal_build "y")
else()
set(idf_minimal_build "n")
endif()
# These are the paths for files which will contain the generated "source" lines for COMPONENT_KCONFIGS and
# COMPONENT_KCONFIGS_PROJBUILD
@ -167,6 +174,7 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
--sdkconfig-rename ${root_sdkconfig_rename}
--config ${sdkconfig}
${defaults_arg}
--env "IDF_MINIMAL_BUILD=${idf_minimal_build}"
--env-file ${config_env_path})
idf_build_get_property(build_dir BUILD_DIR)
@ -256,6 +264,7 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
"IDF_TOOLCHAIN=${idf_toolchain}"
"IDF_ENV_FPGA=${idf_env_fpga}"
"IDF_INIT_VERSION=${idf_init_version}"
"IDF_MINIMAL_BUILD=${idf_minimal_build}"
${MENUCONFIG_CMD} ${root_kconfig}
USES_TERMINAL
# additional run of kconfgen esures that the deprecated options will be inserted into sdkconfig (for backward