summaryrefslogtreecommitdiff
path: root/tools/minicargo/manifest.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2019-10-27 19:34:34 +0800
committerJohn Hodge <tpg@mutabah.net>2019-10-27 19:34:34 +0800
commit676ff7e33e7cfa21b58a1efafc65c15f8d6c7f3e (patch)
treeb86521d65e78fc75bb69c6a08e715844c80b7ccc /tools/minicargo/manifest.cpp
parentdc806b29ce79d6ba40aca85bbdc5640261070910 (diff)
downloadmrust-676ff7e33e7cfa21b58a1efafc65c15f8d6c7f3e.tar.gz
minicargo - Fix Cargo.toml interpreting error with MSVC libcurl
Diffstat (limited to 'tools/minicargo/manifest.cpp')
-rw-r--r--tools/minicargo/manifest.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp
index edebd71a..ac9c9cb2 100644
--- a/tools/minicargo/manifest.cpp
+++ b/tools/minicargo/manifest.cpp
@@ -241,29 +241,34 @@ PackageManifest PackageManifest::load_from_toml(const ::std::string& path)
// If so, parse as if the path was `real_section....`
if( success )
{
- if( real_section == "dependencies" )
+ if( real_section == "dependencies"
+ || real_section == "dev-dependencies"
+ || real_section == "build-dependencies"
+ )
{
+ ::std::vector<PackageRef>& dep_list =
+ real_section == "dependencies" ? rv.m_dependencies :
+ real_section == "build-dependencies" ? rv.m_build_dependencies :
+ /*real_section == "dev-dependencies" ? */ rv.m_dev_dependencies /*:
+ throw ""*/
+ ;
assert(key_val.path.size() > 3);
const auto& depname = key_val.path[3];
// Find/create dependency descriptor
- auto it = ::std::find_if(rv.m_dependencies.begin(), rv.m_dependencies.end(), [&](const auto& x) { return x.m_name == depname; });
- bool was_added = (it == rv.m_dependencies.end());
+ auto it = ::std::find_if(dep_list.begin(), dep_list.end(), [&](const auto& x) { return x.m_name == depname; });
+ bool was_added = (it == dep_list.end());
if( was_added )
{
- it = rv.m_dependencies.insert(it, PackageRef{ depname });
+ it = dep_list.insert(it, PackageRef{ depname });
}
it->fill_from_kv(was_added, key_val, 4);
}
- else if( real_section == "dev-dependencies" )
- {
- // TODO: Developemnt (test/bench) deps
- }
else
{
- TODO("Unknown manifest section for target - " << real_section);
+ TODO(toml_file.lexer() << ": Unknown manifest section '" << real_section << "' in `target`");
}
}
}