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/target-specific/testscript | |
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/target-specific/testscript')
-rw-r--r-- | tests/variable/target-specific/testscript | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/tests/variable/target-specific/testscript b/tests/variable/target-specific/testscript index 497c863..8b0a846 100644 --- a/tests/variable/target-specific/testscript +++ b/tests/variable/target-specific/testscript @@ -1,10 +1,10 @@ -# file : tests/variable/scope-specific/testscript +# file : tests/variable/target-specific/testscript # copyright : Copyright (c) 2014-2018 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file .include ../../common.testscript -: basic-line +: basic : $* <<EOI >>EOO x = x @@ -25,6 +25,38 @@ X Z EOO +: block +: +$* <<EOI >>EOO +x = x +./: +{ + x = X + y = $x +} +print $(./: x) +print $(./: y) +EOI +X +X +EOO + +: block-multiple +: +$* <<EOI >>EOO +x = x +file{foo} file{bar}: +{ + x += X + y = $x +} +print $(file{foo}: y) +print $(file{bar}: y) +EOI +x X +x X +EOO + : eval-qual : $* <<EOI >>EOO |