From 3d8f2b3779ae32a16627a0f09f1798224cdaf68f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 31 Aug 2016 10:48:51 +0200 Subject: Improve mixed source (e.g., C and C++) building support --- build2/cc/link.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'build2/cc/link.cxx') 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 ()) + 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 ()) { if (!found) { -- cgit v1.1