aboutsummaryrefslogtreecommitdiff
path: root/toolsrc
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc')
-rw-r--r--toolsrc/VERSION.txt2
-rw-r--r--toolsrc/include/vcpkg/base/files.h7
-rw-r--r--toolsrc/include/vcpkg/build.h13
-rw-r--r--toolsrc/src/vcpkg/base/files.cpp14
-rw-r--r--toolsrc/src/vcpkg/build.cpp18
-rw-r--r--toolsrc/src/vcpkg/postbuildlint.cpp5
6 files changed, 31 insertions, 28 deletions
diff --git a/toolsrc/VERSION.txt b/toolsrc/VERSION.txt
index 86c0faff1..4f832d877 100644
--- a/toolsrc/VERSION.txt
+++ b/toolsrc/VERSION.txt
@@ -1 +1 @@
-"2020.06.15"
+"2020.11.09"
diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h
index 3e56101c9..b05f79a05 100644
--- a/toolsrc/include/vcpkg/base/files.h
+++ b/toolsrc/include/vcpkg/base/files.h
@@ -18,10 +18,17 @@
namespace fs
{
+#if defined(_WIN32)
struct IsSlash
{
bool operator()(const wchar_t c) const noexcept { return c == L'/' || c == L'\\'; }
};
+#else
+ struct IsSlash
+ {
+ bool operator()(const char c) const noexcept { return c == '/'; }
+ };
+#endif
constexpr IsSlash is_slash;
diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h
index 4cbde1cb1..f15a2f724 100644
--- a/toolsrc/include/vcpkg/build.h
+++ b/toolsrc/include/vcpkg/build.h
@@ -243,6 +243,7 @@ namespace vcpkg::Build
EMPTY_PACKAGE,
DLLS_WITHOUT_LIBS,
DLLS_WITHOUT_EXPORTS,
+ MISMATCHED_NUMBER_OF_BINARIES,
ONLY_RELEASE_CRT,
EMPTY_INCLUDE_FOLDER,
ALLOW_OBSOLETE_MSVCRT,
@@ -253,16 +254,8 @@ namespace vcpkg::Build
COUNT,
};
- constexpr std::array<BuildPolicy, size_t(BuildPolicy::COUNT)> G_ALL_POLICIES = {
- BuildPolicy::EMPTY_PACKAGE,
- BuildPolicy::DLLS_WITHOUT_LIBS,
- BuildPolicy::DLLS_WITHOUT_EXPORTS,
- BuildPolicy::ONLY_RELEASE_CRT,
- BuildPolicy::EMPTY_INCLUDE_FOLDER,
- BuildPolicy::ALLOW_OBSOLETE_MSVCRT,
- BuildPolicy::ALLOW_RESTRICTED_HEADERS,
- BuildPolicy::SKIP_DUMPBIN_CHECKS,
- BuildPolicy::SKIP_ARCHITECTURE_CHECK};
+ // could be constexpr, but we want to generate this and that's not constexpr
+ extern const std::array<BuildPolicy, size_t(BuildPolicy::COUNT)> ALL_POLICIES;
const std::string& to_string(BuildPolicy policy);
CStringView to_cmake_variable(BuildPolicy policy);
diff --git a/toolsrc/src/vcpkg/base/files.cpp b/toolsrc/src/vcpkg/base/files.cpp
index 4cccebd45..891207445 100644
--- a/toolsrc/src/vcpkg/base/files.cpp
+++ b/toolsrc/src/vcpkg/base/files.cpp
@@ -26,20 +26,6 @@
namespace
{
-#if defined(_WIN32)
- struct IsSlash
- {
- bool operator()(const wchar_t c) const noexcept { return c == L'/' || c == L'\\'; }
- };
-#else
- struct IsSlash
- {
- bool operator()(const char c) const noexcept { return c == '/'; }
- };
-#endif
-
- constexpr IsSlash is_slash;
-
struct NativeStringView
{
const fs::path::value_type* first;
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index c20f48b36..bae937277 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -203,6 +203,7 @@ namespace vcpkg::Build
static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage";
static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs";
static const std::string NAME_DLLS_WITHOUT_EXPORTS = "PolicyDLLsWithoutExports";
+ static const std::string NAME_MISMATCHED_NUMBER_OF_BINARIES = "PolicyMismatchedNumberOfBinaries";
static const std::string NAME_ONLY_RELEASE_CRT = "PolicyOnlyReleaseCRT";
static const std::string NAME_EMPTY_INCLUDE_FOLDER = "PolicyEmptyIncludeFolder";
static const std::string NAME_ALLOW_OBSOLETE_MSVCRT = "PolicyAllowObsoleteMsvcrt";
@@ -210,6 +211,19 @@ namespace vcpkg::Build
static const std::string NAME_SKIP_DUMPBIN_CHECKS = "PolicySkipDumpbinChecks";
static const std::string NAME_SKIP_ARCHITECTURE_CHECK = "PolicySkipArchitectureCheck";
+ static std::remove_const_t<decltype(ALL_POLICIES)> generate_all_policies()
+ {
+ std::remove_const_t<decltype(ALL_POLICIES)> res;
+ for (size_t i = 0; i < res.size(); ++i)
+ {
+ res[i] = static_cast<BuildPolicy>(i);
+ }
+
+ return res;
+ }
+
+ decltype(ALL_POLICIES) ALL_POLICIES = generate_all_policies();
+
const std::string& to_string(BuildPolicy policy)
{
switch (policy)
@@ -217,6 +231,7 @@ namespace vcpkg::Build
case BuildPolicy::EMPTY_PACKAGE: return NAME_EMPTY_PACKAGE;
case BuildPolicy::DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS;
case BuildPolicy::DLLS_WITHOUT_EXPORTS: return NAME_DLLS_WITHOUT_EXPORTS;
+ case BuildPolicy::MISMATCHED_NUMBER_OF_BINARIES: return NAME_MISMATCHED_NUMBER_OF_BINARIES;
case BuildPolicy::ONLY_RELEASE_CRT: return NAME_ONLY_RELEASE_CRT;
case BuildPolicy::EMPTY_INCLUDE_FOLDER: return NAME_EMPTY_INCLUDE_FOLDER;
case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return NAME_ALLOW_OBSOLETE_MSVCRT;
@@ -234,6 +249,7 @@ namespace vcpkg::Build
case BuildPolicy::EMPTY_PACKAGE: return "VCPKG_POLICY_EMPTY_PACKAGE";
case BuildPolicy::DLLS_WITHOUT_LIBS: return "VCPKG_POLICY_DLLS_WITHOUT_LIBS";
case BuildPolicy::DLLS_WITHOUT_EXPORTS: return "VCPKG_POLICY_DLLS_WITHOUT_EXPORTS";
+ case BuildPolicy::MISMATCHED_NUMBER_OF_BINARIES: return "VCPKG_POLICY_MISMATCHED_NUMBER_OF_BINARIES";
case BuildPolicy::ONLY_RELEASE_CRT: return "VCPKG_POLICY_ONLY_RELEASE_CRT";
case BuildPolicy::EMPTY_INCLUDE_FOLDER: return "VCPKG_POLICY_EMPTY_INCLUDE_FOLDER";
case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return "VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT";
@@ -1221,7 +1237,7 @@ namespace vcpkg::Build
if (!version.empty()) build_info.version = std::move(version);
std::map<BuildPolicy, bool> policies;
- for (auto policy : G_ALL_POLICIES)
+ for (auto policy : ALL_POLICIES)
{
const auto setting = parser.optional_field(to_string(policy));
if (setting.empty()) continue;
diff --git a/toolsrc/src/vcpkg/postbuildlint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp
index 7b8e65ed6..8490ac364 100644
--- a/toolsrc/src/vcpkg/postbuildlint.cpp
+++ b/toolsrc/src/vcpkg/postbuildlint.cpp
@@ -872,7 +872,7 @@ namespace vcpkg::PostBuildLint
std::vector<fs::path> release_libs = fs.get_files_recursive(release_lib_dir);
Util::erase_remove_if(release_libs, not_extension_pred(fs, ".lib"));
- if (!pre_build_info.build_type)
+ if (!pre_build_info.build_type && !build_info.policies.is_enabled(BuildPolicy::MISMATCHED_NUMBER_OF_BINARIES))
error_count += check_matching_debug_and_release_binaries(debug_libs, release_libs);
if (!build_info.policies.is_enabled(BuildPolicy::SKIP_ARCHITECTURE_CHECK))
@@ -892,7 +892,8 @@ namespace vcpkg::PostBuildLint
{
case Build::LinkageType::DYNAMIC:
{
- if (!pre_build_info.build_type)
+ if (!pre_build_info.build_type &&
+ !build_info.policies.is_enabled(BuildPolicy::MISMATCHED_NUMBER_OF_BINARIES))
error_count += check_matching_debug_and_release_binaries(debug_dlls, release_dlls);
error_count += check_lib_files_are_available_if_dlls_are_available(