aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/PostBuildLint_BuildPolicies.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-02-21 13:39:36 -0800
committerGitHub <noreply@github.com>2017-02-21 13:39:36 -0800
commit7d4df89c1dfff0b2bad0165ac4579f6352935a94 (patch)
tree8b87d29fb74fb24984d5aff9b021f14d95afb5ab /toolsrc/src/PostBuildLint_BuildPolicies.cpp
parentd9462fdf490d3396cac58b1a935b1b8a982b3a72 (diff)
parentb921dce5fc17bd4c1c206b79eb0a7b8758dcf5bf (diff)
downloadvcpkg-7d4df89c1dfff0b2bad0165ac4579f6352935a94.tar.gz
vcpkg-7d4df89c1dfff0b2bad0165ac4579f6352935a94.zip
Merge branch 'master' into master
Diffstat (limited to 'toolsrc/src/PostBuildLint_BuildPolicies.cpp')
-rw-r--r--toolsrc/src/PostBuildLint_BuildPolicies.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/toolsrc/src/PostBuildLint_BuildPolicies.cpp b/toolsrc/src/PostBuildLint_BuildPolicies.cpp
index 4e5ac3cea..53dfcf95a 100644
--- a/toolsrc/src/PostBuildLint_BuildPolicies.cpp
+++ b/toolsrc/src/PostBuildLint_BuildPolicies.cpp
@@ -1,10 +1,11 @@
#include "pch.h"
#include "PostBuildLint_BuildPolicies.h"
-#include "vcpkg_Checks.h"
+#include "vcpkg_Enums.h"
namespace vcpkg::PostBuildLint::BuildPolicies
{
- static const std::string NAME_UNKNOWN = "PolicyUnknown";
+ static const std::string NULLVALUE_STRING = Enums::nullvalue_toString(ENUM_NAME);
+
static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage";
static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs";
@@ -16,10 +17,10 @@ namespace vcpkg::PostBuildLint::BuildPolicies
return NAME_EMPTY_PACKAGE;
case DLLS_WITHOUT_LIBS:
return NAME_DLLS_WITHOUT_LIBS;
- case UNKNOWN:
- return NAME_UNKNOWN;
+ case NULLVALUE:
+ return NULLVALUE_STRING;
default:
- Checks::unreachable();
+ Enums::unreachable(ENUM_NAME);
}
}
@@ -34,21 +35,13 @@ namespace vcpkg::PostBuildLint::BuildPolicies
return CMAKE_VARIABLE_EMPTY_PACKAGE;
case DLLS_WITHOUT_LIBS:
return CMAKE_VARIABLE_DLLS_WITHOUT_LIBS;
- case UNKNOWN:
- Checks::exit_with_message("No CMake command corresponds to UNKNOWN");
+ case NULLVALUE:
+ Enums::nullvalue_used(ENUM_NAME);
default:
- Checks::unreachable();
+ Enums::unreachable(ENUM_NAME);
}
}
- type::type(): backing_enum(backing_enum_t::UNKNOWN) {}
-
- const std::vector<type>& values()
- {
- static const std::vector<type>& v = {UNKNOWN, EMPTY_PACKAGE, DLLS_WITHOUT_LIBS};
- return v;
- }
-
type parse(const std::string& s)
{
if (s == NAME_EMPTY_PACKAGE)
@@ -61,6 +54,6 @@ namespace vcpkg::PostBuildLint::BuildPolicies
return BuildPolicies::DLLS_WITHOUT_LIBS;
}
- return BuildPolicies::UNKNOWN;
+ return BuildPolicies::NULLVALUE;
}
}