ci(windows): fix fetch submodule path issue

This commit is contained in:
Fu Hanxi
2026-08-17 14:13:16 +02:00
parent 95ae438f33
commit 3c88b7176d
2 changed files with 33 additions and 18 deletions
+12 -12
View File
@@ -97,9 +97,9 @@ endmacro()
#
function(__component_dir_quick_check var component_dir)
set(res 1)
get_filename_component(abs_dir ${component_dir} ABSOLUTE)
get_filename_component(abs_dir "${component_dir}" ABSOLUTE)
get_filename_component(base_dir ${abs_dir} NAME)
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
@@ -148,8 +148,8 @@ function(__component_add component_dir prefix component_source)
# so later in the build, these component targets actually contain the properties meant for the
# corresponding component library.
idf_build_get_property(component_targets __COMPONENT_TARGETS)
get_filename_component(abs_dir ${component_dir} ABSOLUTE)
get_filename_component(base_dir ${abs_dir} NAME)
get_filename_component(abs_dir "${component_dir}" ABSOLUTE)
get_filename_component(base_dir "${abs_dir}" NAME)
if(NOT EXISTS "${abs_dir}/CMakeLists.txt")
message(FATAL_ERROR "Directory '${component_dir}' does not contain a component.")
@@ -276,15 +276,15 @@ macro(__component_add_sources sources)
message(WARNING "SRCS and SRC_DIRS are both specified; ignoring SRC_DIRS.")
endif()
foreach(src ${__SRCS})
get_filename_component(src "${src}" ABSOLUTE BASE_DIR ${COMPONENT_DIR})
list(APPEND sources ${src})
get_filename_component(src "${src}" ABSOLUTE BASE_DIR "${COMPONENT_DIR}")
list(APPEND sources "${src}")
endforeach()
else()
if(__SRC_DIRS)
foreach(dir ${__SRC_DIRS})
get_filename_component(abs_dir ${dir} ABSOLUTE BASE_DIR ${COMPONENT_DIR})
get_filename_component(abs_dir "${dir}" ABSOLUTE BASE_DIR "${COMPONENT_DIR}")
if(NOT IS_DIRECTORY ${abs_dir})
if(NOT IS_DIRECTORY "${abs_dir}")
message(FATAL_ERROR "SRC_DIRS entry '${dir}' does not exist.")
endif()
@@ -293,7 +293,7 @@ macro(__component_add_sources sources)
if(dir_sources)
foreach(src ${dir_sources})
get_filename_component(src "${src}" ABSOLUTE BASE_DIR ${COMPONENT_DIR})
get_filename_component(src "${src}" ABSOLUTE BASE_DIR "${COMPONENT_DIR}")
list(APPEND sources "${src}")
endforeach()
else()
@@ -315,11 +315,11 @@ endmacro()
macro(__component_add_include_dirs lib dirs type)
foreach(dir ${dirs})
get_filename_component(_dir ${dir} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR})
if(NOT IS_DIRECTORY ${_dir})
get_filename_component(_dir "${dir}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
if(NOT IS_DIRECTORY "${_dir}")
message(FATAL_ERROR "Include directory '${_dir}' is not a directory.")
endif()
target_include_directories(${lib} ${type} ${_dir})
target_include_directories(${lib} ${type} "${_dir}")
endforeach()
endmacro()