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/target-specific/testscript | 36 +++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'tests/variable/target-specific') 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 : $* <>EOO x = x @@ -25,6 +25,38 @@ X Z EOO +: block +: +$* <>EOO +x = x +./: +{ + x = X + y = $x +} +print $(./: x) +print $(./: y) +EOI +X +X +EOO + +: block-multiple +: +$* <>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 : $* <>EOO -- cgit v1.1