]> git.proxmox.com Git - cargo.git/commitdiff
Pass target configs directly to BuildState::new()
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Sat, 28 Apr 2018 12:50:56 +0000 (14:50 +0200)
committerDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 3 May 2018 19:54:48 +0000 (21:54 +0200)
src/cargo/core/compiler/context/mod.rs
src/cargo/core/compiler/custom_build.rs

index 02b6f11112096582945ca21cbe1a87568b9c50df..c106a04685355dc6324f62ca02d760a389b16587 100644 (file)
@@ -100,7 +100,10 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
         Ok(Self {
             bcx,
             compilation,
-            build_state: Arc::new(BuildState::new(&bcx.build_config)),
+            build_state: Arc::new(BuildState::new(
+                &bcx.build_config.host,
+                &bcx.build_config.target,
+            )),
             fingerprints: HashMap::new(),
             compiled: HashSet::new(),
             build_scripts: HashMap::new(),
index 78dfe759b5d84836a9ac0c227f576a22df2c6711..1aba821d2085a6bcc9da36de6196e146c2b78cdd 100644 (file)
@@ -12,7 +12,7 @@ use util::{self, internal, paths, profile};
 use util::{Cfg, Freshness};
 
 use super::job::Work;
-use super::{fingerprint, Context, Kind, Unit};
+use super::{fingerprint, Context, Kind, TargetConfig, Unit};
 
 /// Contains the parsed output of a custom build script.
 #[derive(Clone, Debug, Hash)]
@@ -364,10 +364,10 @@ fn build_work<'a, 'cfg>(cx: &mut Context<'a, 'cfg>, unit: &Unit<'a>) -> CargoRes
 }
 
 impl BuildState {
-    pub fn new(config: &super::BuildConfig) -> BuildState {
+    pub fn new(host_config: &TargetConfig, target_config: &TargetConfig) -> BuildState {
         let mut overrides = HashMap::new();
-        let i1 = config.host.overrides.iter().map(|p| (p, Kind::Host));
-        let i2 = config.target.overrides.iter().map(|p| (p, Kind::Target));
+        let i1 = host_config.overrides.iter().map(|p| (p, Kind::Host));
+        let i2 = target_config.overrides.iter().map(|p| (p, Kind::Target));
         for ((name, output), kind) in i1.chain(i2) {
             overrides.insert((name.clone(), kind), output.clone());
         }