From 8fb7c0f7f70b286f09e513ea42de8f87314b53b7 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 29 Oct 2017 10:38:59 +0800 Subject: Minicargo - Activate default features even when it's not the first init --- tools/minicargo/manifest.cpp | 10 +++++++--- 1 file 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); } } -- cgit v1.2.3