From cd0b7d644b2ba61618b70ae58f50d2e880dbe509 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 18:31:19 -0800 Subject: Add PolicyDLLsWithoutLIBs policy --- toolsrc/src/post_build_lint.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'toolsrc/src') diff --git a/toolsrc/src/post_build_lint.cpp b/toolsrc/src/post_build_lint.cpp index daf6f49ee..009f8019c 100644 --- a/toolsrc/src/post_build_lint.cpp +++ b/toolsrc/src/post_build_lint.cpp @@ -368,11 +368,20 @@ namespace vcpkg::PostBuildLint return lint_status::ERROR_DETECTED; } - static lint_status check_lib_files_are_available_if_dlls_are_available(const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) + static lint_status check_lib_files_are_available_if_dlls_are_available(const std::map& policies, const size_t lib_count, const size_t dll_count, const fs::path& lib_dir) { + auto it = policies.find(BuildPolicies::DLLS_WITHOUT_LIBS); + if (it != policies.cend() && it->second == opt_bool_t::DISABLED) + { + return lint_status::SUCCESS; + } + if (lib_count == 0 && dll_count != 0) { System::println(System::color::warning, "Import libs were not present in %s", lib_dir.generic_string()); + System::println(System::color::warning, + "If this is intended, add the following line in the portfile:\n" + " SET(%s disabled)", BuildPolicies::DLLS_WITHOUT_LIBS.cmake_variable()); return lint_status::ERROR_DETECTED; } @@ -616,8 +625,8 @@ namespace vcpkg::PostBuildLint error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls); - error_count += check_lib_files_are_available_if_dlls_are_available(debug_libs.size(), debug_dlls.size(), debug_lib_dir); - error_count += check_lib_files_are_available_if_dlls_are_available(release_libs.size(), release_dlls.size(), release_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, debug_libs.size(), debug_dlls.size(), debug_lib_dir); + error_count += check_lib_files_are_available_if_dlls_are_available(build_info.policies, release_libs.size(), release_dlls.size(), release_lib_dir); std::vector dlls; dlls.insert(dlls.cend(), debug_dlls.cbegin(), debug_dlls.cend()); -- cgit v1.2.3