From b43546939b21f6c8d3e69d4ab1e44f08c0756481 Mon Sep 17 00:00:00 2001 From: Swat SomeBug Date: Sun, 10 Sep 2023 22:24:10 +0200 Subject: Invoke Clang to produce object files for module partitions similar to interfaces Module interface and implementation partitions are like module interfaces so it's not surprising they require similar compilation steps. See GH PR #328 for background. --- libbuild2/cc/compile-rule.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libbuild2/cc/compile-rule.cxx') diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index 35d77f8..128fe14 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -946,7 +946,9 @@ namespace build2 // // Note: ut is still unrefined. // - if (ut == unit_type::module_intf && cast_true (t[b_binless])) + if ((ut == unit_type::module_intf || + ut == unit_type::module_intf_part || + ut == unit_type::module_impl_part) && cast_true (t[b_binless])) { // The module interface unit can be the same as an implementation // (e.g., foo.mxx and foo.cxx) which means obj*{} targets could @@ -7759,7 +7761,10 @@ namespace build2 // // @@ MODPART: Clang (all of this is probably outdated). // - if (ctype == compiler_type::clang && ut == unit_type::module_intf) + if (ctype == compiler_type::clang && + (ut == unit_type::module_intf || + ut == unit_type::module_intf_part || + ut == unit_type::module_impl_part)) { // Adjust the command line. First discard everything after -o then // build the new "tail". -- cgit v1.1