Skip to content

Commit 19561cf

Browse files
committed
CMake: support reading dependency zip files from a local mirror
1 parent 15219e2 commit 19561cf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmake/external/onnxruntime_external_deps.cmake

+10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ foreach(ONNXRUNTIME_DEP IN LISTS ONNXRUNTIME_DEPS_LIST)
1414
set(DEP_URL_${ONNXRUNTIME_DEP_NAME} ${ONNXRUNTIME_DEP_URL})
1515
# The third column is SHA1 hash value
1616
set(DEP_SHA1_${ONNXRUNTIME_DEP_NAME} ${ONNXRUNTIME_DEP})
17+
18+
if(ONNXRUNTIME_DEP_URL MATCHES "^https://")
19+
# Search a local mirror folder
20+
string(REGEX REPLACE "^https://" "${REPO_ROOT}/mirror/" LOCAL_URL "${ONNXRUNTIME_DEP_URL}")
21+
22+
if(EXISTS "${LOCAL_URL}")
23+
cmake_path(ABSOLUTE_PATH LOCAL_URL)
24+
set(DEP_URL_${ONNXRUNTIME_DEP_NAME} "${LOCAL_URL}")
25+
endif()
26+
endif()
1727
endif()
1828
endforeach()
1929

0 commit comments

Comments
 (0)