improve target platform detection when building SenseGloveConnectImpl and SenseGloveCoreImpl modules and also distinguish x64 builds from arm64 on windows

This commit is contained in:
Mamadou Babaei
2024-05-15 04:34:38 +02:00
parent b467c679de
commit befb07470e
2 changed files with 43 additions and 39 deletions
@@ -84,7 +84,14 @@ public class SenseGloveCoreImpl : ModuleRules
string LibraryPathAnroidx64 = "";
string LibraryName = "sgcore";
if (Target.Platform == UnrealTargetPlatform.Android)
bool bIsAndroid = Target.IsInPlatformGroup(UnrealPlatformGroup.Android);
bool bIsLinux = Target.Platform == UnrealTargetPlatform.Linux;
bool bIsLinuxArm64 = Target.Platform == UnrealTargetPlatform.LinuxArm64;
bool bIsWin64 = Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) &&
Target.WindowsPlatform.Architecture == UnrealArch.X64;
bool bIsDebugBuild = (Target.Configuration == UnrealTargetConfiguration.Debug);
if (bIsAndroid)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
@@ -94,7 +101,7 @@ public class SenseGloveCoreImpl : ModuleRules
LibraryName = string.Format("lib{0}.a", LibraryName);
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
else if (bIsLinux)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
LibraryName = string.Format("lib{0}.a", LibraryName);
@@ -111,11 +118,7 @@ public class SenseGloveCoreImpl : ModuleRules
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64"));
}
#if UE_5_0_OR_LATER
else if (Target.Platform == UnrealTargetPlatform.LinuxArm64)
#else
else if (Target.Platform == UnrealTargetPlatform.LinuxAArch64)
#endif
else if (bIsLinuxArm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux"));
LibraryName = string.Format("lib{0}.a", LibraryName);
@@ -132,7 +135,7 @@ public class SenseGloveCoreImpl : ModuleRules
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64"));
}
else if (Target.Platform == UnrealTargetPlatform.Win64)
else if (bIsWin64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64"));
switch (Target.WindowsPlatform.Compiler)
@@ -151,6 +154,7 @@ public class SenseGloveCoreImpl : ModuleRules
Debug.Assert(false, "Unsupported engine version or compiler!");
break;
}
LibraryName = string.Format("{0}.lib", LibraryName);
}
else
@@ -161,11 +165,9 @@ public class SenseGloveCoreImpl : ModuleRules
string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include"));
PrivateIncludePaths.Add(IncludePath);
bool bDebug = (Target.Configuration == UnrealTargetConfiguration.Debug);
if (Target.Platform == UnrealTargetPlatform.Android)
if (bIsAndroid)
{
if (bDebug)
if (bIsDebugBuild)
{
LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "debug"));
LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "debug"));
@@ -184,7 +186,7 @@ public class SenseGloveCoreImpl : ModuleRules
}
else
{
if (bDebug)
if (bIsDebugBuild)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug"));
}