only use filename

This commit is contained in:
Curtis.Bezault 2019-07-23 16:28:00 -07:00
parent 45cd8cda5a
commit d68b9a08b1
2 changed files with 14 additions and 5 deletions

View File

@ -138,7 +138,7 @@ namespace vcpkg::Build
Optional<std::string> external_toolchain_file; Optional<std::string> external_toolchain_file;
Optional<ConfigurationType> build_type; Optional<ConfigurationType> build_type;
std::vector<std::string> passthrough_env_vars; std::vector<std::string> passthrough_env_vars;
std::vector<std::pair<std::string, std::string>> external_files; std::vector<std::pair<fs::path, std::string>> external_files;
}; };
std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset); std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset);

View File

@ -281,7 +281,7 @@ namespace vcpkg::Build
for (auto& file_hash : pre_build_info.external_files) for (auto& file_hash : pre_build_info.external_files)
{ {
bpgh.external_files.emplace( bpgh.external_files.emplace(
std::move(file_hash.first), file_hash.first.u8string(),
std::move(file_hash.second)); std::move(file_hash.second));
} }
@ -459,7 +459,7 @@ namespace vcpkg::Build
return command; return command;
} }
static std::vector<std::pair<std::string, std::string>> get_external_file_hashes( static std::vector<std::pair<fs::path, std::string>> get_external_file_hashes(
const VcpkgPaths& paths, const VcpkgPaths& paths,
const std::vector<fs::path>& files) const std::vector<fs::path>& files)
{ {
@ -467,7 +467,7 @@ namespace vcpkg::Build
const auto& fs = paths.get_filesystem(); const auto& fs = paths.get_filesystem();
std::vector<std::pair<std::string, std::string>> hashes; std::vector<std::pair<fs::path, std::string>> hashes;
for (const fs::path& external_file : files) for (const fs::path& external_file : files)
{ {
auto it_hash = s_hash_cache.find(external_file); auto it_hash = s_hash_cache.find(external_file);
@ -705,7 +705,16 @@ namespace vcpkg::Build
} }
//Make a copy of the external files and their hashes, and sort by hash //Make a copy of the external files and their hashes, and sort by hash
auto additional_file_hashes = pre_build_info.external_files; std::vector<std::pair<std::string, std::string>> additional_file_hashes
= Util::fmap(pre_build_info.external_files,
[](const std::pair<fs::path, std::string>& file_hash)
{
return std::pair<std::string, std::string>{
file_hash.first.filename().u8string(),
file_hash.second
};
});
std::sort( std::sort(
additional_file_hashes.begin(), additional_file_hashes.begin(),
additional_file_hashes.end(), additional_file_hashes.end(),