Add triplet::build_type()

This commit is contained in:
Alexander Karatarakis 2016-09-28 12:52:49 -07:00
parent 6685ff096d
commit 52b7630c86
2 changed files with 18 additions and 0 deletions

View File

@ -8,12 +8,20 @@ namespace vcpkg
{
static triplet from_canonical_name(const std::string& triplet_as_string);
enum class BuildType
{
DYNAMIC,
STATIC
};
static const triplet X86_WINDOWS;
static const triplet X64_WINDOWS;
static const triplet X86_UWP;
static const triplet X64_UWP;
static const triplet ARM_UWP;
BuildType build_type() const;
const std::string& canonical_name() const;
std::string architecture() const;

View File

@ -64,4 +64,14 @@ namespace vcpkg
auto it = std::find(this->m_canonical_name.cbegin(), this->m_canonical_name.cend(), '-');
return std::string(it + 1, this->m_canonical_name.cend());
}
triplet::BuildType triplet::build_type() const
{
if (this->m_canonical_name.find("static") != std::string::npos)
{
return BuildType::STATIC;
}
return BuildType::DYNAMIC;
}
}