From 9495dc84f811d5a6133ac9afa415638bdb640611 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Thu, 30 Jul 2020 22:40:42 +0000 Subject: [PATCH] Prefer upgrading zlib before other vcpkg deps. Just a hack to fix a problem with vcpkg upgrades, in this case the version of the zlib port being too old breaks another upgrade, so we will check if zlib is in the list of packages to upgrade and upgrade it before anything else. Signed-off-by: Rafael Kitover --- cmake/Set-Toolchain-vcpkg.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/Set-Toolchain-vcpkg.cmake b/cmake/Set-Toolchain-vcpkg.cmake index 1e5800c4..c96207e7 100644 --- a/cmake/Set-Toolchain-vcpkg.cmake +++ b/cmake/Set-Toolchain-vcpkg.cmake @@ -34,11 +34,15 @@ function(vcpkg_get_first_upgrade vcpkg_exe) ) if(NOT pkg_upgrade MATCHES up-to-date) - set(first_upgrade ${pkg} PARENT_SCOPE) - return() + # Prefer upgrading zlib before anything else. + if(NOT first_upgrade OR pkg MATCHES zlib) + set(first_upgrade ${pkg}) + endif() endif() endif() endforeach() + + set(first_upgrade ${first_upgrade} PARENT_SCOPE) endfunction() function(vcpkg_set_toolchain)