/// A structure returning the result of a compilation.
pub struct Compilation<'cfg> {
- /// A mapping from a package to the list of libraries that need to be
- /// linked when working with that package.
- // TODO: deprecated, remove
- pub libraries: HashMap<PackageId, HashSet<(Target, PathBuf)>>,
-
/// An array of all tests created during this compilation.
pub tests: Vec<(Package, TargetKind, String, PathBuf)>,
server.configure(&mut rustc);
}
Ok(Compilation {
- libraries: HashMap::new(),
native_dirs: BTreeSet::new(), // TODO: deprecated, remove
root_output: PathBuf::from("/"),
deps_output: PathBuf::from("/"),
));
} else if unit.target.is_bin() || unit.target.is_bin_example() {
self.compilation.binaries.push(bindst.clone());
- } else if unit.target.is_lib() {
- let pkgid = unit.pkg.package_id().clone();
- self.compilation
- .libraries
- .entry(pkgid)
- .or_insert_with(HashSet::new)
- .insert((unit.target.clone(), output.path.clone()));
}
}
.or_insert_with(Vec::new)
.push(("OUT_DIR".to_string(), out_dir));
}
-
- if !dep.target.is_lib() {
- continue;
- }
- if dep.mode.is_doc() {
- continue;
- }
-
- let outputs = self.outputs(dep)?;
- self.compilation
- .libraries
- .entry(unit.pkg.package_id().clone())
- .or_insert_with(HashSet::new)
- .extend(
- outputs
- .iter()
- .map(|output| (dep.target.clone(), output.path.clone())),
- );
}
if unit.mode == CompileMode::Doctest {