[vcpkg_find_acquire_program] Fix extraction, cleanup (#40916)

This commit is contained in:
Kai Pastor 2024-10-09 21:46:43 +02:00 committed by GitHub
parent 64578ff08c
commit d0d081b3fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -199,6 +199,15 @@ function(vcpkg_find_acquire_program program)
WORLD_READ WORLD_EXECUTE
)
endif()
elseif(tool_subdirectory STREQUAL "")
# The effective tool subdir is owned by the extracted paths of the archive.
# *** This behavior is provided for convenience and short paths. ***
# There must be no overlap between different providers of subdirs.
# Otherwise tool_subdirectory must be used in order to separate extracted trees.
file(REMOVE_RECURSE "${full_subdirectory}.temp")
vcpkg_extract_archive(ARCHIVE "${archive_path}" DESTINATION "${full_subdirectory}.temp")
file(COPY "${full_subdirectory}.temp/" DESTINATION "${full_subdirectory}")
file(REMOVE_RECURSE "${full_subdirectory}.temp")
else()
vcpkg_extract_archive(ARCHIVE "${archive_path}" DESTINATION "${full_subdirectory}")
endif()

View File

@ -27,6 +27,11 @@ if(VCPKG_HOST_IS_LINUX)
endif()
if(VCPKG_HOST_IS_WINDOWS)
# The version-agnostic tool dir may already exist.
# Simulate/test with NASM.
file(REMOVE_RECURSE "${DOWNLOADS}/tools/nasm")
file(MAKE_DIRECTORY "${DOWNLOADS}/tools/nasm")
list(APPEND variables 7Z ARIA2 CLANG DARK DOXYGEN GASPREPROCESSOR GO GPERF JOM NASM NUGET PYTHON2 RUBY SCONS SWIG)
vcpkg_find_acquire_program(7Z)
vcpkg_find_acquire_program(ARIA2)