mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-23 22:13:38 +00:00
CMake: support reading dependency zip files from a local mirror (#20005)
### Description To test this feature, run ```bat python cmake\deps_update_and_upload.py --root-path mirror ``` Then run build.py as usual. The zip files will be cached local. To avoid being downloaded again and again.
This commit is contained in:
parent
983fd8393a
commit
dafbef3a21
1 changed files with 10 additions and 0 deletions
10
cmake/external/onnxruntime_external_deps.cmake
vendored
10
cmake/external/onnxruntime_external_deps.cmake
vendored
|
|
@ -14,6 +14,16 @@ foreach(ONNXRUNTIME_DEP IN LISTS ONNXRUNTIME_DEPS_LIST)
|
|||
set(DEP_URL_${ONNXRUNTIME_DEP_NAME} ${ONNXRUNTIME_DEP_URL})
|
||||
# The third column is SHA1 hash value
|
||||
set(DEP_SHA1_${ONNXRUNTIME_DEP_NAME} ${ONNXRUNTIME_DEP})
|
||||
|
||||
if(ONNXRUNTIME_DEP_URL MATCHES "^https://")
|
||||
# Search a local mirror folder
|
||||
string(REGEX REPLACE "^https://" "${REPO_ROOT}/mirror/" LOCAL_URL "${ONNXRUNTIME_DEP_URL}")
|
||||
|
||||
if(EXISTS "${LOCAL_URL}")
|
||||
cmake_path(ABSOLUTE_PATH LOCAL_URL)
|
||||
set(DEP_URL_${ONNXRUNTIME_DEP_NAME} "${LOCAL_URL}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue