From a94efe662b0537a606d40bdd4b986b5b2ea246e2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 4 May 2017 14:54:23 -0700 Subject: Rename Strings:: function for utf8/utf16 conversion --- toolsrc/src/PostBuildLint.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toolsrc/src/PostBuildLint.cpp') diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 295a8a3b4..80c505122 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -297,7 +297,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) { @@ -334,7 +334,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 +610,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 +664,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) { -- cgit v1.2.3 From 7bdf189a921fdee47044e907a3ff48ce8c880fe2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 3 May 2017 16:33:02 -0700 Subject: Rework vcpkg's triplet environment reading The triplet is "run" and vcpkg observes the environment. Previously, the environment was deduced by the triplet's name --- toolsrc/src/PostBuildLint.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'toolsrc/src/PostBuildLint.cpp') diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 80c505122..befbf1e45 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 @@ -320,7 +321,7 @@ namespace vcpkg::PostBuildLint const std::vector& dlls, const fs::path dumpbin_exe) { - if (expected_system_name != "uwp") + if (expected_system_name != "WindowsStore") { return LintStatus::SUCCESS; } @@ -719,6 +720,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 +765,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 +789,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 +827,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) { -- cgit v1.2.3 From 05b47002ebbf99561476564cb9dfe1869cb79c7c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 4 May 2017 15:19:22 -0700 Subject: Introduce Strings::case_insensitive_ascii_compare() --- toolsrc/src/PostBuildLint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'toolsrc/src/PostBuildLint.cpp') diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index befbf1e45..294645e82 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -700,7 +700,8 @@ namespace vcpkg::PostBuildLint std::vector 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); }); -- cgit v1.2.3