diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-10-26 19:07:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-10-26 19:07:42 +0200 |
commit | 296575ba025ded840304c1e3b6365a6b6ee7ea48 (patch) | |
tree | da8ecb3dfc8178b7ddf00c51a21fbe8d375cd435 /build2/utility.txx | |
parent | 1dba8a7b279c857e9c13cbd6496849f5501e9944 (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/utility.txx')
-rw-r--r-- | build2/utility.txx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/build2/utility.txx b/build2/utility.txx index 1f65b76..73bd47a 100644 --- a/build2/utility.txx +++ b/build2/utility.txx @@ -79,9 +79,13 @@ namespace build2 { ifdstream is (move (pr.in_ofd), butl::fdstream_mode::skip); - while (is.peek () != ifdstream::traits_type::eof () && // Keep last line. - getline (is, l)) + // Make sure we keep the last line. + // + for (bool last (is.peek () == ifdstream::traits_type::eof ()); + !last && getline (is, l); ) { + last = (is.peek () == ifdstream::traits_type::eof ()); + trim (l); if (checksum != nullptr) @@ -89,7 +93,7 @@ namespace build2 if (r.empty ()) { - r = f (l); + r = f (l, last); if (!r.empty () && checksum == nullptr) break; |