From 0d6f835ffb582296d24a8d1dd479e2703e075ee3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Oct 2019 14:05:03 +0200 Subject: Add ability to specify "compiler mode" options as part of config.{c,cxx} Such options are (normally) not overridden by buildfiles and are passed last (after cc.coptions and {c,cxx}.coptions) in the resulting command lines. They are also cross-hinted between config.c and config.cxx. For example: $ b config.cxx="g++ -m64" --- libbuild2/cc/guess.hxx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'libbuild2/cc/guess.hxx') diff --git a/libbuild2/cc/guess.hxx b/libbuild2/cc/guess.hxx index d9172dc..d93aaf9 100644 --- a/libbuild2/cc/guess.hxx +++ b/libbuild2/cc/guess.hxx @@ -239,23 +239,27 @@ namespace build2 // that most of it will be the same, at least for C and C++. // const compiler_info& - guess (const char* xm, // Module (for variable names in diagnostics). - lang xl, // Language. - const path& xc, // Compiler path. - const string* xi, // Compiler id (optional). - const string* xv, // Compiler version (optional). - const string* xt, // Compiler target (optional). + guess (const char* xm, // Module (for var names in diagnostics). + lang xl, // Language. + const path& xc, // Compiler path. + const string* xi, // Compiler id (optional). + const string* xv, // Compiler version (optional). + const string* xt, // Compiler target (optional). + const strings& x_mode, // Compiler mode options. const strings* c_poptions, const strings* x_poptions, const strings* c_coptions, const strings* x_coptions, const strings* c_loptions, const strings* x_loptions); - // Given a language, compiler id, and optionally an (empty) pattern, - // return an appropriate default compiler path. + // Given a language, compiler id, optional (empty) pattern, and mode + // return an appropriate default config.x value (compiler path and mode) // // For example, for (lang::cxx, gcc, *-4.9) we will get g++-4.9. // - path - guess_default (lang, const string& cid, const string& pattern); + strings + guess_default (lang, + const string& cid, + const string& pattern, + const strings& mode); } } -- cgit v1.1