aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-07-19 11:11:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-07-19 11:47:33 +0200
commit6f6ea12ebbd9251cc885a0720b0ec09fbc2d9331 (patch)
treefde284260771c50a04662df82f5acd839f27cc41 /libbuild2/parser.hxx
parentf0e0c9ce34310070f7a7547d9262deef59751407 (diff)
Warn about conditional dependency declarations during distribution
Diffstat (limited to 'libbuild2/parser.hxx')
-rw-r--r--libbuild2/parser.hxx9
1 files changed, 9 insertions, 0 deletions
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, 2> attributes_;
+ bool imported_ = false; // True if loaded via export stub.
+ optional<location> condition_; // Innermost if/switch (but not in recipe).
+
target* default_target_ = nullptr;
replay_token peek_;