aboutsummaryrefslogtreecommitdiff
path: root/build2/cc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-09-03 10:18:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-09-03 10:18:23 +0200
commitcafa730ce5e1b13135ccbdc0befa58d693302999 (patch)
treed6d63760881b6813a3dee9434cdc1b1c42ae4d92 /build2/cc
parent1bf439f7918f2c6f8fa07db3abb53722156945c7 (diff)
Use (native) C and C++ compilers we were built with as defaults
Diffstat (limited to 'build2/cc')
-rw-r--r--build2/cc/module.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx
index 858a2fd..e9d5c09 100644
--- a/build2/cc/module.cxx
+++ b/build2/cc/module.cxx
@@ -87,11 +87,20 @@ namespace build2
// (optional) pattern to guess an appropriate default (e.g., for {gcc,
// *-4.9} we will get g++-4.9).
//
- path d (cc_loaded
- ? guess_default (x_lang,
- cast<string> (rs["cc.id"]),
- cast<string> (rs["cc.pattern"]))
- : path (x_default));
+ path d;
+
+ if (cc_loaded)
+ d = guess_default (x_lang,
+ cast<string> (rs["cc.id"]),
+ cast<string> (rs["cc.pattern"]));
+ else
+ {
+ d = path (x_default);
+
+ if (d.empty ())
+ fail << "not built with default " << x_lang << " compiler" <<
+ info << "use config." << x << " to specify";
+ }
// If this value was hinted, save it as commented out so that if the
// user changes the source of the pattern, this one will get updated