aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/guess.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-10-26 19:07:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-10-26 19:07:42 +0200
commit296575ba025ded840304c1e3b6365a6b6ee7ea48 (patch)
treeda8ecb3dfc8178b7ddf00c51a21fbe8d375cd435 /build2/cc/guess.hxx
parent1dba8a7b279c857e9c13cbd6496849f5501e9944 (diff)
Add config.{c,cxx}.{id,version,target} configuration variables
These variables allow overriding guessed compiler id/version/target, for example, in case of mis-guesses or when working with compilers that don't report their base (e.g., GCC, Clang) with -v/--version (common in the embedded space).
Diffstat (limited to 'build2/cc/guess.hxx')
-rw-r--r--build2/cc/guess.hxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/build2/cc/guess.hxx b/build2/cc/guess.hxx
index 8b10b29..5fa4de7 100644
--- a/build2/cc/guess.hxx
+++ b/build2/cc/guess.hxx
@@ -66,7 +66,8 @@ namespace build2
compiler_id (compiler_type t, std::string v)
: type (t), variant (move (v)) {}
- //compiler_id (const std::string& type, std::string variant);
+ explicit
+ compiler_id (const std::string&);
};
inline ostream&
@@ -222,14 +223,17 @@ namespace build2
// that most of it will be the same, at least for C and C++.
//
const compiler_info&
- guess (lang,
- const string& xv, // Override variable (config.x) for diagnostics.
- const path& xc,
+ 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).
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, toolchain id, and optionally (empty) a pattern,
+ // Given a language, compiler id, and optionally an (empty) pattern,
// return an appropriate default compiler path.
//
// For example, for (lang::cxx, gcc, *-4.9) we will get g++-4.9.