mirror of
https://github.com/RPCS3/llvm.git
synced 2025-05-16 18:35:53 +00:00
Tweak FindExecutable so that relative executable paths work as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74645 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6f854d1e78
commit
74a81813c2
@ -43,9 +43,10 @@ bool llvm::CheckBitcodeOutputToConsole(std::ostream* stream_to_check,
|
|||||||
#undef FindExecutable // needed on windows :(
|
#undef FindExecutable // needed on windows :(
|
||||||
sys::Path llvm::FindExecutable(const std::string &ExeName,
|
sys::Path llvm::FindExecutable(const std::string &ExeName,
|
||||||
const std::string &ProgramPath) {
|
const std::string &ProgramPath) {
|
||||||
// First check if the given name is a fully qualified path to an executable
|
// First check if the given name is already a valid path to an executable.
|
||||||
sys::Path Result(ExeName);
|
sys::Path Result(ExeName);
|
||||||
if (Result.isAbsolute() && Result.canExecute())
|
Result.makeAbsolute();
|
||||||
|
if (Result.canExecute())
|
||||||
return Result;
|
return Result;
|
||||||
|
|
||||||
// Otherwise check the directory that the calling program is in. We can do
|
// Otherwise check the directory that the calling program is in. We can do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user