Merge branch 'bugfix/cmake_list_component_config_alphabetically' into 'master'
List menuconfig component config items alphabetically via component name See merge request idf/esp-idf!3939
This commit is contained in:
commit
16854e1f40
|
@ -63,6 +63,9 @@ call_with_python('../gen-dxd.py')
|
||||||
def find_component_files(parent_dir, target_filename):
|
def find_component_files(parent_dir, target_filename):
|
||||||
parent_dir = os.path.abspath(parent_dir)
|
parent_dir = os.path.abspath(parent_dir)
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
|
component_files = dict()
|
||||||
|
|
||||||
for (dirpath, dirnames, filenames) in os.walk(parent_dir):
|
for (dirpath, dirnames, filenames) in os.walk(parent_dir):
|
||||||
try:
|
try:
|
||||||
# note: trimming "examples" dir as MQTT submodule
|
# note: trimming "examples" dir as MQTT submodule
|
||||||
|
@ -71,8 +74,14 @@ def find_component_files(parent_dir, target_filename):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
if target_filename in filenames:
|
if target_filename in filenames:
|
||||||
result.append(os.path.join(dirpath, target_filename))
|
component_files[os.path.basename(dirpath)] = os.path.join(dirpath, target_filename)
|
||||||
print("List of %s: %s" % (target_filename, ", ".join(result)))
|
|
||||||
|
components = sorted(component_files.keys())
|
||||||
|
|
||||||
|
for component in components:
|
||||||
|
result.append(component_files[component])
|
||||||
|
|
||||||
|
print("List of %s: %s" % (target_filename, ", ".join(components)))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,9 +77,20 @@ function(kconfig_process_config)
|
||||||
set(kconfigs)
|
set(kconfigs)
|
||||||
set(kconfigs_projbuild)
|
set(kconfigs_projbuild)
|
||||||
|
|
||||||
|
# Components are usually sorted (somewhat) topologically via their dependencies. This extends to the component
|
||||||
|
# paths list. Obtain an alphabetical list in order to present menus also in the same order.
|
||||||
|
set(components ${BUILD_COMPONENTS})
|
||||||
|
list(SORT components)
|
||||||
|
|
||||||
|
foreach(component ${components})
|
||||||
|
list(FIND BUILD_COMPONENTS ${component} idx)
|
||||||
|
list(GET BUILD_COMPONENT_PATHS ${idx} component_path)
|
||||||
|
list(APPEND component_paths ${component_path})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Find Kconfig and Kconfig.projbuild for each component as applicable
|
# Find Kconfig and Kconfig.projbuild for each component as applicable
|
||||||
# if any of these change, cmake should rerun
|
# if any of these change, cmake should rerun
|
||||||
foreach(dir ${BUILD_COMPONENT_PATHS})
|
foreach(dir ${component_paths})
|
||||||
file(GLOB kconfig "${dir}/Kconfig")
|
file(GLOB kconfig "${dir}/Kconfig")
|
||||||
if(kconfig)
|
if(kconfig)
|
||||||
set(kconfigs "${kconfigs} ${kconfig}")
|
set(kconfigs "${kconfigs} ${kconfig}")
|
||||||
|
|
Loading…
Reference in a new issue