SkyPortal-plugin/Source/SkyPortal/SkyPortal.Build.cs

92 lines
3 KiB
C#
Raw Normal View History

2024-09-17 15:50:37 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
2024-09-18 14:54:36 +00:00
using System.IO;
2024-09-17 15:50:37 +00:00
using UnrealBuildTool;
public class SkyPortal : ModuleRules
{
2024-09-18 10:25:01 +00:00
public SkyPortal(ReadOnlyTargetRules Target) : base(Target)
{
2024-09-20 22:44:38 +00:00
bPrecompile = true;
2024-09-18 16:10:50 +00:00
// Add the path to the hidapi include directory
PublicIncludePaths.Add(Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "include"));
2024-09-18 14:54:36 +00:00
2024-09-18 16:10:50 +00:00
// Check platform-specific settings
if (Target.Platform == UnrealTargetPlatform.Win64)
2024-09-18 14:54:36 +00:00
{
2024-09-18 16:10:50 +00:00
// Add the path to the library (for Windows platform)
PublicSystemLibraryPaths.Add(Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "lib", "Windows"));
// Link against the hidapi.lib (static library)
PublicAdditionalLibraries.Add(Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "lib", "Windows", "hidapi.lib"));
// Add runtime library path for the .dll (dynamic library)
PublicRuntimeLibraryPaths.Add(Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "bin", "Windows"));
// Copy the DLL to the output folder, if using dynamic linking
RuntimeDependencies.Add("$(BinaryOutputDir)/hidapi.dll", Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "bin", "Windows", "hidapi.dll"));
2024-09-18 14:54:36 +00:00
}
2024-09-18 16:10:50 +00:00
else if (Target.Platform == UnrealTargetPlatform.Mac)
2024-09-18 14:54:36 +00:00
{
2024-09-18 16:10:50 +00:00
PublicSystemLibraryPaths.Add(Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "lib", "Mac"));
PublicAdditionalLibraries.Add("hidapi.a");
// Handle Mac-specific dynamic linking
RuntimeDependencies.Add("$(BinaryOutputDir)/hidapi.dylib", Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "bin", "Mac", "hidapi.dylib"));
2024-09-18 14:54:36 +00:00
}
2024-09-18 16:10:50 +00:00
else if (Target.Platform == UnrealTargetPlatform.Linux)
{
PublicSystemLibraryPaths.Add(Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "lib", "Linux"));
PublicAdditionalLibraries.Add("hidapi.a");
2024-09-18 14:54:36 +00:00
2024-09-18 16:10:50 +00:00
RuntimeDependencies.Add("$(BinaryOutputDir)/hidapi.so", Path.Combine(PluginDirectory, "ThirdParty", "hidapi", "bin", "Linux", "hidapi.so"));
}
2024-09-18 14:54:36 +00:00
2024-09-18 10:25:01 +00:00
PublicIncludePaths.AddRange(
new string[] {
2024-09-18 16:10:50 +00:00
2024-09-18 14:54:36 +00:00
}
2024-09-18 10:25:01 +00:00
);
PrivateIncludePaths.AddRange(
new string[] {
2024-09-17 15:50:37 +00:00
// ... add other private include paths required here ...
}
2024-09-18 10:25:01 +00:00
);
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
2024-09-26 23:39:33 +00:00
"Engine",
"OpenSSL",
"SSL"
}
2024-09-18 10:25:01 +00:00
);
PrivateDependencyModuleNames.AddRange(
new string[]
{
"CoreUObject",
"Engine",
"Slate",
"SlateCore",
2024-09-26 23:39:33 +00:00
2024-09-17 15:50:37 +00:00
}
2024-09-18 10:25:01 +00:00
);
DynamicallyLoadedModuleNames.AddRange(
new string[]
{
2024-09-17 15:50:37 +00:00
// ... add any modules that your module loads dynamically here ...
}
2024-09-18 10:25:01 +00:00
);
}
2024-09-17 15:50:37 +00:00
}