aboutsummaryrefslogtreecommitdiff
path: root/build2/target
diff options
context:
space:
mode:
Diffstat (limited to 'build2/target')
-rw-r--r--build2/target5
1 files changed, 4 insertions, 1 deletions
diff --git a/build2/target b/build2/target
index 3123905..8c2b2da 100644
--- a/build2/target
+++ b/build2/target
@@ -149,6 +149,9 @@ namespace build2
const string name;
const string* ext; // Extension. NULL - unspecified, empty - no extension.
+ const dir_path&
+ out_dir () const {return out.empty () ? dir : out;}
+
// Target group to which this target belongs, if any. Note that we assume
// that the group and all its members are in the same scope (for example,
// in variable lookup). We also don't support nested groups (with a small
@@ -308,7 +311,7 @@ namespace build2
bool
in (const scope& s) const
{
- return (out.empty () ? dir : out).sub (s.out_path ());
+ return out_dir ().sub (s.out_path ());
}
// Prerequisites.