blob: d7d67c991c083662247f9622ef93b873e18e58e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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;
}
}
|