aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwat SomeBug <swat.somebug@gmail.com>2023-09-10 22:24:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-09-11 15:28:09 +0200
commitb43546939b21f6c8d3e69d4ab1e44f08c0756481 (patch)
tree59ec811c0aa9305529d6a0d79d1f0f57a590381c
parent6f6b82d00051587fa3496d0bc3f4fe1ff512dda3 (diff)
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.
-rw-r--r--libbuild2/cc/compile-rule.cxx9
1 files changed, 7 insertions, 2 deletions
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<bool> (t[b_binless]))
+ if ((ut == unit_type::module_intf ||
+ ut == unit_type::module_intf_part ||
+ ut == unit_type::module_impl_part) && cast_true<bool> (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".