From 6f6ea12ebbd9251cc885a0720b0ec09fbc2d9331 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 19 Jul 2022 11:11:44 +0200 Subject: Warn about conditional dependency declarations during distribution --- libbuild2/parser.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libbuild2/parser.hxx') diff --git a/libbuild2/parser.hxx b/libbuild2/parser.hxx index f806568..61ecd5b 100644 --- a/libbuild2/parser.hxx +++ b/libbuild2/parser.hxx @@ -91,6 +91,12 @@ namespace build2 parse_export_stub (istream& is, const path_name& name, scope& rs, scope& bs) { + auto g = make_guard ([this, old = imported_] () mutable + { + imported_ = old; + }); + imported_ = true; + parse_buildfile (is, name, &rs, bs); return move (export_value); } @@ -906,6 +912,9 @@ namespace build2 small_vector attributes_; + bool imported_ = false; // True if loaded via export stub. + optional condition_; // Innermost if/switch (but not in recipe). + target* default_target_ = nullptr; replay_token peek_; -- cgit v1.1