diff --git a/include/vcpkg/vcpkgpaths.h b/include/vcpkg/vcpkgpaths.h index 643baf57e4..505015a53b 100644 --- a/include/vcpkg/vcpkgpaths.h +++ b/include/vcpkg/vcpkgpaths.h @@ -77,6 +77,7 @@ namespace vcpkg const std::vector get_available_triplets_names() const; const std::vector& get_available_triplets() const; const std::map& get_cmake_script_hashes() const; + StringView get_ports_cmake_hash() const; const fs::path get_triplet_file_path(Triplet triplet) const; fs::path original_cwd; diff --git a/src/vcpkg/build.cpp b/src/vcpkg/build.cpp index 0b5ae8420d..5b1374b23f 100644 --- a/src/vcpkg/build.cpp +++ b/src/vcpkg/build.cpp @@ -1043,6 +1043,7 @@ namespace vcpkg::Build } } + abi_tag_entries.emplace_back("ports.cmake", paths.get_ports_cmake_hash().to_string()); abi_tag_entries.emplace_back("post_build_checks", "2"); std::vector sorted_feature_list = action.feature_list; Util::sort(sorted_feature_list); diff --git a/src/vcpkg/vcpkgpaths.cpp b/src/vcpkg/vcpkgpaths.cpp index b9f1f3f9cd..c0c5b5b84f 100644 --- a/src/vcpkg/vcpkgpaths.cpp +++ b/src/vcpkg/vcpkgpaths.cpp @@ -209,6 +209,7 @@ namespace vcpkg Lazy> available_triplets; Lazy> toolsets; Lazy> cmake_script_hashes; + Lazy ports_cmake_hash; Files::Filesystem* fs_ptr; @@ -460,6 +461,13 @@ If you wish to silence this error and use classic mode, you can: }); } + StringView VcpkgPaths::get_ports_cmake_hash() const + { + return m_pimpl->ports_cmake_hash.get_lazy([this]() -> std::string { + return Hash::get_file_hash(VCPKG_LINE_INFO, get_filesystem(), ports_cmake, Hash::Algorithm::Sha1); + }); + } + const fs::path VcpkgPaths::get_triplet_file_path(Triplet triplet) const { return m_pimpl->m_triplets_cache.get_lazy(