From 8c2055bb4b68cd4221d870350f7d571c179c4da8 Mon Sep 17 00:00:00 2001 From: autoantwort Date: Mon, 18 Nov 2024 23:24:17 +0100 Subject: [PATCH] Fix warning --- src/vcpkg/commands.build.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp index a9003a2c2d..703fac3369 100644 --- a/src/vcpkg/commands.build.cpp +++ b/src/vcpkg/commands.build.cpp @@ -1273,17 +1273,20 @@ namespace vcpkg Util::Vectors::append(abi_tag_entries, cache_entry.abi_entries); - size_t i = 0; - for (auto& filestr : abi_info.pre_build_info->hash_additional_files) { - Path file(filestr); - if (file.is_relative() || !fs.is_regular_file(file)) + size_t i = 0; + for (auto& filestr : abi_info.pre_build_info->hash_additional_files) { - Checks::msg_exit_with_message(VCPKG_LINE_INFO, msgInvalidValueHashAdditionalFiles, msg::path = file); + Path file(filestr); + if (file.is_relative() || !fs.is_regular_file(file)) + { + Checks::msg_exit_with_message( + VCPKG_LINE_INFO, msgInvalidValueHashAdditionalFiles, msg::path = file); + } + const auto hash = + vcpkg::Hash::get_file_hash(fs, file, Hash::Algorithm::Sha256).value_or_exit(VCPKG_LINE_INFO); + abi_tag_entries.emplace_back(fmt::format("additional_file_{}", i++), hash); } - const auto hash = - vcpkg::Hash::get_file_hash(fs, file, Hash::Algorithm::Sha256).value_or_exit(VCPKG_LINE_INFO); - abi_tag_entries.emplace_back(fmt::format("additional_file_{}", i++), hash); } for (size_t i = 0; i < abi_info.pre_build_info->post_portfile_includes.size(); ++i)