Skip to content

Commit

Permalink
cmake: improve download error check
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Sep 11, 2024
1 parent 085d199 commit 08a119e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ macro(fvp_setup_deps)

set(DOWNLOAD_MDK_SDK OFF)
message("FVP_DEPS_LATEST=$ENV{FVP_DEPS_LATEST}")
# TODO: download from github option FVP_DEPS_LATEST_RELEASE=1
if($ENV{FVP_DEPS_LATEST})
if(EXISTS ${MDK_SDK_SAVE})
message("Downloading latest md5")
Expand Down Expand Up @@ -47,7 +48,8 @@ macro(fvp_setup_deps)
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE EXTRACT_RET
)
if(NOT EXTRACT_RET EQUAL 0)
# EXTRACT_RET is 0 even for empty files
if(NOT EXTRACT_RET EQUAL 0 OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/mdk-sdk/lib/cmake/FindMDK.cmake)
file(REMOVE ${MDK_SDK_SAVE})
message(FATAL_ERROR "Failed to extract mdk-sdk. You can download manually from ${MDK_SDK_URL} and extract to ${CMAKE_CURRENT_SOURCE_DIR}")
endif()
Expand Down

0 comments on commit 08a119e

Please sign in to comment.