Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmake/common/buildspec_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,16 @@ function(_check_dependencies)

if(NOT EXISTS "${dependencies_dir}/${file}")
message(STATUS "Downloading ${url}")
file(DOWNLOAD "${url}" "${dependencies_dir}/${file}" STATUS download_status EXPECTED_HASH SHA256=${hash})
file(DOWNLOAD "${url}" "${dependencies_dir}/${file}.tmp" STATUS download_status EXPECTED_HASH SHA256=${hash})

list(GET download_status 0 error_code)
list(GET download_status 1 error_message)
if(error_code GREATER 0)
if(error_code)
file(REMOVE "${dependencies_dir}/${file}.tmp")
message(STATUS "Downloading ${url} - Failure")
message(FATAL_ERROR "Unable to download ${url}, failed with error: ${error_message}")
file(REMOVE "${dependencies_dir}/${file}")
else()
file(RENAME "${dependencies_dir}/${file}.tmp" "${dependencies_dir}/${file}")
message(STATUS "Downloading ${url} - done")
endif()
endif()
Expand Down