From c76e7e969b2277a0b4e00aad4a43cfbd5862869e Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 6 Apr 2021 18:35:25 -0600 Subject: don't do exports on POSIX --- src/makefile/input.rs | 8 +++++++- src/makefile/macro.rs | 7 ++++++- src/makefile/mod.rs | 6 +++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/makefile/input.rs b/src/makefile/input.rs index 1757222..912b119 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -703,6 +703,7 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { FinishedMakefileReader { inference_rules: self.inference_rules, macros: self.macros.data, + #[cfg(feature = "full")] macro_exports: self.macros.exported, targets: self.targets, first_non_special_target: self.first_non_special_target, @@ -712,7 +713,11 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { fn extend(&mut self, new: FinishedMakefileReader) { self.inference_rules.extend(new.inference_rules); - self.macros.extend(new.macros, new.macro_exports); + self.macros.extend( + new.macros, + #[cfg(feature = "full")] + new.macro_exports, + ); self.targets.extend(new.targets); if self.first_non_special_target.is_none() { self.first_non_special_target = new.first_non_special_target; @@ -724,6 +729,7 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { pub struct FinishedMakefileReader { pub inference_rules: Vec, pub macros: HashMap, + #[cfg(feature = "full")] pub macro_exports: ExportConfig, pub targets: HashMap, pub first_non_special_target: Option, diff --git a/src/makefile/macro.rs b/src/makefile/macro.rs index 65a87d1..c8a9542 100644 --- a/src/makefile/macro.rs +++ b/src/makefile/macro.rs @@ -183,7 +183,12 @@ impl<'parent, 'lookup> Set<'parent, 'lookup> { .or_else(|| self.parent.and_then(|p| p.get(name).cloned())) } - pub fn extend(&mut self, other: HashMap, other_exports: ExportConfig) { + pub fn extend( + &mut self, + other: HashMap, + #[cfg(feature = "full")] other_exports: ExportConfig, + ) { + #[cfg(feature = "full")] match (&mut self.exported, other_exports) { (ExportConfig::Only(se), ExportConfig::Only(oe)) => { se.extend(oe); diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index cdf9d0b..ac6090e 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -110,7 +110,11 @@ impl<'a> Makefile<'a> { pub fn extend(&mut self, new: FinishedMakefileReader) -> Result<()> { self.inference_rules.extend(new.inference_rules); - self.macros.extend(new.macros, new.macro_exports); + self.macros.extend( + new.macros, + #[cfg(feature = "full")] + new.macro_exports, + ); self.targets.borrow_mut().extend( new.targets .into_iter() -- cgit v1.2.3