diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-01-31 17:09:48 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-01 11:42:41 -0800 |
| commit | 459999786960483f6d46229524500543459968ed (patch) | |
| tree | aa3cf7e44325983e693315f698622eb70153ec77 /toolsrc/include | |
| parent | bd1a10e5b97b073731cbb97e26611edf317c16d5 (diff) | |
| download | vcpkg-459999786960483f6d46229524500543459968ed.tar.gz vcpkg-459999786960483f6d46229524500543459968ed.zip | |
Introduce BuildPolicies (not used by the post_build checks yet)
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/BuildInfo.h | 6 | ||||
| -rw-r--r-- | toolsrc/include/BuildPolicies.h | 30 |
2 files changed, 35 insertions, 1 deletions
diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index c90ad7a4e..1fd032aa2 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -3,6 +3,8 @@ #include <unordered_map> #include "Paragraphs.h" #include <regex> +#include "BuildPolicies.h" +#include "opt_bool.h" namespace vcpkg::PostBuildLint { @@ -119,10 +121,12 @@ namespace vcpkg::PostBuildLint struct BuildInfo { - static BuildInfo create(const std::unordered_map<std::string, std::string>& pgh); + static BuildInfo create(std::unordered_map<std::string, std::string> pgh); std::string crt_linkage; std::string library_linkage; + + std::map<BuildPolicies::type, opt_bool_t> policies; }; BuildInfo read_build_info(const fs::path& filepath); diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h new file mode 100644 index 000000000..fbe9b0ff3 --- /dev/null +++ b/toolsrc/include/BuildPolicies.h @@ -0,0 +1,30 @@ +#pragma once +#include <string> + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + enum class backing_enum_t + { + UNKNOWN = 0, + DLLS_WITHOUT_LIBS + }; + + struct type + { + static constexpr int length() { return 2; } + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } + + const std::string& toString() const; + const std::string& cmake_variable() const; + + private: + type(); + backing_enum_t backing_enum; + }; + + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + + type parse(const std::string& s); +} |
