From a14daf38475a414e462708d9b0f4d651e5119b58 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 21 Nov 2018 11:03:37 +0200 Subject: Add support for target and prerequisite specific variable blocks For example, now instead of: lib{foo}: cxx.loptions += -static lib{foo}: cxx.libs += -lpthread We can write: lib{foo}: { cxx.loptions += -static cxx.libs += -lpthread } The same works for prerequisites as well as target type/patterns. For example: exe{*.test}: { test = true install = false } --- tests/variable/prerequisite-specific/testscript | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'tests/variable/prerequisite-specific') diff --git a/tests/variable/prerequisite-specific/testscript b/tests/variable/prerequisite-specific/testscript index ef14cfc..ed7c60b 100644 --- a/tests/variable/prerequisite-specific/testscript +++ b/tests/variable/prerequisite-specific/testscript @@ -62,6 +62,58 @@ EOI } EOE +: block +: +$* <>/~%EOE% +foo = COX +dir{x}: foo = FOX +dir{x}: dir{a}: +{ + foo = FOO + bar = BAR +} +dump dir{x} +EOI +:8:1: dump: +% .+/dir\{x/\}:% + { + foo = FOX + } +% .+/dir\{x/\}: .+:dir\{a/\}:% + { + bar = BAR + foo = FOO + } +EOE + +: block-multiple +: +$* <>/~%EOE% +dir{y}: foo = FOX +dir{x} dir{y}: dir{a} dir{b}: +{ + foo += FOO + bar = BAR $foo +} +dump dir{y} +EOI +:7:1: dump: +% .+/dir\{y/\}:% + { + foo = FOX + } +% .+/dir\{y/\}: .+:dir\{a/\}:% + { + bar = BAR FOX FOO + foo = FOX FOO + } +% .+/dir\{y/\}: .+:dir\{b/\}:% + { + bar = BAR FOX FOO + foo = FOX FOO + } +EOE + : chain : $* <>/~%EOE% -- cgit v1.1