Skip to content

Commit

Permalink
CMake: support reading dependency zip files from a local mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn committed Mar 20, 2024
1 parent 15219e2 commit 19561cf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/external/onnxruntime_external_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 19561cf

Please sign in to comment.