diff --git a/Handbook/src/appendix/changelog.md b/Handbook/src/appendix/changelog.md index 3cf8d41a..688acd2c 100644 --- a/Handbook/src/appendix/changelog.md +++ b/Handbook/src/appendix/changelog.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Replaced Epic Native Toolchain `v24` support with Epic Native Toolchain `v25` due to the fact that now `v25` is the default Linux toolchain for UE `5.6`. - Revamped `FSGHMDTracker` to resolve a critical deadlock between the rendering and game threads in Unreal Engine `5.6` that occurrs when `IHeadMountedDisplay::GetHMDMonitorInfo()` is invoked from `FSGXRTracker::GetControllerTransform()`. This is similar to another [critical deadlock issue (UE-212224), occurring during PipelinedFrameState acquisition, addressed in the `v2.5.0` release](#250---2025-05-09). +- Revamped the UBT logic for importing third-party headers and libraries by introducing third-party dependency modules, `SGBleThirdPartyLibs`, `SGConnectThirdPartyHeaders`, `SGConnectThirdPartyLibs`, `SGCoreThirdPartyLibs`, and `SGSerialThirdPartyLibs`, which significantly reduces UBT boilerplate code and increases maintainability. - Bumped the SenseGlove libraries to `v2.203.0-f3d3e676`. - SenseGlove libraries have migrated to `C++20` from `C++17`. - Revamped the `SGLog` logging utility class to use `TUniquePtr` instead of `std::unique_ptr`. diff --git a/Handbook/src/appendix/directory-structure.md b/Handbook/src/appendix/directory-structure.md index f00373bd..560e9b9e 100644 --- a/Handbook/src/appendix/directory-structure.md +++ b/Handbook/src/appendix/directory-structure.md @@ -81,99 +81,109 @@ │ │ │ └── serial │ - └── lib (platform-specific pre-built binary dependencies) - │ - ├── android - │ │ - │ └── r25b (Android NDK r25b dependencies for UE 5.1+) - │ │ - │ ├── arm64 (64-bit ARM variant of Android) - │ │ │ - │ │ ├── debug - │ │ │ - │ │ └── release - │ │ - │ └── x64 (64-bit x86-64 variant of Android) - │ │ - │ ├── debug - │ │ - │ └── release - │ - ├── linux - │ │ - │ ├── rustc (GNU/Linux binary dependencies built with Rust) - │ │ │ - │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) - │ │ │ │ - │ │ │ ├── debug - │ │ │ │ - │ │ │ └── release - │ │ │ - │ │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) - │ │ │ - │ │ ├── debug - │ │ │ - │ │ └── release - │ │ - │ ├── v22 (UE 5.3 and 5.4 GNU/Linux dependencies) - │ │ │ - │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) - │ │ │ │ - │ │ │ ├── debug - │ │ │ │ - │ │ │ └── release - │ │ │ - │ │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) - │ │ │ - │ │ ├── debug - │ │ │ - │ │ └── release - │ │ - │ ├── v23 (UE 5.5 GNU/Linux dependencies) - │ │ │ - │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) - │ │ │ │ - │ │ │ ├── debug - │ │ │ │ - │ │ │ └── release - │ │ │ - │ │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) - │ │ │ - │ │ ├── debug - │ │ │ - │ │ └── release - │ │ - │ └── v25 (UE 5.6 GNU/Linux dependencies) - │ │ - │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) - │ │ │ - │ │ ├── debug - │ │ │ - │ │ └── release - │ │ - │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) - │ │ - │ ├── debug - │ │ - │ └── release - │ - └── win64 - │ - ├── msvc142 (Microsoft Visual Studio 2019 dependencies) - │ │ - │ ├── debug - │ │ - │ └── release - │ - ├── msvc143 (Microsoft Visual Studio 2022 dependencies) - │ │ - │ ├── debug - │ │ - │ └── release - │ - └── rustc (Microsoft Windows binary dependencies built with Rust) - │ - ├── debug - │ - └── release + ├── lib (platform-specific pre-built binary dependencies) + │ │ + │ ├── android + │ │ │ + │ │ └── r25b (Android NDK r25b dependencies for UE 5.1+) + │ │ │ + │ │ ├── arm64 (64-bit ARM variant of Android) + │ │ │ │ + │ │ │ ├── debug + │ │ │ │ + │ │ │ └── release + │ │ │ + │ │ └── x64 (64-bit x86-64 variant of Android) + │ │ │ + │ │ ├── debug + │ │ │ + │ │ └── release + │ │ + │ ├── linux + │ │ │ + │ │ ├── rustc (GNU/Linux binary dependencies built with Rust) + │ │ │ │ + │ │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) + │ │ │ │ │ + │ │ │ │ ├── debug + │ │ │ │ │ + │ │ │ │ └── release + │ │ │ │ + │ │ │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) + │ │ │ │ + │ │ │ ├── debug + │ │ │ │ + │ │ │ └── release + │ │ │ + │ │ ├── v22 (UE 5.3 and 5.4 GNU/Linux dependencies) + │ │ │ │ + │ │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) + │ │ │ │ │ + │ │ │ │ ├── debug + │ │ │ │ │ + │ │ │ │ └── release + │ │ │ │ + │ │ │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) + │ │ │ │ + │ │ │ ├── debug + │ │ │ │ + │ │ │ └── release + │ │ │ + │ │ ├── v23 (UE 5.5 GNU/Linux dependencies) + │ │ │ │ + │ │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) + │ │ │ │ │ + │ │ │ │ ├── debug + │ │ │ │ │ + │ │ │ │ └── release + │ │ │ │ + │ │ │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) + │ │ │ │ + │ │ │ ├── debug + │ │ │ │ + │ │ │ └── release + │ │ │ + │ │ └── v25 (UE 5.6 GNU/Linux dependencies) + │ │ │ + │ │ ├── aarch64 (dependencies targeting GNU/Linux AArch64 architecture) + │ │ │ │ + │ │ │ ├── debug + │ │ │ │ + │ │ │ └── release + │ │ │ + │ │ └── x86-64 (dependencies targeting GNU/Linux x86-64 architecture) + │ │ │ + │ │ ├── debug + │ │ │ + │ │ └── release + │ │ + │ └── win64 + │ │ + │ ├── msvc142 (Microsoft Visual Studio 2019 dependencies) + │ │ │ + │ │ ├── debug + │ │ │ + │ │ └── release + │ │ + │ ├── msvc143 (Microsoft Visual Studio 2022 dependencies) + │ │ │ + │ │ ├── debug + │ │ │ + │ │ └── release + │ │ + │ └── rustc (Microsoft Windows binary dependencies built with Rust) + │ │ + │ ├── debug + │ │ + │ └── release + │ + ├── SGBleThirdPartyLibs (Third-party module providing SGBLE headers and libraries) + │ + ├── SGConnectThirdPartyHeaders (Third-party module providing SGConnect headers) + │ + ├── SGConnectThirdPartyLibs (Third-party module providing SGConnect headers and libraries) + │ + ├── SGCoreThirdPartyLibs (Third-party module providing SGCore headers and libraries) + │ + └── SGSerialThirdPartyLibs (Third-party module providing github.com/wjwwood/serial headers and libraries) ``` diff --git a/Source/SenseGloveBuildHacks/SenseGloveBuildHacks.Build.cs b/Source/SenseGloveBuildHacks/SenseGloveBuildHacks.Build.cs index 2239cabf..a0917afe 100644 --- a/Source/SenseGloveBuildHacks/SenseGloveBuildHacks.Build.cs +++ b/Source/SenseGloveBuildHacks/SenseGloveBuildHacks.Build.cs @@ -34,7 +34,6 @@ using System; -using System.IO; using UnrealBuildTool; public class SenseGloveBuildHacks : ModuleRules @@ -55,23 +54,18 @@ public class SenseGloveBuildHacks : ModuleRules } ); + PublicDependencyModuleNames.AddRange( + new string[] + { + "SGConnectThirdPartyHeaders", + } + ); + PrivateDependencyModuleNames.AddRange( new string[] { "SenseGloveLog", } ); - - AddConnectHeaders(); - } - - private void AddConnectHeaders() - { - string PluginRootDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..")); - string SourceDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "Source")); - string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(SourceDirectory, "ThirdParty")); - string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include")); - - PrivateIncludePaths.Add(IncludePath); } } \ No newline at end of file diff --git a/Source/SenseGloveConnectImpl/SenseGloveConnectImpl.Build.cs b/Source/SenseGloveConnectImpl/SenseGloveConnectImpl.Build.cs index e65cc73b..f3bcfc76 100644 --- a/Source/SenseGloveConnectImpl/SenseGloveConnectImpl.Build.cs +++ b/Source/SenseGloveConnectImpl/SenseGloveConnectImpl.Build.cs @@ -34,9 +34,6 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using UnrealBuildTool; public class SenseGloveConnectImpl : ModuleRules @@ -57,6 +54,15 @@ public class SenseGloveConnectImpl : ModuleRules } ); + PrivateDependencyModuleNames.AddRange( + new string[] + { + "SGBleThirdPartyLibs", + "SGConnectThirdPartyLibs", + "SGSerialThirdPartyLibs", + } + ); + PrivateDependencyModuleNames.AddRange( new string[] { @@ -74,373 +80,7 @@ public class SenseGloveConnectImpl : ModuleRules } ); - AddBleLibrary(Target); - AddConnectLibrary(Target); - AddSerialLibrary(Target); - PublicDefinitions.Add("SENSEGLOVE_BUILDING_CONNECT_IMPL_MODULE"); PublicDefinitions.Add("SENSEGLOVE_UNREAL_ENGINE_PLUGIN"); } - - private void AddBleLibrary(ReadOnlyTargetRules Target) - { - string PluginRootDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..")); - string SourceDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "Source")); - string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(SourceDirectory, "ThirdParty")); - string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib")); - string LibraryPathAnroidArm64 = ""; - string LibraryPathAnroidx64 = ""; - string LibraryName = "sgble"; - - 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")); - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPath, "arm64")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPath, "x64")); - - LibraryName = string.Format("lib{0}.a", LibraryName); - } - else if (bIsLinux) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "rustc")); - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64")); - - LibraryName = string.Format("lib{0}.a", LibraryName); - } - else if (bIsLinuxArm64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "rustc")); - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64")); - - LibraryName = string.Format("lib{0}.a", LibraryName); - } - else if (bIsWin64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64")); - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "rustc")); - - LibraryName = string.Format("{0}.lib", LibraryName); - } - else - { - Debug.Assert(false, "Unsupported platform!"); - } - - string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include")); - PrivateIncludePaths.Add(IncludePath); - - if (bIsAndroid) - { - if (bIsDebugBuild) - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "debug")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "debug")); - } - else - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "release")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "release")); - } - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, LibraryName)); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, LibraryName)); - - PublicAdditionalLibraries.Add(LibraryPathAnroidArm64); - PublicAdditionalLibraries.Add(LibraryPathAnroidx64); - } - else - { - if (bIsDebugBuild) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug")); - } - else - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release")); - } - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName)); - PublicAdditionalLibraries.Add(LibraryPath); - } - - if (bIsWin64) - { - PublicAdditionalLibraries.AddRange(new string[] - { - "bcrypt.lib", - "ntdll.lib", - "propsys.lib", - "runtimeobject.lib", - "userenv.lib", - "ws2_32.lib" - }); - } - } - - private void AddConnectLibrary(ReadOnlyTargetRules Target) - { - string PluginRootDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..")); - string SourceDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "Source")); - string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(SourceDirectory, "ThirdParty")); - string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib")); - string LibraryPathAnroidArm64 = ""; - string LibraryPathAnroidx64 = ""; - string LibraryName = "sgconnect"; - - 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")); - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPath, "arm64")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPath, "x64")); - - LibraryName = string.Format("lib{0}.a", LibraryName); - } - else if (bIsLinux) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryName = string.Format("lib{0}.a", LibraryName); - -#if UE_5_6_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25")); -#elif UE_5_5_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23")); -#elif UE_5_3_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22")); -#elif UE_5_2_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21")); -#else - Debug.Assert(false, "Unsupported engine version or compiler!"); -#endif - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64")); - } - else if (bIsLinuxArm64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryName = string.Format("lib{0}.a", LibraryName); - -#if UE_5_6_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25")); -#elif UE_5_5_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23")); -#elif UE_5_3_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22")); -#elif UE_5_2_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21")); -#else - Debug.Assert(false, "Unsupported engine version or compiler!"); -#endif - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64")); - } - else if (bIsWin64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64")); - switch (Target.WindowsPlatform.Compiler) - { - case WindowsCompiler.VisualStudio2022: - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143")); - break; -#if ! UE_5_4_OR_LATER - case WindowsCompiler.VisualStudio2019: - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142")); - break; -#endif - default: - Debug.Assert(false, "Unsupported engine version or compiler!"); - break; - } - - LibraryName = string.Format("{0}.lib", LibraryName); - } - else - { - Debug.Assert(false, "Unsupported platform!"); - } - - string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include")); - PrivateIncludePaths.Add(IncludePath); - - if (bIsAndroid) - { - if (bIsDebugBuild) - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "debug")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "debug")); - } - else - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "release")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "release")); - } - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, LibraryName)); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, LibraryName)); - - PublicAdditionalLibraries.Add(LibraryPathAnroidArm64); - PublicAdditionalLibraries.Add(LibraryPathAnroidx64); - } - else - { - if (bIsDebugBuild) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug")); - } - else - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release")); - } - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName)); - PublicAdditionalLibraries.Add(LibraryPath); - } - } - - private void AddSerialLibrary(ReadOnlyTargetRules Target) - { - string PluginRootDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..")); - string SourceDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "Source")); - string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(SourceDirectory, "ThirdParty")); - string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib")); - string LibraryPathAnroidArm64 = ""; - string LibraryPathAnroidx64 = ""; - string LibraryName = "serial"; - - 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")); - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPath, "arm64")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPath, "x64")); - - LibraryName = string.Format("lib{0}.a", LibraryName); - } - else if (bIsLinux) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryName = string.Format("lib{0}.a", LibraryName); - -#if UE_5_6_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25")); -#elif UE_5_5_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23")); -#elif UE_5_3_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22")); -#elif UE_5_2_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21")); -#else - Debug.Assert(false, "Unsupported engine version or compiler!"); -#endif - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64")); - } - else if (bIsLinuxArm64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryName = string.Format("lib{0}.a", LibraryName); - -#if UE_5_6_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25")); -#elif UE_5_5_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23")); -#elif UE_5_3_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22")); -#elif UE_5_2_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21")); -#else - Debug.Assert(false, "Unsupported engine version or compiler!"); -#endif - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64")); - } - else if (bIsWin64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64")); - switch (Target.WindowsPlatform.Compiler) - { - case WindowsCompiler.VisualStudio2022: - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143")); - break; -#if ! UE_5_4_OR_LATER - case WindowsCompiler.VisualStudio2019: - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142")); - break; -#endif - default: - Debug.Assert(false, "Unsupported engine version or compiler!"); - break; - } - - LibraryName = string.Format("{0}.lib", LibraryName); - } - else - { - Debug.Assert(false, "Unsupported platform!"); - } - - string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include")); - PrivateIncludePaths.Add(IncludePath); - - if (bIsAndroid) - { - if (bIsDebugBuild) - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "debug")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "debug")); - } - else - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "release")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "release")); - } - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, LibraryName)); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, LibraryName)); - - PublicAdditionalLibraries.Add(LibraryPathAnroidArm64); - PublicAdditionalLibraries.Add(LibraryPathAnroidx64); - } - else - { - if (bIsDebugBuild) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug")); - } - else - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release")); - } - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName)); - PublicAdditionalLibraries.Add(LibraryPath); - } - } } \ No newline at end of file diff --git a/Source/SenseGloveCoreImpl/SenseGloveCoreImpl.Build.cs b/Source/SenseGloveCoreImpl/SenseGloveCoreImpl.Build.cs index a423f51f..6ccea10e 100644 --- a/Source/SenseGloveCoreImpl/SenseGloveCoreImpl.Build.cs +++ b/Source/SenseGloveCoreImpl/SenseGloveCoreImpl.Build.cs @@ -34,9 +34,6 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; using UnrealBuildTool; public class SenseGloveCoreImpl : ModuleRules @@ -57,6 +54,13 @@ public class SenseGloveCoreImpl : ModuleRules } ); + PrivateDependencyModuleNames.AddRange( + new string[] + { + "SGCoreThirdPartyLibs", + } + ); + PrivateDependencyModuleNames.AddRange( new string[] { @@ -74,137 +78,7 @@ public class SenseGloveCoreImpl : ModuleRules } ); - AddCoreLibrary(Target); - PublicDefinitions.Add("SENSEGLOVE_BUILDING_CORE_IMPL_MODULE"); PublicDefinitions.Add("SENSEGLOVE_UNREAL_ENGINE_PLUGIN"); } - - private void AddCoreLibrary(ReadOnlyTargetRules Target) - { - string PluginRootDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..")); - string SourceDirectory = Path.GetFullPath(Path.Combine(PluginRootDirectory, "Source")); - string ThirdPartyDirectory = Path.GetFullPath(Path.Combine(SourceDirectory, "ThirdParty")); - string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "lib")); - string LibraryPathAnroidArm64 = ""; - string LibraryPathAnroidx64 = ""; - string LibraryName = "sgcore"; - - 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")); - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPath, "arm64")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPath, "x64")); - - LibraryName = string.Format("lib{0}.a", LibraryName); - } - else if (bIsLinux) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryName = string.Format("lib{0}.a", LibraryName); - -#if UE_5_6_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25")); -#elif UE_5_5_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23")); -#elif UE_5_3_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22")); -#elif UE_5_2_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21")); -#else - Debug.Assert(false, "Unsupported engine version or compiler!"); -#endif - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "x86-64")); - } - else if (bIsLinuxArm64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "linux")); - LibraryName = string.Format("lib{0}.a", LibraryName); - -#if UE_5_6_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v25")); -#elif UE_5_5_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v23")); -#elif UE_5_3_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v22")); -#elif UE_5_2_OR_LATER - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "v21")); -#else - Debug.Assert(false, "Unsupported engine version or compiler!"); -#endif - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "aarch64")); - } - else if (bIsWin64) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "win64")); - switch (Target.WindowsPlatform.Compiler) - { - case WindowsCompiler.VisualStudio2022: - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc143")); - break; -#if ! UE_5_4_OR_LATER - case WindowsCompiler.VisualStudio2019: - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "msvc142")); - break; -#endif - default: - Debug.Assert(false, "Unsupported engine version or compiler!"); - break; - } - - LibraryName = string.Format("{0}.lib", LibraryName); - } - else - { - Debug.Assert(false, "Unsupported platform!"); - } - - string IncludePath = Path.GetFullPath(Path.Combine(ThirdPartyDirectory, "include")); - PrivateIncludePaths.Add(IncludePath); - - if (bIsAndroid) - { - if (bIsDebugBuild) - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "debug")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "debug")); - } - else - { - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, "release")); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, "release")); - } - - LibraryPathAnroidArm64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidArm64, LibraryName)); - LibraryPathAnroidx64 = Path.GetFullPath(Path.Combine(LibraryPathAnroidx64, LibraryName)); - - PublicAdditionalLibraries.Add(LibraryPathAnroidArm64); - PublicAdditionalLibraries.Add(LibraryPathAnroidx64); - } - else - { - if (bIsDebugBuild) - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "debug")); - } - else - { - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, "release")); - } - - LibraryPath = Path.GetFullPath(Path.Combine(LibraryPath, LibraryName)); - PublicAdditionalLibraries.Add(LibraryPath); - } - } } \ No newline at end of file diff --git a/Source/ThirdParty/SGBleThirdPartyLibs/SGBleThirdPartyLibs.Build.cs b/Source/ThirdParty/SGBleThirdPartyLibs/SGBleThirdPartyLibs.Build.cs new file mode 100644 index 00000000..15700a24 --- /dev/null +++ b/Source/ThirdParty/SGBleThirdPartyLibs/SGBleThirdPartyLibs.Build.cs @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:192e4b4c3bfbde8c4c644e26efec5687a3a9befb32dab7878079a1e78c4c8e65 +size 5692 diff --git a/Source/ThirdParty/SGConnectThirdPartyHeaders/SGConnectThirdPartyHeaders.Build.cs b/Source/ThirdParty/SGConnectThirdPartyHeaders/SGConnectThirdPartyHeaders.Build.cs new file mode 100644 index 00000000..8b4ba3a9 --- /dev/null +++ b/Source/ThirdParty/SGConnectThirdPartyHeaders/SGConnectThirdPartyHeaders.Build.cs @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfdcc3f19b59088b7ac4e487f523aaef18e9b0b10deb0462d654ae029b3c53ec +size 1799 diff --git a/Source/ThirdParty/SGConnectThirdPartyLibs/SGConnectThirdPartyLibs.Build.cs b/Source/ThirdParty/SGConnectThirdPartyLibs/SGConnectThirdPartyLibs.Build.cs new file mode 100644 index 00000000..f01cb2bc --- /dev/null +++ b/Source/ThirdParty/SGConnectThirdPartyLibs/SGConnectThirdPartyLibs.Build.cs @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65d636676f60bdd743b215f3911ff51aa353e875cbc9331b2ca4536cb6ec5b2e +size 6710 diff --git a/Source/ThirdParty/SGCoreThirdPartyLibs/SGCoreThirdPartyLibs.Build.cs b/Source/ThirdParty/SGCoreThirdPartyLibs/SGCoreThirdPartyLibs.Build.cs new file mode 100644 index 00000000..40ce3777 --- /dev/null +++ b/Source/ThirdParty/SGCoreThirdPartyLibs/SGCoreThirdPartyLibs.Build.cs @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b071fec37d35b9b752ecdc310d882828d568cc55563cdd805c1ac907b22ddaa2 +size 6701 diff --git a/Source/ThirdParty/SGSerialThirdPartyLibs/SGSerialThirdPartyLibs.Build.cs b/Source/ThirdParty/SGSerialThirdPartyLibs/SGSerialThirdPartyLibs.Build.cs new file mode 100644 index 00000000..7f1744c6 --- /dev/null +++ b/Source/ThirdParty/SGSerialThirdPartyLibs/SGSerialThirdPartyLibs.Build.cs @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7b64184de6f29516c52482202b6f196726c6ec2bc6ccd53fb01095cbf110f62 +size 6705