mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 08:58:59 +08:00
dll_info->DllInfo, lib_info->LibInfo
This commit is contained in:
parent
44cd8f90b1
commit
80e48c2756
@ -5,17 +5,17 @@
|
||||
|
||||
namespace vcpkg::COFFFileReader
|
||||
{
|
||||
struct dll_info
|
||||
struct DllInfo
|
||||
{
|
||||
MachineType machine_type;
|
||||
};
|
||||
|
||||
struct lib_info
|
||||
struct LibInfo
|
||||
{
|
||||
std::vector<MachineType> machine_types;
|
||||
};
|
||||
|
||||
dll_info read_dll(const fs::path& path);
|
||||
DllInfo read_dll(const fs::path& path);
|
||||
|
||||
lib_info read_lib(const fs::path& path);
|
||||
LibInfo read_lib(const fs::path& path);
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ namespace vcpkg::PostBuildLint
|
||||
for (const fs::path& file : files)
|
||||
{
|
||||
Checks::check_exit(VCPKG_LINE_INFO, file.extension() == ".dll", "The file extension was not .dll: %s", file.generic_string());
|
||||
COFFFileReader::dll_info info = COFFFileReader::read_dll(file);
|
||||
COFFFileReader::DllInfo info = COFFFileReader::read_dll(file);
|
||||
const std::string actual_architecture = get_actual_architecture(info.machine_type);
|
||||
|
||||
if (expected_architecture != actual_architecture)
|
||||
@ -362,7 +362,7 @@ namespace vcpkg::PostBuildLint
|
||||
for (const fs::path& file : files)
|
||||
{
|
||||
Checks::check_exit(VCPKG_LINE_INFO, file.extension() == ".lib", "The file extension was not .lib: %s", file.generic_string());
|
||||
COFFFileReader::lib_info info = COFFFileReader::read_lib(file);
|
||||
COFFFileReader::LibInfo info = COFFFileReader::read_lib(file);
|
||||
Checks::check_exit(VCPKG_LINE_INFO, info.machine_types.size() == 1, "Found more than 1 architecture in file %s", file.generic_string());
|
||||
|
||||
const std::string actual_architecture = get_actual_architecture(info.machine_types.at(0));
|
||||
|
@ -221,7 +221,7 @@ namespace vcpkg::COFFFileReader
|
||||
verify_equal_strings(VCPKG_LINE_INFO, FILE_START, file_start, FILE_START_SIZE, "LIB FILE_START");
|
||||
}
|
||||
|
||||
dll_info read_dll(const fs::path& path)
|
||||
DllInfo read_dll(const fs::path& path)
|
||||
{
|
||||
std::fstream fs(path, std::ios::in | std::ios::binary | std::ios::ate);
|
||||
Checks::check_exit(VCPKG_LINE_INFO, fs.is_open(), "Could not open file %s for reading", path.generic_string());
|
||||
@ -258,7 +258,7 @@ namespace vcpkg::COFFFileReader
|
||||
fpos_t m_absolute_position = 0;
|
||||
};
|
||||
|
||||
lib_info read_lib(const fs::path& path)
|
||||
LibInfo read_lib(const fs::path& path)
|
||||
{
|
||||
std::fstream fs(path, std::ios::in | std::ios::binary | std::ios::ate);
|
||||
Checks::check_exit(VCPKG_LINE_INFO, fs.is_open(), "Could not open file %s for reading", path.generic_string());
|
||||
|
Loading…
Reference in New Issue
Block a user