From eeeacc4727b9263f6ad33ae08ce38c38eb52c5f3 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 7 Dec 2020 20:52:31 +0100 Subject: Apply environment set by build scripts --- crates/project_model/src/workspace.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/project_model/src/workspace.rs') diff --git a/crates/project_model/src/workspace.rs b/crates/project_model/src/workspace.rs index ab5cbae11..7f4a7e56b 100644 --- a/crates/project_model/src/workspace.rs +++ b/crates/project_model/src/workspace.rs @@ -453,13 +453,18 @@ fn add_target_crate_root( opts.extend(pkg.cfgs.iter().cloned()); opts }; + let mut env = Env::default(); + for (k, v) in &pkg.envs { + env.set(k, v.clone()); + } if let Some(out_dir) = &pkg.out_dir { // NOTE: cargo and rustc seem to hide non-UTF-8 strings from env! and option_env!() if let Some(out_dir) = out_dir.to_str().map(|s| s.to_owned()) { env.set("OUT_DIR", out_dir); } } + let proc_macro = pkg.proc_macro_dylib_path.as_ref().map(|it| proc_macro_loader(&it)).unwrap_or_default(); -- cgit v1.2.3