diff options
Diffstat (limited to 'tools/minicargo/manifest.cpp')
-rw-r--r-- | tools/minicargo/manifest.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp index cfbe7dc9..1e2b8497 100644 --- a/tools/minicargo/manifest.cpp +++ b/tools/minicargo/manifest.cpp @@ -225,6 +225,9 @@ PackageManifest PackageManifest::load_from_toml(const ::std::string& path) else if( cfg == "cfg(all(unix, not(target_os = \"macos\")))" ) { success = CFG_UNIX; } + else if( cfg == "cfg(not(target_os = \"emscripten\"))" ) { + success = true; + } else if( cfg == "cfg(all(unix, not(target_os = \"emscripten\"), not(target_os = \"macos\"), not(target_os = \"ios\")))" ) { success = CFG_UNIX; } @@ -565,10 +568,21 @@ void PackageManifest::set_features(const ::std::vector<::std::string>& features, } } } - auto it2 = ::std::find_if(m_dependencies.begin(), m_dependencies.end(), [&](const auto& x){ return x.m_name == featname; }); - if(it2 != m_dependencies.end()) + + { + auto it2 = ::std::find_if(m_dependencies.begin(), m_dependencies.end(), [&](const auto& x){ return x.m_name == featname; }); + if(it2 != m_dependencies.end()) + { + it2->m_optional_enabled = true; + } + } + { - it2->m_optional_enabled = true; + auto it2 = ::std::find_if(m_build_dependencies.begin(), m_build_dependencies.end(), [&](const auto& x){ return x.m_name == featname; }); + if(it2 != m_build_dependencies.end()) + { + it2->m_optional_enabled = true; + } } } } @@ -593,7 +607,10 @@ void PackageManifest::load_dependencies(Repository& repo, bool include_build) { for(auto& dep : m_build_dependencies) { - assert( !dep.m_optional ); + if( dep.m_optional && !dep.m_optional_enabled ) + { + continue ; + } dep.load_manifest(repo, base_path, true); } } |