From 214450227ea96df0b2b079632b1f20e23a3fd8fe Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 10 Feb 2017 21:58:27 +0000 Subject: [PATCH] Add ../lib to LD_LIBRARY_PATH when capturing programs --- renderdoc/os/posix/posix_process.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/renderdoc/os/posix/posix_process.cpp b/renderdoc/os/posix/posix_process.cpp index 27bce9454..63f545b0b 100644 --- a/renderdoc/os/posix/posix_process.cpp +++ b/renderdoc/os/posix/posix_process.cpp @@ -441,10 +441,11 @@ uint32_t Process::LaunchAndInjectIntoProcess(const char *app, const char *workin if(logfile == NULL) logfile = ""; - string libpath; + string binpath, libpath; { - FileIO::GetExecutableFilename(libpath); - libpath = dirname(libpath); + FileIO::GetExecutableFilename(binpath); + binpath = dirname(binpath); + libpath = binpath + "/../lib"; } string optstr; @@ -458,6 +459,8 @@ uint32_t Process::LaunchAndInjectIntoProcess(const char *app, const char *workin } } + modifications.push_back( + EnvironmentModification(eEnvModification_AppendPlatform, "LD_LIBRARY_PATH", binpath.c_str())); modifications.push_back( EnvironmentModification(eEnvModification_AppendPlatform, "LD_LIBRARY_PATH", libpath.c_str())); modifications.push_back(