kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/filter_out_readme_searching_components' into 'master'
cmake: allow to have README file in the components folder See merge request espressif/esp-idf!15330pull/7439/head^2
commit
3e370c4296
|
@ -150,10 +150,12 @@ function(__build_init idf_path)
|
|||
file(GLOB component_dirs ${idf_path}/components/*)
|
||||
list(SORT component_dirs)
|
||||
foreach(component_dir ${component_dirs})
|
||||
get_filename_component(component_dir ${component_dir} ABSOLUTE)
|
||||
__component_dir_quick_check(is_component ${component_dir})
|
||||
if(is_component)
|
||||
__component_add(${component_dir} ${prefix})
|
||||
# A potential component must be a directory
|
||||
if(IS_DIRECTORY ${component_dir})
|
||||
__component_dir_quick_check(is_component ${component_dir})
|
||||
if(is_component)
|
||||
__component_add(${component_dir} ${prefix})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
|
|
@ -97,16 +97,11 @@ function(__component_dir_quick_check var component_dir)
|
|||
set(res 1)
|
||||
get_filename_component(abs_dir ${component_dir} ABSOLUTE)
|
||||
|
||||
# Check this is really a directory and that a CMakeLists.txt file for this component exists
|
||||
# - warn and skip anything which isn't valid looking (probably cruft)
|
||||
if(NOT IS_DIRECTORY "${abs_dir}")
|
||||
message(STATUS "Unexpected file in components directory: ${abs_dir}")
|
||||
set(res 0)
|
||||
endif()
|
||||
|
||||
get_filename_component(base_dir ${abs_dir} NAME)
|
||||
string(SUBSTRING "${base_dir}" 0 1 first_char)
|
||||
|
||||
# Check the component directory contains a CMakeLists.txt file
|
||||
# - warn and skip anything which isn't valid looking (probably cruft)
|
||||
if(NOT first_char STREQUAL ".")
|
||||
if(NOT EXISTS "${abs_dir}/CMakeLists.txt")
|
||||
message(STATUS "Component directory ${abs_dir} does not contain a CMakeLists.txt file. "
|
||||
|
|
|
@ -157,13 +157,14 @@ function(__project_init components_var test_components_var)
|
|||
|
||||
function(__project_component_dir component_dir)
|
||||
get_filename_component(component_dir "${component_dir}" ABSOLUTE)
|
||||
# The directory itself is a valid idf component
|
||||
if(EXISTS ${component_dir}/CMakeLists.txt)
|
||||
idf_build_component(${component_dir})
|
||||
else()
|
||||
# otherwise, check whether the subfolders are potential idf components
|
||||
file(GLOB component_dirs ${component_dir}/*)
|
||||
foreach(component_dir ${component_dirs})
|
||||
if(EXISTS ${component_dir}/CMakeLists.txt)
|
||||
get_filename_component(base_dir ${component_dir} NAME)
|
||||
if(IS_DIRECTORY ${component_dir})
|
||||
__component_dir_quick_check(is_component ${component_dir})
|
||||
if(is_component)
|
||||
idf_build_component(${component_dir})
|
||||
|
@ -205,9 +206,11 @@ function(__project_init components_var test_components_var)
|
|||
file(GLOB bootloader_component_dirs "${CMAKE_CURRENT_LIST_DIR}/bootloader_components/*")
|
||||
list(SORT bootloader_component_dirs)
|
||||
foreach(bootloader_component_dir ${bootloader_component_dirs})
|
||||
__component_dir_quick_check(is_component ${bootloader_component_dir})
|
||||
if(is_component)
|
||||
__kconfig_bootloader_component_add("${bootloader_component_dir}")
|
||||
if(IS_DIRECTORY ${bootloader_component_dir})
|
||||
__component_dir_quick_check(is_component ${bootloader_component_dir})
|
||||
if(is_component)
|
||||
__kconfig_bootloader_component_add("${bootloader_component_dir}")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue