2017-02-01 09:09:48 +08:00
|
|
|
#pragma once
|
2017-04-29 04:24:33 +08:00
|
|
|
#include "CStringView.h"
|
2017-02-10 11:00:09 +08:00
|
|
|
#include <array>
|
2017-04-28 08:56:06 +08:00
|
|
|
#include <string>
|
2017-02-01 09:09:48 +08:00
|
|
|
|
2017-04-26 07:38:12 +08:00
|
|
|
namespace vcpkg::PostBuildLint
|
2017-02-01 09:09:48 +08:00
|
|
|
{
|
2017-04-26 07:38:12 +08:00
|
|
|
struct BuildPolicies final
|
2017-02-01 09:09:48 +08:00
|
|
|
{
|
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) {}
|
2017-04-28 08:56:06 +08:00
|
|
|
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; }
|
2017-02-01 09:09:48 +08:00
|
|
|
|
2017-04-04 08:08:08 +08:00
|
|
|
const std::string& to_string() const;
|
2017-02-01 09:09:48 +08:00
|
|
|
const std::string& cmake_variable() const;
|
|
|
|
|
|
|
|
private:
|
2017-04-04 05:50:50 +08:00
|
|
|
BackingEnum backing_enum;
|
2017-02-01 09:09:48 +08:00
|
|
|
};
|
|
|
|
|
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:16:09 +08:00
|
|
|
|
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-28 08:56:06 +08:00
|
|
|
static constexpr std::array<BuildPolicies, 4> VALUES = {
|
2017-04-29 03:55:50 +08:00
|
|
|
EMPTY_PACKAGE, DLLS_WITHOUT_LIBS, ONLY_RELEASE_CRT, EMPTY_INCLUDE_FOLDER};
|
2017-04-28 08:56:06 +08:00
|
|
|
}
|
|
|
|
}
|