feat: implement override for GLFW/OpenAL with split natives

Fixes PrismLauncher/PrismLauncher#513

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu
2023-07-17 10:57:41 +02:00
parent 7ba1e7d356
commit ff67fd10c3
4 changed files with 68 additions and 7 deletions

View File

@ -389,6 +389,24 @@ QStringList MinecraftInstance::extraArguments()
if (loaders.has_value() && loaders.value() & ResourceAPI::Quilt && settings()->get("DisableQuiltBeacon").toBool())
list.append("-Dloader.disable_beacon=true");
}
#ifdef Q_OS_LINUX
{
QString openALPath;
QString glfwPath;
if (settings()->get("UseNativeOpenAL").toBool())
openALPath = MangoHud::findLibrary("libopenal.so");
if (settings()->get("UseNativeGLFW").toBool())
glfwPath = MangoHud::findLibrary("libglfw.so");
if (!openALPath.isEmpty())
list.append("-Dorg.lwjgl.openal.libname=" + openALPath);
if (!glfwPath.isEmpty())
list.append("-Dorg.lwjgl.glfw.libname=" + glfwPath);
}
#endif
return list;
}