diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-07-24 09:03:03 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-07-24 09:03:03 -0700 |
| commit | 8097e2f3c29eb05f707ad86c712e8523cca9421f (patch) | |
| tree | 690796de2b894ad8e54c22e09e88255cd39020d2 /toolsrc/src/PostBuildLint.cpp | |
| parent | f4817ead064872417e4f5e81a94bf8ecb2c6a865 (diff) | |
| download | vcpkg-8097e2f3c29eb05f707ad86c712e8523cca9421f.tar.gz vcpkg-8097e2f3c29eb05f707ad86c712e8523cca9421f.zip | |
[vcpkg] ALLOW_OBSOLETE_MSVCRT policy should enable use of all CRTs.
Diffstat (limited to 'toolsrc/src/PostBuildLint.cpp')
| -rw-r--r-- | toolsrc/src/PostBuildLint.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/PostBuildLint.cpp index 8e11ae5b1..a5d923ad2 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/PostBuildLint.cpp @@ -38,7 +38,7 @@ namespace vcpkg::PostBuildLint } }; - const std::vector<OutdatedDynamicCrt>& get_outdated_dynamic_crts(const Build::BuildPolicies& policies) + const std::vector<OutdatedDynamicCrt>& get_outdated_dynamic_crts() { static const std::vector<OutdatedDynamicCrt> v_no_msvcrt = { {"msvcp100.dll", R"(msvcp100\.dll)"}, @@ -59,18 +59,7 @@ namespace vcpkg::PostBuildLint {"msvcrt20.dll", R"(msvcrt20\.dll)"}, {"msvcrt40.dll", R"(msvcrt40\.dll)"}}; - static const std::vector<OutdatedDynamicCrt> v = [&]() { - auto ret = v_no_msvcrt; - ret.push_back(OutdatedDynamicCrt{"msvcrt.dll", R"(msvcrt\.dll)"}); - return ret; - }(); - - if (policies.is_enabled(BuildPolicy::ALLOW_OBSOLETE_MSVCRT)) - { - return v_no_msvcrt; - } - - return v; + return v_no_msvcrt; } static LintStatus check_for_files_in_include_directory(const Files::Filesystem& fs, @@ -659,7 +648,7 @@ namespace vcpkg::PostBuildLint const fs::path dumpbin_exe, const BuildInfo& build_info) { - const std::vector<OutdatedDynamicCrt>& outdated_crts = get_outdated_dynamic_crts(build_info.policies); + if (build_info.policies.is_enabled(BuildPolicy::ALLOW_OBSOLETE_MSVCRT)) return LintStatus::SUCCESS; std::vector<OutdatedDynamicCrt_and_file> dlls_with_outdated_crt; @@ -673,7 +662,7 @@ namespace vcpkg::PostBuildLint "Running command:\n %s\n failed", Strings::to_utf8(cmd_line)); - for (const OutdatedDynamicCrt& outdated_crt : outdated_crts) + for (const OutdatedDynamicCrt& outdated_crt : get_outdated_dynamic_crts()) { if (std::regex_search(ec_data.output.cbegin(), ec_data.output.cend(), outdated_crt.regex)) { |
