[vcpkg] Avoid RENAME usage to prevent cross-device link problems (#4245) (#8032)

This commit is contained in:
Leonid Pospelov 2019-09-23 23:03:59 +02:00 committed by Victor Romero
parent 02881e6c6d
commit 6c7f1c7673

View File

@ -75,11 +75,14 @@ function(vcpkg_download_distfile VAR)
# Works around issue #3399
if(IS_DIRECTORY "${DOWNLOADS}/temp")
# Delete "temp0" directory created by the old version of vcpkg
file(REMOVE_RECURSE "${DOWNLOADS}/temp0")
file(RENAME "${DOWNLOADS}/temp" "${DOWNLOADS}/temp0")
file(REMOVE_RECURSE "${DOWNLOADS}/temp0")
endif()
file(GLOB temp_files "${DOWNLOADS}/temp")
file(REMOVE_RECURSE ${temp_files})
else()
file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
endif()
function(test_hash FILE_PATH FILE_KIND CUSTOM_ERROR_ADVICE)
if(_VCPKG_INTERNAL_NO_HASH_CHECK)