From 1f3a1cb9dc8a7ca9501987a7e5015bd00f798da7 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 15 Jul 2025 21:05:07 +0000 Subject: [PATCH] build: fix re-downloading vcpkg binary packages Fix re-installing binary packages on next cached run by clearing the cache entries for `vcpkg list`. Also remove the binary packages directory after installing. Signed-off-by: Rafael Kitover --- cmake/Set-Toolchain-vcpkg.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/Set-Toolchain-vcpkg.cmake b/cmake/Set-Toolchain-vcpkg.cmake index f9c1ffa6..52f59608 100644 --- a/cmake/Set-Toolchain-vcpkg.cmake +++ b/cmake/Set-Toolchain-vcpkg.cmake @@ -267,6 +267,13 @@ function(zip_is_installed vcpkg_exe zip outvar) set(${outvar} ${pkg_installed} PARENT_SCOPE) endfunction() +function(cleanup_binary_packages) + file(REMOVE_RECURSE "${CMAKE_BINARY_DIR}/vcpkg-binary-packages") + + unset(VCPKG_INSTALLED CACHE) + unset(VCPKG_INSTALLED_COUNT CACHE) +endfunction() + function(get_binary_packages vcpkg_exe) set(binary_packages_installed FALSE PARENT_SCOPE) @@ -396,6 +403,8 @@ function(get_binary_packages vcpkg_exe) file(REMOVE_RECURSE ${bin_pkgs_dir}) endif() + cleanup_binary_packages() + set(binary_packages_installed TRUE PARENT_SCOPE) endfunction()