mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-25 12:03:32 +01:00
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
![]() |
#include "pch.h"
|
||
|
#include "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) {}
|
||
|
|
||
|
type parse(const std::string& s)
|
||
|
{
|
||
|
if (s == NAME_DLLS_WITHOUT_LIBS)
|
||
|
{
|
||
|
return BuildPolicies::DLLS_WITHOUT_LIBS;
|
||
|
}
|
||
|
|
||
|
return BuildPolicies::UNKNOWN;
|
||
|
}
|
||
|
}
|