diff --git a/src/cargo/ops/cargo_rustc/output_depinfo.rs b/src/cargo/ops/cargo_rustc/output_depinfo.rs index f51440a9e..6daf58141 100644 --- a/src/cargo/ops/cargo_rustc/output_depinfo.rs +++ b/src/cargo/ops/cargo_rustc/output_depinfo.rs @@ -70,7 +70,15 @@ pub fn output_depinfo<'a, 'b>(context: &mut Context<'a, 'b>, unit: &Unit<'a>) -> let mut deps = HashSet::new(); let mut visited = HashSet::new(); let success = add_deps_for_unit(&mut deps, context, unit, &mut visited).is_ok(); - let basedir = None; // TODO + let basedir_string; + let basedir = match context.config.get_path("build.dep-info-basedir")? { + Some(value) => { + basedir_string = value.val.as_os_str().to_str(). + ok_or_else(|| internal("build.dep-info-basedir path not utf-8"))?.to_string(); + Some(basedir_string.as_str()) + } + None => None, + }; for &(_, ref link_dst, _) in context.target_filenames(unit)?.iter() { if let Some(ref link_dst) = *link_dst { let output_path = link_dst.with_extension("d"); diff --git a/src/doc/src/reference/config.md b/src/doc/src/reference/config.md index b19c8923c..d72e9a75d 100644 --- a/src/doc/src/reference/config.md +++ b/src/doc/src/reference/config.md @@ -104,6 +104,7 @@ target = "triple" # build for the target triple target-dir = "target" # path of where to place all generated artifacts rustflags = ["..", ".."] # custom flags to pass to all compiler invocations incremental = true # whether or not to enable incremental compilation +dep-info-basedir = ".." # full path for the base directory for targets in depfiles [term] verbose = false # whether cargo provides verbose output