Merge pull request #2760 from Trial97/mangohid
fix mangohud detection for absolute path
This commit is contained in:
commit
828acef7e9
@ -108,24 +108,31 @@ QString getLibraryString()
|
|||||||
if (filePath.isEmpty()) {
|
if (filePath.isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
auto conf = Json::requireDocument(filePath, vkLayer);
|
||||||
|
auto confObject = Json::requireObject(conf, vkLayer);
|
||||||
|
auto layer = Json::ensureObject(confObject, "layer");
|
||||||
|
QString libraryName = Json::ensureString(layer, "library_path");
|
||||||
|
|
||||||
auto conf = Json::requireDocument(filePath, vkLayer);
|
if (libraryName.isEmpty()) {
|
||||||
auto confObject = Json::requireObject(conf, vkLayer);
|
continue;
|
||||||
auto layer = Json::ensureObject(confObject, "layer");
|
}
|
||||||
QString libraryName = Json::ensureString(layer, "library_path");
|
if (QFileInfo(libraryName).isAbsolute()) {
|
||||||
|
return libraryName;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __GLIBC__
|
#ifdef __GLIBC__
|
||||||
// Check whether mangohud is usable on a glibc based system
|
// Check whether mangohud is usable on a glibc based system
|
||||||
if (!libraryName.isEmpty()) {
|
|
||||||
QString libraryPath = findLibrary(libraryName);
|
QString libraryPath = findLibrary(libraryName);
|
||||||
if (!libraryPath.isEmpty()) {
|
if (!libraryPath.isEmpty()) {
|
||||||
return libraryPath;
|
return libraryPath;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
// Without glibc return recorded shared library as-is.
|
// Without glibc return recorded shared library as-is.
|
||||||
return libraryName;
|
return libraryName;
|
||||||
#endif
|
#endif
|
||||||
|
} catch (const Exception& e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
Reference in New Issue
Block a user