From 4f9299b4639802e05e1cb27d8eb40305ff8e110e Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 11 Nov 2024 17:15:08 -0700 Subject: implement rule-specific macros for targets --- src/makefile/macro_scope.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/makefile/macro_scope.rs') diff --git a/src/makefile/macro_scope.rs b/src/makefile/macro_scope.rs index ba9b6cf..c03870f 100644 --- a/src/makefile/macro_scope.rs +++ b/src/makefile/macro_scope.rs @@ -43,6 +43,12 @@ impl<'a> MacroScope for LookupInternal<'a> { } } +impl MacroScope for Option<&T> { + fn get(&self, name: &str) -> Option> { + self.as_ref().and_then(|value| value.get(name)) + } +} + // warning on undefined macros is useful but can get repetitive fast lazy_static! { static ref WARNINGS_EMITTED: RwLock> = Default::default(); -- cgit v1.2.3