fix android architecture detection issues on ue 5.2

This commit is contained in:
Mamadou Babaei
2023-03-28 10:37:51 +02:00
parent ad4b527847
commit f000901b35
3 changed files with 61 additions and 25 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ This release is breaking ABI/API compatibility with the previous versions.
- Add an internal SenseGloveCoreTypes module in order to share common SenseGloveCore types between various modules.
- Segregated Android binaries for NDK r21e (UE 4.27 and 5.0) and r25b (UE 5.1, 5.2).
- Fully functional and stable Linux development support.
- Fully functional and stable Unreal Engine 5.2 preview support (except Android) has been added.
- Fully functional and stable Unreal Engine 5.2 preview support has been added.
### Changed
@@ -83,11 +83,8 @@ public class SenseGloveConnectImpl : ModuleRules
if (Target.Platform == UnrealTargetPlatform.Android)
{
#if ! UE_5_2_OR_LATER
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
#if UE_5_1_OR_LATER
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
#elif UE_4_27_OR_LATER
@@ -96,6 +93,23 @@ public class SenseGloveConnectImpl : ModuleRules
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 is not supported!");
#endif
#if UE_5_2_OR_LATER
if (Target.Architecture == UnrealArch.Arm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
}
else if (Target.Architecture == UnrealArch.X64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
}
else
{
Debug.Assert(false, "Unsupported Android architecture!");
}
#else
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
foreach (string Arch in Architectures)
{
if (Arch == "-arm64")
@@ -120,15 +134,13 @@ public class SenseGloveConnectImpl : ModuleRules
}
else
{
Debug.Assert(false, "Only AArch64/ARM64 variant of Android is supported!");
Debug.Assert(false, "Unsupported Android architecture!");
break;
}
}
#endif
LibraryName = string.Format("lib{0}.a", LibraryName);
#else
Debug.Assert(false, "Developing for Android on UE 5.2+ is not yet supported!");
#endif
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
{
@@ -202,11 +214,8 @@ public class SenseGloveConnectImpl : ModuleRules
if (Target.Platform == UnrealTargetPlatform.Android)
{
#if ! UE_5_2_OR_LATER
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
#if UE_5_1_OR_LATER
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
#elif UE_4_27_OR_LATER
@@ -215,6 +224,23 @@ public class SenseGloveConnectImpl : ModuleRules
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 is not supported!");
#endif
#if UE_5_2_OR_LATER
if (Target.Architecture == UnrealArch.Arm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
}
else if (Target.Architecture == UnrealArch.X64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
}
else
{
Debug.Assert(false, "Unsupported Android architecture!");
}
#else
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
foreach (string Arch in Architectures)
{
if (Arch == "-arm64")
@@ -239,15 +265,13 @@ public class SenseGloveConnectImpl : ModuleRules
}
else
{
Debug.Assert(false, "Only AArch64/ARM64 variant of Android is supported!");
Debug.Assert(false, "Unsupported Android architecture!");
break;
}
}
#endif
LibraryName = string.Format("lib{0}.a", LibraryName);
#else
Debug.Assert(false, "Developing for Android on UE 5.2+ is not yet supported!");
#endif
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
{
@@ -82,11 +82,8 @@ public class SenseGloveCoreImpl : ModuleRules
if (Target.Platform == UnrealTargetPlatform.Android)
{
#if ! UE_5_2_OR_LATER
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "android"));
#if UE_5_1_OR_LATER
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "r25b"));
#elif UE_4_27_OR_LATER
@@ -95,6 +92,23 @@ public class SenseGloveCoreImpl : ModuleRules
Debug.Assert(false, "Developing for Android on UE versions older than 4.27 is not supported!");
#endif
#if UE_5_2_OR_LATER
if (Target.Architecture == UnrealArch.Arm64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "arm64"));
}
else if (Target.Architecture == UnrealArch.X64)
{
LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x64"));
}
else
{
Debug.Assert(false, "Unsupported Android architecture!");
}
#else
IAndroidToolChain ToolChain = AndroidExports.CreateToolChain(Target.ProjectFile);
List<string> Architectures = ToolChain.GetAllArchitectures();
foreach (string Arch in Architectures)
{
if (Arch == "-arm64")
@@ -119,15 +133,13 @@ public class SenseGloveCoreImpl : ModuleRules
}
else
{
Debug.Assert(false, "Only AArch64/ARM64 variant of Android is supported!");
Debug.Assert(false, "Unsupported Android architecture!");
break;
}
}
#endif
LibraryName = string.Format("lib{0}.a", LibraryName);
#else
Debug.Assert(false, "Developing for Android on UE 5.2+ is not yet supported!");
#endif
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
{