diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-21 11:03:37 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-11-21 11:03:37 +0200 |
commit | a14daf38475a414e462708d9b0f4d651e5119b58 (patch) | |
tree | fa77c802d8bc7b16d91236c360853a164f13e761 /tests/variable/prerequisite-specific | |
parent | e4c4d8d65ea675eaa56c85661ba42e112ab70f4b (diff) |
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
}
Diffstat (limited to 'tests/variable/prerequisite-specific')
-rw-r--r-- | tests/variable/prerequisite-specific/testscript | 52 |
1 files changed, 52 insertions, 0 deletions
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 +: +$* <<EOI 2>>/~%EOE% +foo = COX +dir{x}: foo = FOX +dir{x}: dir{a}: +{ + foo = FOO + bar = BAR +} +dump dir{x} +EOI +<stdin>:8:1: dump: +% .+/dir\{x/\}:% + { + foo = FOX + } +% .+/dir\{x/\}: .+:dir\{a/\}:% + { + bar = BAR + foo = FOO + } +EOE + +: block-multiple +: +$* <<EOI 2>>/~%EOE% +dir{y}: foo = FOX +dir{x} dir{y}: dir{a} dir{b}: +{ + foo += FOO + bar = BAR $foo +} +dump dir{y} +EOI +<stdin>: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 : $* <<EOI 2>>/~%EOE% |