From 8da6810950270a9fabd4e0d9c6ea6e214793d732 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Oct 2019 13:02:10 +0200 Subject: 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. --- libbuild2/utility.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libbuild2/utility.cxx') 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 // tzset() (POSIX), _tzset() (Windows) +#include // ENOENT #include // strlen(), str[n]cmp() #include // 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, -- cgit v1.1