Add optional flag to manifest for dependencies

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
This commit is contained in:
hi-rustin 2023-11-19 21:37:29 +08:00
parent 12d7818192
commit 504c4b2fbb

View File

@ -1564,6 +1564,9 @@ impl Package {
"#,
target, kind, dep.name, dep.vers
));
if dep.optional {
manifest.push_str("optional = true\n");
}
if let Some(artifact) = &dep.artifact {
manifest.push_str(&format!("artifact = \"{}\"\n", artifact));
}