first pass at abi additional files
MODIFY
include/vcpkg/build.h
include/vcpkg/build.h
@@ -138,6 +138,7 @@ namespace vcpkg::Build
Optional<std::string> external_toolchain_file;
Optional<ConfigurationType> build_type;
std::vector<std::string> passthrough_env_vars;
+ std::vector<fs::path> additional_files;
};
std::string make_build_env_cmd(const PreBuildInfo& pre_build_info, const Toolset& toolset);
@@ -152,6 +153,7 @@ namespace vcpkg::Build
CHAINLOAD_TOOLCHAIN_FILE,
BUILD_TYPE,
ENV_PASSTHROUGH,
+ ABI_ADDITIONAL_FILES,
};
const std::unordered_map<std::string, VcpkgTripletVar> VCPKG_OPTIONS = {
@@ -163,6 +165,7 @@ namespace vcpkg::Build
{"VCPKG_CHAINLOAD_TOOLCHAIN_FILE", VcpkgTripletVar::CHAINLOAD_TOOLCHAIN_FILE},
{"VCPKG_BUILD_TYPE", VcpkgTripletVar::BUILD_TYPE},
{"VCPKG_ENV_PASSTHROUGH", VcpkgTripletVar::ENV_PASSTHROUGH},
+ {"VCPKG_ABI_ADDITIONAL_FILES", VcpkgTripletVar::ABI_ADDITIONAL_FILES},
};
struct ExtendedBuildResult

MODIFY
src/vcpkg/build.cpp
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

first pass at abi additional files