aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorCurtis.Bezault <cubezaul@microsoft.com>2019-04-02 10:48:37 -0700
committerCurtis.Bezault <cubezaul@microsoft.com>2019-04-02 11:04:05 -0700
commite9d2a830206fac08f47e55c739a3f3fbe29855e9 (patch)
tree1d70510d3123a657220f631e036ab004c010b03e /toolsrc/src
parent2e04d02e9d24e12b1c14b94b4b3d43c977a49d2f (diff)
downloadvcpkg-e9d2a830206fac08f47e55c739a3f3fbe29855e9.tar.gz
vcpkg-e9d2a830206fac08f47e55c739a3f3fbe29855e9.zip
Check scripts/cmake/* and buildsystems/vcpkg.cmake for changes when hashing
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/build.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index f20367e00..50bcacd13 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -479,13 +479,13 @@ namespace vcpkg::Build
const int max_port_file_count = 100;
// the order of recursive_directory_iterator is undefined so save the names to sort
- std::vector<fs::path> port_files;
+ std::vector<fs::path> hashed_files;
for (auto &port_file : fs::stdfs::recursive_directory_iterator(config.port_dir))
{
if (fs::is_regular_file(status(port_file)))
{
- port_files.push_back(port_file);
- if (port_files.size() > max_port_file_count)
+ hashed_files.push_back(port_file);
+ if (hashed_files.size() > max_port_file_count)
{
abi_tag_entries.emplace_back(AbiEntry{ "no_hash_max_portfile", "" });
break;
@@ -493,12 +493,20 @@ namespace vcpkg::Build
}
}
- if (port_files.size() <= max_port_file_count)
+ if (hashed_files.size() <= max_port_file_count)
{
- std::sort(port_files.begin(), port_files.end());
+ for (auto &script_file : fs::stdfs::recursive_directory_iterator(paths.scripts))
+ {
+ if (fs::is_regular_file(status(script_file)))
+ {
+ hashed_files.push_back(script_file);
+ }
+ }
+
+ std::sort(hashed_files.begin(), hashed_files.end());
int counter = 0;
- for (auto & port_file : port_files)
+ for (auto & hashed_file : hashed_files)
{
// When vcpkg takes a dependency on C++17 it can use fs::relative,
// which will give a stable ordering and better names in the key entry.
@@ -506,15 +514,15 @@ namespace vcpkg::Build
std::string key = Strings::format("file_%03d", counter++);
if (GlobalState::debugging)
{
- System::println("[DEBUG] mapping %s from %s", key, port_file.string());
+ System::println("[DEBUG] mapping %s from %s", key, hashed_file.string());
}
- abi_tag_entries.emplace_back(AbiEntry{ key, vcpkg::Hash::get_file_hash(fs, port_file, "SHA1") });
+ abi_tag_entries.emplace_back(AbiEntry{ key, vcpkg::Hash::get_file_hash(fs, hashed_file, "SHA1") });
}
}
abi_tag_entries.emplace_back(AbiEntry{
- "vcpkg_fixup_cmake_targets",
- vcpkg::Hash::get_file_hash(fs, paths.scripts / "cmake" / "vcpkg_fixup_cmake_targets.cmake", "SHA1")});
+ "vcpkg",
+ vcpkg::Hash::get_file_hash(fs, paths.scripts / "buildsystems" / "vcpkg.cmake", "SHA1")});
abi_tag_entries.emplace_back(AbiEntry{"triplet", pre_build_info.triplet_abi_tag});