vcpkg/toolsrc/include/PostBuildLint_BuildPolicies.h

46 lines
1.6 KiB
C
Raw Normal View History

#pragma once
2017-04-29 04:24:33 +08:00
#include "CStringView.h"
2017-02-10 11:00:09 +08:00
#include <array>
#include <string>
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-04-26 07:38:12 +08:00
namespace BuildPoliciesC
{
2017-04-29 04:24:33 +08:00
static constexpr CStringView ENUM_NAME = "vcpkg::PostBuildLint::BuildPolicies";
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
static constexpr std::array<BuildPolicies, 4> VALUES = {
EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, ONLY_RELEASE_CRT, EMPTY_INCLUDE_FOLDER};
}
}