diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-07-06 10:22:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-07-06 10:22:12 +0200 |
commit | 9a9276e1d151910ba31db4d91521b41e5ea1435f (patch) | |
tree | a4bf5d320c6c1c6f5d98e00a2620c2bb8a33fb3e /doc | |
parent | 736812cb586e0f80742337dce802ad24adf331ad (diff) |
Adjust variable block applicability in dependency chains
Before the block used to apply to the set of prerequisites before the last
`:`. This turned out to be counterintuitive and not very useful since
prerequisite-specific variables are a lot less common than target specific.
And it doesn't fit with ad hoc recipes.
The new rule is if the chain ends with `:`, then the block applies to the last
set of prerequisites. Otherwise, it applies to the last set of targets. For
example:
./: exe{test}: cxx{main}
{
test = true # Applies to the exe{test} target.
}
./: exe{test}: libue{test}:
{
bin.whole = false # Applies to the libue{test} prerequisite.
}
This is actually consistent with both non-chain and non-block cases.
Consider:
exe{test}: cxx{main}
{
test = true
}
exe{test}: libue{test}:
{
bin.whole = false
}
exe{test}: libue{test}: bin.whole = false
The only exception we now have in this overall approach of "if the
dependency declaration ends with a colon, then what follows is for a
prerequisite" is for the first semicolon:
exe{test}:
{
test = true
}
exe{test}: test = true
But that's probably intuitive enough since there cannot be a prerequisite
without a target.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual.cli | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/manual.cli b/doc/manual.cli index cf2ec3a..ba0aa63 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -3259,11 +3259,17 @@ h{config}: in{config} } \ -In case of a dependency chain, the block applies to the set of prerequisites -(note: \i{not targets}) before last \c{:}. For example: +In case of a dependency chain, if the chain ends with a colon (\c{:}), then +the block applies to the last set of prerequisites. Otherwise, it applies to +the last set of targets. For example: \ -./: exe{test}: libue{test}: cxx{test} +./: exe{test}: cxx{main} +{ + test = true # Applies to the exe{test} target. +} + +./: exe{test}: libue{test}: { bin.whole = false # Applies to the libue{test} prerequisite. } |