aboutsummaryrefslogtreecommitdiff
path: root/crates/project_model/src/workspace.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-07 19:53:34 +0000
committerGitHub <[email protected]>2020-12-07 19:53:34 +0000
commitdfd0626dbfea6816d38e6f72ce84f567877603e7 (patch)
treed3c6ac0eb9ad7d3d516f532df8e607b781942709 /crates/project_model/src/workspace.rs
parentd6aa1ba7d4c4e7cd0f82f3d0d4f8ec3c364dfc6a (diff)
parenteeeacc4727b9263f6ad33ae08ce38c38eb52c5f3 (diff)
Merge #6754
6754: Apply environment set by build scripts r=jonas-schievink a=jonas-schievink Fixes inclusion of generated files in typenum/heapless/defmt etc. bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/project_model/src/workspace.rs')
-rw-r--r--crates/project_model/src/workspace.rs5
1 files changed, 5 insertions, 0 deletions
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(
453 opts.extend(pkg.cfgs.iter().cloned()); 453 opts.extend(pkg.cfgs.iter().cloned());
454 opts 454 opts
455 }; 455 };
456
456 let mut env = Env::default(); 457 let mut env = Env::default();
458 for (k, v) in &pkg.envs {
459 env.set(k, v.clone());
460 }
457 if let Some(out_dir) = &pkg.out_dir { 461 if let Some(out_dir) = &pkg.out_dir {
458 // NOTE: cargo and rustc seem to hide non-UTF-8 strings from env! and option_env!() 462 // NOTE: cargo and rustc seem to hide non-UTF-8 strings from env! and option_env!()
459 if let Some(out_dir) = out_dir.to_str().map(|s| s.to_owned()) { 463 if let Some(out_dir) = out_dir.to_str().map(|s| s.to_owned()) {
460 env.set("OUT_DIR", out_dir); 464 env.set("OUT_DIR", out_dir);
461 } 465 }
462 } 466 }
467
463 let proc_macro = 468 let proc_macro =
464 pkg.proc_macro_dylib_path.as_ref().map(|it| proc_macro_loader(&it)).unwrap_or_default(); 469 pkg.proc_macro_dylib_path.as_ref().map(|it| proc_macro_loader(&it)).unwrap_or_default();
465 470