You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Pointing to iOS OpenSSL binaries and includes instead of duplicating everything since iOS binaries are compatible with TVOS. Tested by running a preflight on Compile UnrealGame TVOS. #rb Manuel.Lang [CL 28615685 by valentin ritzi in ue5-main branch]
81 lines
3.0 KiB
C#
81 lines
3.0 KiB
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using UnrealBuildTool;
|
|
using System.IO;
|
|
|
|
public class OpenSSL : ModuleRules
|
|
{
|
|
public OpenSSL(ReadOnlyTargetRules Target) : base(Target)
|
|
{
|
|
Type = ModuleType.External;
|
|
|
|
string OpenSSLPath = Path.Combine(Target.UEThirdPartySourceDirectory, "OpenSSL", "1.1.1t");
|
|
|
|
string PlatformSubdir = Target.Platform.ToString();
|
|
string ConfigFolder = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT) ? "Debug" : "Release";
|
|
|
|
if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS)
|
|
{
|
|
// IOS binaries are fully compatible with TVOS
|
|
if (Target.Platform == UnrealTargetPlatform.TVOS)
|
|
{
|
|
PlatformSubdir = "IOS";
|
|
}
|
|
|
|
PublicSystemIncludePaths.Add(Path.Combine(OpenSSLPath, "include", PlatformSubdir));
|
|
|
|
string LibPath = Path.Combine(OpenSSLPath, "lib", PlatformSubdir);
|
|
|
|
bool bIsIOSSimulator = Target.Platform == UnrealTargetPlatform.IOS && Target.Architecture == UnrealArch.IOSSimulator;
|
|
bool bIsTVOSSimulator = Target.Platform == UnrealTargetPlatform.TVOS && Target.Architecture == UnrealArch.TVOSSimulator;
|
|
|
|
string LibExt = (bIsIOSSimulator || bIsTVOSSimulator) ? ".sim.a" : ".a";
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libssl" + LibExt));
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libcrypto" + LibExt));
|
|
}
|
|
else if (Target.Platform.IsInGroup(UnrealPlatformGroup.Windows))
|
|
{
|
|
PlatformSubdir = "Win64";
|
|
string VSVersion = "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
|
|
|
|
// Add includes
|
|
PublicSystemIncludePaths.Add(Path.Combine(OpenSSLPath, "include", PlatformSubdir, VSVersion));
|
|
|
|
// Add Libs
|
|
string LibPath = Path.Combine(OpenSSLPath, "lib", PlatformSubdir, VSVersion, ConfigFolder);
|
|
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libssl.lib"));
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libcrypto.lib"));
|
|
PublicSystemLibraries.Add("crypt32.lib");
|
|
}
|
|
else if (Target.IsInPlatformGroup(UnrealPlatformGroup.Unix))
|
|
{
|
|
string IncludePath = Path.Combine(OpenSSLPath, "include", "Unix");
|
|
string LibraryPath = Path.Combine(OpenSSLPath, "lib", "Unix", Target.Architecture.LinuxName);
|
|
|
|
PublicSystemIncludePaths.Add(IncludePath);
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "libssl.a"));
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, "libcrypto.a"));
|
|
}
|
|
else if (Target.Platform == UnrealTargetPlatform.Android)
|
|
{
|
|
string IncludePath = Path.Combine(OpenSSLPath, "include", "Android");
|
|
string LibraryPath = Path.Combine(OpenSSLPath, "lib", "Android");
|
|
|
|
string[] Architectures = new string[] {
|
|
"ARM64",
|
|
"x86",
|
|
"x64",
|
|
};
|
|
|
|
PublicSystemIncludePaths.Add(IncludePath);
|
|
|
|
foreach(var Architecture in Architectures)
|
|
{
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, Architecture, "libcrypto.a"));
|
|
PublicAdditionalLibraries.Add(Path.Combine(LibraryPath, Architecture, "libssl.a"));
|
|
}
|
|
}
|
|
}
|
|
}
|