&self.source_id == id.get_source_id()))
}
+ /// If none, this dependencies must be built for all platforms.
+ /// If some, it must only be built for the specified platform.
+ pub fn get_only_for_platform(&self) -> Option<&str> {
+ self.only_for_platform.as_ref().map(|s| s.as_slice())
+ }
+
/// Returns true if the dependency should be built for this platform.
pub fn is_active_for_platform(&self, platform: &str) -> bool {
match self.only_for_platform {
name: dep.get_name().to_string(),
features: dep.get_features().to_vec(),
version_req: dep.get_version_req().to_string(),
- target: None, // FIXME: fill this out
+ target: dep.get_only_for_platform().map(|s| s.to_string()),
}
}).collect::<Vec<NewCrateDependency>>();
let manifest = pkg.get_manifest();