Devrim Yasar ddf8e4bfd7 mac build is fixed. please test linux and windows
2025-03-27 16:47:31 -05:00

50 lines
2.0 KiB
C#

using System.IO;
using UnrealBuildTool;
using System;
public class Mujoco : ModuleRules
{
public Mujoco(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
PublicSystemIncludePaths.Add("$(ModuleDir)/include");
if (Target.Platform == UnrealTargetPlatform.Win64)
{
PublicAdditionalLibraries.Add(Path.Combine(ModuleDirectory, "lib", "mujoco.lib"));
PublicDelayLoadDLLs.Add("mujoco.dll");
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "mujoco.dll"), Path.Combine(ModuleDirectory, "bin", "mujoco.dll"));
}
else if (Target.Platform == UnrealTargetPlatform.Mac)
{
string DllPath = Path.Combine(ModuleDirectory, "lib", "mujoco.dylib");
string BinaryOutputDir = Path.Combine("$(BinaryOutputDir)", "lib");
string TargetOutputDir = Path.Combine("$(TargetOutputDir)", "lib");
PublicDelayLoadDLLs.Add(DllPath);
PublicAdditionalLibraries.Add(DllPath);
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "mujoco.dylib"), DllPath);
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.3.2.7.dylib"), DllPath);
// RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "../../../../", "MacOS/libmujoco.3.2.7.dylib"), DllPath);
// RuntimeDependencies.Add("$(BinaryOutputDir)/UnrealEditor.app/Contents/MacOS/libmujoco.3.2.7.dylib", DllPath);
// Console.WriteLine("$BinaryOutputDir:"+ BinaryOutputDir);
// Console.WriteLine("$TargetOutputDir:" + TargetOutputDir);
// Console.WriteLine("$Target.Name:"+ Target.Name);
RuntimeDependencies.Add($"$(BinaryOutputDir)/libmujoco.3.2.7.dylib", DllPath);
// throw new Exception("test");
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
{
string DllPath = Path.Combine(ModuleDirectory, "lib", "libmujoco.so");
PublicAdditionalLibraries.Add(DllPath);
PublicDelayLoadDLLs.Add(DllPath);
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.so"), DllPath);
RuntimeDependencies.Add(Path.Combine("$(TargetOutputDir)", "libmujoco.so.3.2.7"), DllPath);
}
}
}