From 1af7aa23337e895928afbec81b5c2c83381b71c5 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Tue, 7 Nov 2023 15:36:40 +0000 Subject: [PATCH] build: install vcpkg binary packages in dep order Use the new code in the powershell module for vcpkg binary packages to install the downloaded binary packages in dependency order with build dependencies so that the database is not corrupted at any point in the installation process or after. Also remove the build binary package directory after installation, so that all the previous packages are not reinstalled if a package is updated on a subsequent run. Signed-off-by: Rafael Kitover --- cmake/Set-Toolchain-vcpkg.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/Set-Toolchain-vcpkg.cmake b/cmake/Set-Toolchain-vcpkg.cmake index 8dacc0cb..b8a898a9 100644 --- a/cmake/Set-Toolchain-vcpkg.cmake +++ b/cmake/Set-Toolchain-vcpkg.cmake @@ -258,14 +258,14 @@ function(get_binary_packages vcpkg_exe) set(powershell pwsh) endif() - foreach(pkg ${to_install}) - execute_process( - COMMAND ${powershell} - -executionpolicy bypass -noprofile - -command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-instpkg './${pkg}'" - WORKING_DIRECTORY ${bin_pkgs_dir} - ) - endforeach() + execute_process( + COMMAND ${powershell} + -executionpolicy bypass -noprofile + -command "import-module '${CMAKE_BINARY_DIR}/vcpkg-binpkg/vcpkg-binpkg.psm1'; vcpkg-instpkg ." + WORKING_DIRECTORY ${bin_pkgs_dir} + ) + + file(REMOVE_RECURSE ${bin_pkgs_dir}) endif() set(binary_packages_installed TRUE PARENT_SCOPE)