self.unit_dependencies[unit].clone()
}
+ /// Whether a dependency should be compiled for the host or target platform,
+ /// specified by `Kind`.
fn dep_platform_activated(&self, dep: &Dependency, kind: Kind) -> bool {
// If this dependency is only available for certain platforms,
// make sure we're only enabling it for that platform.
unit.pkg
.dependencies()
.iter()
- .filter(|d| d.name() == dep.name())
+ .filter(|d| d.name() == dep.name() && d.version_req().matches(dep.version()))
.any(|dep| match dep.kind() {
DepKind::Normal => cx.dep_platform_activated(dep, unit.kind),
_ => false,
pub use self::encode::{EncodableDependency, EncodablePackageId, EncodableResolve};
pub use self::encode::{Metadata, WorkspaceResolve};
-pub use self::resolve::Resolve;
+pub use self::resolve::{Resolve, Deps, DepsNotReplaced};
pub use self::types::Method;
mod context;
compile_with_exec(ws, options, Arc::new(DefaultExecutor))
}
+/// Like `compile` but allows specifing a custom `Executor` that will be able to intercept build
+/// calls and add custom logic. `compile` uses `DefaultExecutor` which just passes calls through.
pub fn compile_with_exec<'a>(
ws: &Workspace<'a>,
options: &CompileOptions<'a>,
let mut lib_names = HashMap::new();
let mut bin_names = HashMap::new();
- //println!("{:#?}", pkgs);
for package in &pkgs {
for target in package.targets().iter().filter(|t| t.documented()) {
if target.is_lib() {
}
ops::compile(ws, &options.compile_opts)?;
- //println!("Made it!");
if options.open_result {
let name = if pkgs.len() > 1 {