diff options
Diffstat (limited to 'toolsrc/src/PostBuildLint.cpp')
| -rw-r--r-- | toolsrc/src/PostBuildLint.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 295a8a3b4..294645e82 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -10,6 +10,7 @@ #include "vcpkg_System.h" #include "vcpkg_Util.h" +using vcpkg::Build::PreBuildInfo; using vcpkg::Build::BuildInfo; namespace vcpkg::PostBuildLint @@ -297,7 +298,7 @@ namespace vcpkg::PostBuildLint Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", - Strings::utf16_to_utf8(cmd_line)); + Strings::to_utf8(cmd_line)); if (ec_data.output.find("ordinal hint RVA name") == std::string::npos) { @@ -320,7 +321,7 @@ namespace vcpkg::PostBuildLint const std::vector<fs::path>& dlls, const fs::path dumpbin_exe) { - if (expected_system_name != "uwp") + if (expected_system_name != "WindowsStore") { return LintStatus::SUCCESS; } @@ -334,7 +335,7 @@ namespace vcpkg::PostBuildLint Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", - Strings::utf16_to_utf8(cmd_line)); + Strings::to_utf8(cmd_line)); if (ec_data.output.find("App Container") == std::string::npos) { @@ -610,7 +611,7 @@ namespace vcpkg::PostBuildLint Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", - Strings::utf16_to_utf8(cmd_line)); + Strings::to_utf8(cmd_line)); for (const BuildType& bad_build_type : bad_build_types) { @@ -664,7 +665,7 @@ namespace vcpkg::PostBuildLint Checks::check_exit(VCPKG_LINE_INFO, ec_data.exit_code == 0, "Running command:\n %s\n failed", - Strings::utf16_to_utf8(cmd_line)); + Strings::to_utf8(cmd_line)); for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) { @@ -699,7 +700,8 @@ namespace vcpkg::PostBuildLint std::vector<fs::path> misplaced_files = fs.get_files_non_recursive(dir); Util::unstable_keep_if(misplaced_files, [&fs](const fs::path& path) { const std::string filename = path.filename().generic_string(); - if (_stricmp(filename.c_str(), "CONTROL") == 0 || _stricmp(filename.c_str(), "BUILD_INFO") == 0) + if (Strings::case_insensitive_ascii_compare(filename.c_str(), "CONTROL") == 0 || + Strings::case_insensitive_ascii_compare(filename.c_str(), "BUILD_INFO") == 0) return false; return !fs.is_directory(path); }); @@ -719,6 +721,7 @@ namespace vcpkg::PostBuildLint static size_t perform_all_checks_and_return_error_count(const PackageSpec& spec, const VcpkgPaths& paths, + const PreBuildInfo& pre_build_info, const BuildInfo& build_info) { const auto& fs = paths.get_filesystem(); @@ -763,7 +766,7 @@ namespace vcpkg::PostBuildLint libs.insert(libs.cend(), debug_libs.cbegin(), debug_libs.cend()); libs.insert(libs.cend(), release_libs.cbegin(), release_libs.cend()); - error_count += check_lib_architecture(spec.triplet().architecture(), libs); + error_count += check_lib_architecture(pre_build_info.target_architecture, libs); } switch (build_info.library_linkage) @@ -787,8 +790,8 @@ namespace vcpkg::PostBuildLint dlls.insert(dlls.cend(), release_dlls.cbegin(), release_dlls.cend()); error_count += check_exports_of_dlls(dlls, toolset.dumpbin); - error_count += check_uwp_bit_of_dlls(spec.triplet().system(), dlls, toolset.dumpbin); - error_count += check_dll_architecture(spec.triplet().architecture(), dlls); + error_count += check_uwp_bit_of_dlls(pre_build_info.cmake_system_name, dlls, toolset.dumpbin); + error_count += check_dll_architecture(pre_build_info.target_architecture, dlls); error_count += check_outdated_crt_linkage_of_dlls(dlls, toolset.dumpbin); break; @@ -825,10 +828,13 @@ namespace vcpkg::PostBuildLint return error_count; } - size_t perform_all_checks(const PackageSpec& spec, const VcpkgPaths& paths, const BuildInfo& build_info) + size_t perform_all_checks(const PackageSpec& spec, + const VcpkgPaths& paths, + const PreBuildInfo& pre_build_info, + const BuildInfo& build_info) { System::println("-- Performing post-build validation"); - const size_t error_count = perform_all_checks_and_return_error_count(spec, paths, build_info); + const size_t error_count = perform_all_checks_and_return_error_count(spec, paths, pre_build_info, build_info); if (error_count != 0) { |
