From 33111a31562f364e496b8c8bba47693babecdbc0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 May 2019 07:57:45 +0200 Subject: Add ability to depend on (declared) ad hoc group member --- build2/cc/compile-rule.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'build2/cc/compile-rule.cxx') 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 ().derive_path (o); + file& obj (add_adhoc_member (t, tts.obj, e.c_str ())); + + if (obj.path ().empty ()) + obj.derive_path (o); } } -- cgit v1.1