Skip to content

Commit

Permalink
Add an error message for a failed download
Browse files Browse the repository at this point in the history
  • Loading branch information
ngorskikh committed Sep 4, 2024
1 parent 18ddc81 commit c407b50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmake/conan_bootstrap.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
if (NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/conan_provider.cmake)
set(_CONANFILES_ARCHIVE_NAME conanfiles.tar.gz)
set(_CONANFILES_ARCHIVE ${CMAKE_CURRENT_LIST_DIR}/../conan/${_CONANFILES_ARCHIVE_NAME})
file(DOWNLOAD https://github.com/AdguardTeam/NativeLibsCommon/releases/latest/download/${_CONANFILES_ARCHIVE_NAME} ${_CONANFILES_ARCHIVE})
file(DOWNLOAD https://github.com/AdguardTeam/NativeLibsCommon/releases/latest/download/${_CONANFILES_ARCHIVE_NAME} ${_CONANFILES_ARCHIVE} STATUS _DOWNLOAD_STATUS)
list(GET _DOWNLOAD_STATUS 0 _DOWNLOAD_STATUS_0)
if (NOT _DOWNLOAD_STATUS_0 EQUAL 0)
message(FATAL_ERROR "Conan files download failed: ${_DOWNLOAD_STATUS}")
endif ()
file(ARCHIVE_EXTRACT INPUT ${_CONANFILES_ARCHIVE} DESTINATION ${CMAKE_CURRENT_LIST_DIR}/../conan)
file(RENAME ${CMAKE_CURRENT_LIST_DIR}/../conan/conan_provider.cmake ${CMAKE_CURRENT_LIST_DIR}/conan_provider.cmake)
file(REMOVE ${_CONANFILES_ARCHIVE})
Expand Down

0 comments on commit c407b50

Please sign in to comment.