From 2b1272f1c94ab1dbaf806af9c02ef866267ffed7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 May 2019 14:12:45 +0200 Subject: Generalize target/prerequisite var block, initial ad hoc target work Target/prerequisite-specific variable blocks can now be present even if there are prerequisites. For example, now instead of: exe{foo}: cxx{foo} exe{foo}: cc.loptions += ... Or: exe{foo}: cxx{foo} exe{foo}: { cc.loptions += ... cc.libs += ... } We can write: exe{foo}: cxx{foo} { cc.loptions += ... cc.libs += ... } This also works with dependency chains in which case the block applies to the set of prerequisites (note: not targets) before the last ':'. For example: ./: exe{foo}: libue{foo}: cxx{foo} { bin.whole = false # Applies to the libue{foo} prerequisite. } --- build2/token.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'build2/token.cxx') diff --git a/build2/token.cxx b/build2/token.cxx index 81b7c55..8b62b46 100644 --- a/build2/token.cxx +++ b/build2/token.cxx @@ -36,6 +36,9 @@ namespace build2 case token_type::lsbrace: os << q << '[' << q; break; case token_type::rsbrace: os << q << ']' << q; break; + case token_type::labrace: os << q << '<' << q; break; + case token_type::rabrace: os << q << '>' << q; break; + case token_type::assign: os << q << '=' << q; break; case token_type::prepend: os << q << "=+" << q; break; case token_type::append: os << q << "+=" << q; break; -- cgit v1.1