diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2016-09-28 12:52:49 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2016-10-05 17:44:02 -0700 |
| commit | 52b7630c86cda1fce144d3bddfc27d434ed3011e (patch) | |
| tree | a8f660a0b40a23dcf4bbe3fff579c9c739b24d2a | |
| parent | 6685ff096d7426f0d4c14fa10f6c324274ee4df5 (diff) | |
| download | vcpkg-52b7630c86cda1fce144d3bddfc27d434ed3011e.tar.gz vcpkg-52b7630c86cda1fce144d3bddfc27d434ed3011e.zip | |
Add triplet::build_type()
| -rw-r--r-- | toolsrc/include/triplet.h | 8 | ||||
| -rw-r--r-- | toolsrc/src/triplet.cpp | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/toolsrc/include/triplet.h b/toolsrc/include/triplet.h index 32ea2e711..bc99a17df 100644 --- a/toolsrc/include/triplet.h +++ b/toolsrc/include/triplet.h @@ -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; diff --git a/toolsrc/src/triplet.cpp b/toolsrc/src/triplet.cpp index a6816b445..af2ca2a72 100644 --- a/toolsrc/src/triplet.cpp +++ b/toolsrc/src/triplet.cpp @@ -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; + } } |
