diff options
author | Melody Horn <melody@boringcactus.com> | 2024-11-10 21:28:27 -0700 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2024-11-10 21:28:27 -0700 |
commit | 07b4b35c44d488fea2916e7d985f60f923ed0e4c (patch) | |
tree | 6bc7c516198d35b6dc9bcb2d53083b31a78d4abe /src/makefile/input.rs | |
parent | fca10b517b448b4023ad8c3225e59dcefd4004e4 (diff) | |
download | makers-07b4b35c44d488fea2916e7d985f60f923ed0e4c.tar.gz makers-07b4b35c44d488fea2916e7d985f60f923ed0e4c.zip |
fix that with no default features
Diffstat (limited to 'src/makefile/input.rs')
-rw-r--r-- | src/makefile/input.rs | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/makefile/input.rs b/src/makefile/input.rs index f1d4f70..fccea3b 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -16,6 +16,7 @@ use crate::args::Args; use super::command_line::CommandLine; #[cfg(feature = "full")] use super::conditional::{Line as ConditionalLine, State as ConditionalState}; +#[cfg(feature = "full")] use super::eval_context::DeferredEvalContext; use super::inference_rules::InferenceRule; #[cfg(feature = "full")] @@ -594,6 +595,7 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { log::error!("rule-specific macros are not implemented yet"); return Ok(()); } + #[cfg(feature = "full")] let mut deferred_eval_context = DeferredEvalContext::new(self); let prerequisites = self .macros @@ -630,7 +632,12 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { Ok(macro_pieces.join(" ")) }) - .expand(&prerequisites, Some(&mut deferred_eval_context))?; + .expand( + &prerequisites, + #[cfg(feature = "full")] + Some(&mut deferred_eval_context), + )?; + #[cfg(feature = "full")] for child in deferred_eval_context { self.extend(child); } @@ -903,8 +910,14 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { } fn expand_macros(&mut self, text: &TokenString) -> Result<String> { + #[cfg(feature = "full")] let mut deferred_eval_context = DeferredEvalContext::new(self); - let result = self.expand_macros_deferred_eval(text, &mut deferred_eval_context); + let result = self.expand_macros_deferred_eval( + text, + #[cfg(feature = "full")] + &mut deferred_eval_context, + ); + #[cfg(feature = "full")] for child in deferred_eval_context { self.extend(child); } @@ -914,10 +927,14 @@ impl<'a, 'parent, R: BufRead> MakefileReader<'a, 'parent, R> { fn expand_macros_deferred_eval( &self, text: &TokenString, - deferred_eval_context: &mut DeferredEvalContext<R>, + #[cfg(feature = "full")] deferred_eval_context: &mut DeferredEvalContext<R>, ) -> Result<String> { self.macros - .expand(text, Some(deferred_eval_context)) + .expand( + text, + #[cfg(feature = "full")] + Some(deferred_eval_context), + ) .wrap_err_with(|| format!("while expanding \"{}\"", text)) } |