aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/SourceParagraph.h
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-06 16:08:36 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-06-06 16:08:36 -0700
commit831f0631f7eea7aebad5fcce95c0bbf0e0cdff68 (patch)
tree00e8bfe0625c30329f04f73dec5b656bdfb90954 /toolsrc/include/SourceParagraph.h
parenta8edf0710cd8a52abd8b88ff0ebe159621c3b206 (diff)
downloadvcpkg-831f0631f7eea7aebad5fcce95c0bbf0e0cdff68.tar.gz
vcpkg-831f0631f7eea7aebad5fcce95c0bbf0e0cdff68.zip
[vcpkg] Added parser support for 'Supports' field
Diffstat (limited to 'toolsrc/include/SourceParagraph.h')
-rw-r--r--toolsrc/include/SourceParagraph.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h
index 7b0fa3178..a53158f3f 100644
--- a/toolsrc/include/SourceParagraph.h
+++ b/toolsrc/include/SourceParagraph.h
@@ -1,6 +1,9 @@
#pragma once
+#include "vcpkg_System.h"
#include "vcpkg_expected.h"
+
+#include <string>
#include <unordered_map>
#include <vector>
@@ -38,6 +41,7 @@ namespace vcpkg
std::string version;
std::string description;
std::string maintainer;
+ std::vector<std::string> supports;
std::vector<Dependency> depends;
};
@@ -47,5 +51,36 @@ namespace vcpkg
std::vector<std::string> filter_dependencies(const std::vector<Dependency>& deps, const Triplet& t);
std::vector<Dependency> expand_qualified_dependencies(const std::vector<std::string>& depends);
- std::vector<std::string> parse_depends(const std::string& depends_string);
+ std::vector<std::string> parse_comma_list(const std::string& str);
+
+ struct Supports
+ {
+ static ExpectedT<Supports, std::vector<std::string>> parse(const std::vector<std::string>& strs);
+
+ using Architecture = System::CPUArchitecture;
+
+ enum class Platform
+ {
+ WINDOWS,
+ UWP,
+ };
+ enum class Linkage
+ {
+ DYNAMIC,
+ STATIC,
+ };
+ enum class ToolsetVersion
+ {
+ V140,
+ V141,
+ };
+
+ bool supports(Architecture arch, Platform plat, Linkage crt, ToolsetVersion tools);
+
+ private:
+ std::vector<Architecture> architectures;
+ std::vector<Platform> platforms;
+ std::vector<Linkage> crt_linkages;
+ std::vector<ToolsetVersion> toolsets;
+ };
}