diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-31 10:48:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-31 10:48:51 +0200 |
commit | 3d8f2b3779ae32a16627a0f09f1798224cdaf68f (patch) | |
tree | fab60da301c5e686514b8cedfedf541548ec912b /build2/cc/link.cxx | |
parent | 02f294ade6ba3c7c33fd4fb4dccb7901eaa7ae5c (diff) |
Improve mixed source (e.g., C and C++) building support
Diffstat (limited to 'build2/cc/link.cxx')
-rw-r--r-- | build2/cc/link.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx index a1ecac3..29a46b4 100644 --- a/build2/cc/link.cxx +++ b/build2/cc/link.cxx @@ -104,6 +104,11 @@ namespace build2 { seen_lib = seen_lib || true; } + // If this is some other c-common source (say C++ in a C rule), then + // it will most definitely need to be compiled but we can't do that. + // + else if (p.is_a<cc> ()) + return nullptr; } if (!(seen_x || seen_c || seen_obj || seen_lib)) @@ -563,7 +568,7 @@ namespace build2 // Most of the time we will have just a single source so fast-path // that case. // - if (p1.is_a (x_src)) + if (p1.is_a (x_src) || p1.is_a<c> ()) { if (!found) { |