aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/PostBuildLint_BuildPolicies.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-02-01 13:24:06 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2017-02-01 17:54:48 -0800
commit9086fcebdf43ad01892c8f96afc5e676f9b72135 (patch)
tree5f7b295e1f260fdcefa9d68c0fcadb272e354aa0 /toolsrc/src/PostBuildLint_BuildPolicies.cpp
parenta3eaed8f1faacc03dc5abb56d2117096d3413735 (diff)
downloadvcpkg-9086fcebdf43ad01892c8f96afc5e676f9b72135.tar.gz
vcpkg-9086fcebdf43ad01892c8f96afc5e676f9b72135.zip
Rename files in PostBuildLint namespace
Diffstat (limited to 'toolsrc/src/PostBuildLint_BuildPolicies.cpp')
-rw-r--r--toolsrc/src/PostBuildLint_BuildPolicies.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp
new file mode 100644
index 000000000..d7d67c991
--- /dev/null
+++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp
@@ -0,0 +1,55 @@
+#include "pch.h"
+#include "PostBuildLint_BuildPolicies.h"
+#include "vcpkg_Checks.h"
+
+namespace vcpkg::PostBuildLint::BuildPolicies
+{
+ static const std::string NAME_UNKNOWN = "PolicyUnknown";
+ static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs";
+
+ const std::string& type::toString() const
+ {
+ switch (this->backing_enum)
+ {
+ case DLLS_WITHOUT_LIBS:
+ return NAME_DLLS_WITHOUT_LIBS;
+ case UNKNOWN:
+ return NAME_UNKNOWN;
+ default:
+ Checks::unreachable();
+ }
+ }
+
+ const std::string& type::cmake_variable() const
+ {
+ static const std::string CMAKE_VARIABLE_DLLS_WITHOUT_LIBS = "VCPKG_POLICY_DLLS_WITHOUT_LIBS";
+
+ switch (this->backing_enum)
+ {
+ case DLLS_WITHOUT_LIBS:
+ return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS;
+ case UNKNOWN:
+ Checks::exit_with_message("No CMake command corresponds to UNKNOWN");
+ default:
+ Checks::unreachable();
+ }
+ }
+
+ type::type(): backing_enum(backing_enum_t::UNKNOWN) {}
+
+ const std::vector<type>& values()
+ {
+ static const std::vector<type>& v = {UNKNOWN, DLLS_WITHOUT_LIBS};
+ return v;
+ }
+
+ type parse(const std::string& s)
+ {
+ if (s == NAME_DLLS_WITHOUT_LIBS)
+ {
+ return BuildPolicies::DLLS_WITHOUT_LIBS;
+ }
+
+ return BuildPolicies::UNKNOWN;
+ }
+}