Files
UnrealEngineUWP/Engine/Source/ThirdParty/OpenSSL/OpenSSL.Build.cs
jeff fisher a8221a7553 UE-140418 Building EngineTest for Hololens from commandline fails with a fatal error LNK1181: cannot open input file
-Removing libcurl and openssl library references to files that do not exist.  Removing WITH_CURL=1 for Hololens.  If one attempts to use either at runtime they would fail.
-This allows EngineTest to build and cook.  Presumably some tests would fail, if we were able to run them at all (would require a hololens device hooked up to automation).
-A better fix would be to either build these libraries for hololens, both x64 and arm64 or to make them fully optional again, but that seems out of scope for 5.0.
-UE-141681 was created to follow up.
#jira UE-140418
#rb Steve.Smith
#lockdown Rolando.Caloca
#preflight 62018805846dda28ab0db3f5

#ROBOMERGE-OWNER: jeff.fisher
#ROBOMERGE-AUTHOR: jeff.fisher
#ROBOMERGE-SOURCE: CL 18893959 in //UE5/Release-5.0/... via CL 18894096 via CL 18894432
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
#ROBOMERGE-CONFLICT from-shelf

[CL 18894586 by jeff fisher in ue5-main branch]
2022-02-07 17:17:22 -05:00

88 lines
3.3 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 OpenSSL111cPath = Path.Combine(Target.UEThirdPartySourceDirectory, "OpenSSL", "1.1.1c");
string OpenSSL111kPath = Path.Combine(Target.UEThirdPartySourceDirectory, "OpenSSL", "1.1.1k");
string PlatformSubdir = Target.Platform.ToString();
string ConfigFolder = (Target.Configuration == UnrealTargetConfiguration.Debug && Target.bDebugBuildsActuallyUseDebugCRT) ? "Debug" : "Release";
if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS)
{
PublicIncludePaths.Add(Path.Combine(OpenSSL111kPath, "include", PlatformSubdir));
string LibPath = Path.Combine(OpenSSL111kPath, "lib", PlatformSubdir);
PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libssl.a"));
PublicAdditionalLibraries.Add(Path.Combine(LibPath, "libcrypto.a"));
}
else if (Target.Platform == UnrealTargetPlatform.Win64)
{
string VSVersion = "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
// Add includes
PublicIncludePaths.Add(Path.Combine(OpenSSL111kPath, "include", PlatformSubdir, VSVersion));
// Add Libs
string LibPath = Path.Combine(OpenSSL111kPath, "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.Platform == UnrealTargetPlatform.HoloLens)
{
// We do not currently have hololens OpenSSL binaries, lets not pretend we do.
// This means that builds that depend on OpenSSL (like EngineTest) will succeed, but use of it would fail at runtime.
//string VSVersion = "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName();
//// Add includes
//PublicIncludePaths.Add(Path.Combine(OpenSSL111kPath, "include", PlatformSubdir, VSVersion));
//// Add Libs
//string LibPath = Path.Combine(OpenSSL111kPath, "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 platform = "/Unix/" + Target.Architecture;
string IncludePath = OpenSSL111cPath + "/include" + platform;
string LibraryPath = OpenSSL111cPath + "/lib" + platform;
PublicIncludePaths.Add(IncludePath);
PublicAdditionalLibraries.Add(LibraryPath + "/libssl.a");
PublicAdditionalLibraries.Add(LibraryPath + "/libcrypto.a");
PublicDependencyModuleNames.Add("zlib");
}
else if (Target.Platform == UnrealTargetPlatform.Android)
{
string[] Architectures = new string[] {
"ARM64",
"x86",
"x64",
};
PublicIncludePaths.Add(OpenSSL111kPath + "/include/Android/");
foreach(var Architecture in Architectures)
{
PublicAdditionalLibraries.Add(OpenSSL111kPath + "/lib/Android/" + Architecture + "/libcrypto.a");
PublicAdditionalLibraries.Add(OpenSSL111kPath + "/lib/Android/" + Architecture + "/libssl.a");
}
}
}
}