diff options
author | John Hodge <tpg@ucc.asn.au> | 2019-05-12 17:09:58 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2019-05-12 17:09:58 +0800 |
commit | 65fa34c0f38bc1511ff2fee7efc4744d66b15a46 (patch) | |
tree | 9ffca2b85793e5a9c79fbceb88c36573d1c438ae /tools/minicargo/manifest.cpp | |
parent | 1345b89c88d32fed62df16e492e18bcf7ded477c (diff) | |
download | mrust-65fa34c0f38bc1511ff2fee7efc4744d66b15a46.tar.gz |
minicargo - dependency file support, planning for dylibs
Diffstat (limited to 'tools/minicargo/manifest.cpp')
-rw-r--r-- | tools/minicargo/manifest.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp index 8f49c538..be2e1c77 100644 --- a/tools/minicargo/manifest.cpp +++ b/tools/minicargo/manifest.cpp @@ -434,7 +434,26 @@ namespace } else if( key == "crate-type" ) { - // TODO: Support crate types + //assert_kv_size(kv, base_idx + 1); + //assert_type(kv, base_idx + 1); + assert(kv.path.size() == base_idx + 1); + if( !target.m_crate_types.empty() ) { + // TODO: Error, multiple instances + } + for(const auto& sv : kv.value.m_sub_values) + { + const auto& s = sv.as_string(); + if(s == "rlib") { + target.m_crate_types.push_back(PackageTarget::CrateType::rlib); + } + else if(s == "dylib") { + target.m_crate_types.push_back(PackageTarget::CrateType::dylib); + } + // TODO: Other crate types + else { + throw ::std::runtime_error(format("Unknown crate type - ", s)); + } + } } else if( key == "required-features" ) { |