diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-16 13:02:10 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-16 13:02:10 +0200 |
commit | 8da6810950270a9fabd4e0d9c6ea6e214793d732 (patch) | |
tree | 48d8ae4157265c6b30fba4e2075a2d84ea53f5e8 /libbuild2/utility.cxx | |
parent | 5338cd3b93972c60ac90d4c2c5a640071f92d091 (diff) |
Try to find MSVC installation for absolute cl.exe paths
Without this extra logic recursive invocation of the build system (e.g., in
tests) will fail to obtain the full environment.
Diffstat (limited to 'libbuild2/utility.cxx')
-rw-r--r-- | libbuild2/utility.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libbuild2/utility.cxx b/libbuild2/utility.cxx index 10e2380..af4768c 100644 --- a/libbuild2/utility.cxx +++ b/libbuild2/utility.cxx @@ -6,6 +6,7 @@ #include <time.h> // tzset() (POSIX), _tzset() (Windows) +#include <cerrno> // ENOENT #include <cstring> // strlen(), str[n]cmp() #include <iostream> // cerr @@ -183,7 +184,7 @@ namespace build2 } process_path - try_run_search (const path& f, + run_try_search (const path& f, bool init, const dir_path& fallback, bool path_only, @@ -192,6 +193,13 @@ namespace build2 return process::try_path_search (f, init, fallback, path_only, paths); } + [[noreturn]] void + run_search_fail (const path& f, const location& l) + { + fail (l) << "unable to execute " << f << ": " << process_error (ENOENT) + << endf; + } + process run_start (uint16_t verbosity, const process_env& pe, |