]> granicus.if.org Git - esp-idf/commitdiff
cmake: list items in component config via alphabetical component name
authorRenz Christian Bagaporo <renz@espressif.com>
Tue, 11 Dec 2018 02:33:09 +0000 (10:33 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Thu, 20 Dec 2018 11:08:00 +0000 (19:08 +0800)
tools/cmake/kconfig.cmake

index 05976aca66bd9b9efda1de7002186b16f5c12c5b..e2e05c107b39cfad99d3d0bebf13b1ef33254bef 100644 (file)
@@ -77,9 +77,20 @@ function(kconfig_process_config)
     set(kconfigs)
     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
     # if any of these change, cmake should rerun
-    foreach(dir ${BUILD_COMPONENT_PATHS})
+    foreach(dir ${component_paths})
         file(GLOB kconfig "${dir}/Kconfig")
         if(kconfig)
             set(kconfigs "${kconfigs} ${kconfig}")