summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-10-29 10:38:59 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-10-29 10:38:59 +0800
commit8fb7c0f7f70b286f09e513ea42de8f87314b53b7 (patch)
treee6c1e86784aa5b66055ac82aa2e34f033543de93
parent2f62e331a2fc59ef8c94b840c75b6f549d01bbd7 (diff)
downloadmrust-8fb7c0f7f70b286f09e513ea42de8f87314b53b7.tar.gz
Minicargo - Activate default features even when it's not the first init
-rw-r--r--tools/minicargo/manifest.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp
index b1e947e8..adae89ec 100644
--- a/tools/minicargo/manifest.cpp
+++ b/tools/minicargo/manifest.cpp
@@ -519,15 +519,19 @@ const PackageTarget& PackageManifest::get_library() const
void PackageManifest::set_features(const ::std::vector<::std::string>& features, bool enable_default)
{
- TRACE_FUNCTION_F(m_name << " [" << features << "]");
+ TRACE_FUNCTION_F(m_name << " [" << features << "] " << enable_default);
size_t start = m_active_features.size();
- // 1. Install features
- if(enable_default && start == 0)
+ // 1. Install default features.
+ if(enable_default)
{
DEBUG("Including default features [" << m_default_features << "]");
for(const auto& feat : m_default_features)
{
+ auto it = ::std::find(m_active_features.begin(), m_active_features.end(), feat);
+ if(it != m_active_features.end()) {
+ continue ;
+ }
m_active_features.push_back(feat);
}
}