vcpkg/toolsrc/include/PostBuildLint_BuildPolicies.h

43 lines
1.5 KiB
C
Raw Normal View History

#pragma once
#include <string>
2017-02-10 11:00:09 +08:00
#include <array>
2017-04-26 07:38:12 +08:00
namespace vcpkg::PostBuildLint
{
2017-04-26 07:38:12 +08:00
struct BuildPolicies final
{
2017-04-26 07:38:12 +08:00
enum class BackingEnum
{
NULLVALUE = 0,
EMPTY_PACKAGE,
DLLS_WITHOUT_LIBS,
ONLY_RELEASE_CRT,
EMPTY_INCLUDE_FOLDER
};
static BuildPolicies parse(const std::string& s);
constexpr BuildPolicies() : backing_enum(BackingEnum::NULLVALUE) {}
constexpr explicit BuildPolicies(BackingEnum backing_enum) : backing_enum(backing_enum) { }
2017-04-04 05:50:50 +08:00
constexpr operator BackingEnum() const { return backing_enum; }
const std::string& to_string() const;
const std::string& cmake_variable() const;
private:
2017-04-04 05:50:50 +08:00
BackingEnum backing_enum;
};
2017-02-10 11:00:09 +08:00
static const std::string ENUM_NAME = "vcpkg::PostBuildLint::BuildPolicies";
2017-02-01 10:55:14 +08:00
2017-04-26 07:38:12 +08:00
namespace BuildPoliciesC
{
2017-04-26 08:05:48 +08:00
static constexpr BuildPolicies NULLVALUE(BuildPolicies::BackingEnum::NULLVALUE);
static constexpr BuildPolicies EMPTY_PACKAGE(BuildPolicies::BackingEnum::EMPTY_PACKAGE);
static constexpr BuildPolicies DLLS_WITHOUT_LIBS(BuildPolicies::BackingEnum::DLLS_WITHOUT_LIBS);
static constexpr BuildPolicies ONLY_RELEASE_CRT(BuildPolicies::BackingEnum::ONLY_RELEASE_CRT);
static constexpr BuildPolicies EMPTY_INCLUDE_FOLDER(BuildPolicies::BackingEnum::EMPTY_INCLUDE_FOLDER);
2017-04-26 07:38:12 +08:00
2017-04-26 08:05:48 +08:00
static constexpr std::array<BuildPolicies, 4> VALUES = { EMPTY_PACKAGE,DLLS_WITHOUT_LIBS, ONLY_RELEASE_CRT, EMPTY_INCLUDE_FOLDER };
2017-04-26 07:38:12 +08:00
}}