aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/compile-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-05-15 07:57:45 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-05-15 07:57:45 +0200
commit33111a31562f364e496b8c8bba47693babecdbc0 (patch)
tree8a9b1f10f82e839d54760d9440f101e403c69ae4 /build2/cc/compile-rule.cxx
parent6be7ff595009179fc46c2a22289cea8bf11e3feb (diff)
Add ability to depend on (declared) ad hoc group member
Diffstat (limited to 'build2/cc/compile-rule.cxx')
-rw-r--r--build2/cc/compile-rule.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/build2/cc/compile-rule.cxx b/build2/cc/compile-rule.cxx
index cd49689..3458a1b 100644
--- a/build2/cc/compile-rule.cxx
+++ b/build2/cc/compile-rule.cxx
@@ -677,8 +677,10 @@ namespace build2
// (e.g., foo.mxx and foo.cxx) which means obj*{} targets could
// collide. So we add the module extension to the target name.
//
- target_lock obj (add_adhoc_member (a, t, tts.obj, e.c_str ()));
- obj.target->as<file> ().derive_path (o);
+ file& obj (add_adhoc_member<file> (t, tts.obj, e.c_str ()));
+
+ if (obj.path ().empty ())
+ obj.derive_path (o);
}
}