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-type-pattern-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/target-type-pattern-specific')
-rw-r--r-- | tests/variable/target-type-pattern-specific/buildfile | 5 | ||||
-rw-r--r-- | tests/variable/target-type-pattern-specific/testscript | 58 |
2 files changed, 63 insertions, 0 deletions
diff --git a/tests/variable/target-type-pattern-specific/buildfile b/tests/variable/target-type-pattern-specific/buildfile new file mode 100644 index 0000000..efed550 --- /dev/null +++ b/tests/variable/target-type-pattern-specific/buildfile @@ -0,0 +1,5 @@ +# file : tests/variable/target-type-pattern-specific/buildfile +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +./: testscript $b diff --git a/tests/variable/target-type-pattern-specific/testscript b/tests/variable/target-type-pattern-specific/testscript new file mode 100644 index 0000000..e60dbe1 --- /dev/null +++ b/tests/variable/target-type-pattern-specific/testscript @@ -0,0 +1,58 @@ +# file : tests/variable/target-type-pattern-specific/testscript +# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# NOTE: see also old tests. + +.include ../../common.testscript + +: basic +: +$* <<EOI >>EOO +x = x +y = y +dir{*}: x = X +dir{*}: y += Y +print $(./: x) +print $(./: y) +EOI +X +y Y +EOO + +: block +: +$* <<EOI >>EOO +x = x +y = y +dir{*}: +{ + x = X + y += Y + z = $x # Note: from scope. +} +print $(./: x) +print $(./: y) +print $(./: z) +EOI +X +y Y +x +EOO + +: block-multiple +: +$* <<EOI >>EOO +x = x +y = y +file{f*} file{b*}: +{ + x = X + y += Y +} +print $(file{foo}: x) +print $(file{bar}: y) +EOI +X +y Y +EOO |