bootstrap: support target specific config overrides
This commit is contained in:
parent
213ad10c8f
commit
9185ddb019
@ -644,7 +644,20 @@ fn do_merge<T: Merge>(x: &mut Option<T>, y: Option<T>, replace: ReplaceOpt) {
|
||||
do_merge(&mut self.llvm, llvm, replace);
|
||||
do_merge(&mut self.rust, rust, replace);
|
||||
do_merge(&mut self.dist, dist, replace);
|
||||
assert!(target.is_none(), "merging target-specific config is not currently supported");
|
||||
|
||||
match (self.target.as_mut(), target) {
|
||||
(_, None) => {}
|
||||
(None, Some(target)) => self.target = Some(target),
|
||||
(Some(original_target), Some(new_target)) => {
|
||||
for (triple, new) in new_target {
|
||||
if let Some(original) = original_target.get_mut(&triple) {
|
||||
original.merge(new, replace);
|
||||
} else {
|
||||
original_target.insert(triple, new);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user