X-Git-Url: https://git.cworth.org/git?p=apitrace;a=blobdiff_plain;f=common%2Ftrace_resource.cpp;h=04ac32709dfa09eea11d1d1951dee9948282cf26;hp=51cd72df253774a301b5e41e95a4cca9d12f2a4f;hb=a684451ce345c9d3667921520a4a75e387811ad6;hpb=ca7283268b6ecc29d371624b908fd85c30024056 diff --git a/common/trace_resource.cpp b/common/trace_resource.cpp index 51cd72d..04ac327 100644 --- a/common/trace_resource.cpp +++ b/common/trace_resource.cpp @@ -35,6 +35,32 @@ namespace trace { +os::String +findProgram(const char*programFilename) +{ + os::String programPath; + + os::String processDir = os::getProcessName(); + processDir.trimFilename(); + + programPath = processDir; + programPath.join(programFilename); + if (programPath.exists()) { + return programPath; + } + +#ifndef _WIN32 + // Try absolute install directory + programPath = APITRACE_PROGRAMS_INSTALL_DIR; + programPath.join(programFilename); + if (programPath.exists()) { + return programPath; + } +#endif + + return ""; +} + os::String findWrapper(const char *wrapperFilename) {