From d4ab567609495a5c239f537d7c1e200f7b8a19c0 Mon Sep 17 00:00:00 2001 From: "Curtis.Bezault" Date: Wed, 17 Jul 2019 10:10:36 -0700 Subject: first pass at abi additional files --- toolsrc/src/vcpkg/build.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'toolsrc/src') diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 03e0c0b1d..daed6f695 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -496,6 +496,31 @@ namespace vcpkg::Build s_hash_cache.emplace(triplet_file_path, hash); } + for (const fs::path& additional_file : pre_build_info.additional_files) + { + it_hash = s_hash_cache.find(additional_file); + + if (it_hash != s_hash_cache.end()) + { + hash += "-"; + hash += it_hash->second; + } + else if (fs.is_regular_file(additional_file)) + { + std::string tmp_hash = Hash::get_file_hash(fs, additional_file, "SHA1"); + hash += "-"; + hash += tmp_hash; + + s_hash_cache.emplace(additional_file, tmp_hash); + } + else + { + Checks::exit_with_message( + VCPKG_LINE_INFO, + additional_file + " was listed as an additional file for calculating the abi, but was not found."); + } + } + return hash; } @@ -1087,6 +1112,13 @@ namespace vcpkg::Build case VcpkgTripletVar::ENV_PASSTHROUGH : pre_build_info.passthrough_env_vars = Strings::split(variable_value, ";"); break; + case VcpkgTripletVar::ABI_ADDITIONAL_FILES : + pre_build_info.additional_files = Util::fmap(Strings::split(variable_value, ";"), + [](const std::string& path) + { + return fs::path{path}; + }); + break; } } else -- cgit v1.2.3