aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2019-08-23 08:54:20 +0200
committerGitHub <noreply@github.com>2019-08-23 08:54:20 +0200
commitd93b940b18a9875a248af15822ed1af0b12b174d (patch)
treeac1ed5dd213da7e29eb15608961b0a869a13ea4b /toolsrc/src
parent18d61a3fb140ac1f4d9d605e02fdd614e1c2ff14 (diff)
parent78abf650e7797d28bcb4c4c94db47638a80c2005 (diff)
downloadvcpkg-d93b940b18a9875a248af15822ed1af0b12b174d.tar.gz
vcpkg-d93b940b18a9875a248af15822ed1af0b12b174d.zip
Merge branch 'master' into path_separator
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/export.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp
index 8f5034eee..5ceb47adf 100644
--- a/toolsrc/src/vcpkg/export.cpp
+++ b/toolsrc/src/vcpkg/export.cpp
@@ -339,26 +339,27 @@ namespace vcpkg::Export
struct OptionPair
{
- const std::string& name;
+ const StringLiteral& name;
Optional<std::string>& out_opt;
};
- const auto options_implies =
- [&](const std::string& main_opt_name, bool main_opt, Span<const OptionPair> implying_opts) {
- if (main_opt)
- {
- for (auto&& opt : implying_opts)
- opt.out_opt = maybe_lookup(options.settings, opt.name);
- }
- else
- {
- for (auto&& opt : implying_opts)
- Checks::check_exit(VCPKG_LINE_INFO,
- !maybe_lookup(options.settings, opt.name),
- "%s is only valid with %s",
- opt.name,
- main_opt_name);
- }
- };
+ const auto options_implies = [&](const StringLiteral& main_opt_name,
+ bool is_main_opt,
+ const std::initializer_list<OptionPair>& implying_opts) {
+ if (is_main_opt)
+ {
+ for (auto&& opt : implying_opts)
+ opt.out_opt = maybe_lookup(options.settings, opt.name);
+ }
+ else
+ {
+ for (auto&& opt : implying_opts)
+ Checks::check_exit(VCPKG_LINE_INFO,
+ !maybe_lookup(options.settings, opt.name),
+ "%s is only valid with %s",
+ opt.name,
+ main_opt_name);
+ }
+ };
#if defined(_MSC_VER) && _MSC_VER <= 1900
// there's a bug in VS 2015 that causes a bunch of "unreferenced local variable" warnings