Meta XR Audio plugin for Unreal Engine improvements
Hello. Meta XR Audio plugin for Unreal Engine 5.6 (v83) also as other versions stores metaxraudio64.dll in Plugins\MetaXRAudio\Binaries\Win64
It is not an "Unreal way" to store DLLs and also heaving binaries folder for compiled DLLs in repo can deal some troubles with project cleanup and build/compile/cicd etc.
It is much better to not have binaries folder in repo and all precompiled libraries should be in plugin folder.
I did not found any github repo to make PR for changes i would like you to review.
Base idea is to remove Plugins\MetaXRAudio\Binaries\Win64\metaxraudio64.dll and move it to something like Plugins\MetaXRAudio\Source\ThirdParty\MetaXRAudio\Win64 and make it to be copied at build time to Plugins\MetaXRAudio\Binaries\Win64 using built-in UE tools.
You can add dedicated module to copy this dll or at least make a small fix in Plugins\MetaXRAudio\Source\MetaXRAudio\MetaXRAudio.Build.cs
Line 64 - replace original code:
if (CurrentPlatform == UnrealTargetPlatform.Win64)
{
// Automatically copy DLL to packaged builds
RuntimeDependencies.Add(System.IO.Path.Combine(PluginDirectory, "Binaries", "Win64", "metaxraudio64.dll"));
AddEngineThirdPartyPrivateStaticDependencies(TargetRules, "DX11Audio");
}with this code:
if (CurrentPlatform == UnrealTargetPlatform.Win64)
{
string DLLName = "metaxraudio64.dll";
string SourceDllPath = System.IO.Path.Combine(PluginDirectory, "Source", "ThirdParty", "MetaXRAudio", "Win64", DLLName);
string TargetDllPath = System.IO.Path.Combine(PluginDirectory, "Binaries", "Win64", DLLName);
// Add DLL to linker delay-load list with FULL SOURCE PATH
//PublicDelayLoadDLLs.Add(SourceDllPath);
// RuntimeDependencies to copy DLL to PLUGIN binaries
RuntimeDependencies.Add(TargetDllPath, SourceDllPath);
// Add to receipt for BuildGraph awareness
//AdditionalPropertiesForReceipt.Add("BuildProduct", SourceDllPath);
// Third-party dependencies
AddEngineThirdPartyPrivateStaticDependencies(TargetRules, "DX11Audio");
}This will copy metaxraudio64.dll from Plugins\MetaXRAudio\Source\ThirdParty\MetaXRAudio\Win64 to Plugins\MetaXRAudio\Binaries\Win64 at every build. Checked with PC, CICD, UnrealGameSync (UGS) so it covers all cases.
This is a small fix i am asking you to do please and it will help developers have less pain in head.
P.S. the same or similar way you can move headers and .so libs from Plugins\MetaXRAudio\Source\MetaXRAudio\Private\LibMetaXRAudio which is also not a good place to store it, and also not an "Unreal way". You can move everything to Plugins\MetaXRAudio\Source\ThirdParty\MetaXRAudio\{platform_name}
Please think about it.