Files
UnrealEngineUWP/Engine/Source/Runtime/Online/WebSockets/WebSockets.Build.cs
Josh Adams b0e4357576 - UBT Code changes to remove 32-bit Windows support (C++ code for 32-bit still exists)
#rb marc.audy (concept, not each file)

[CL 15265424 by Josh Adams in ue5-main branch]
2021-01-31 15:09:58 -04:00

108 lines
2.6 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using UnrealBuildTool;
public class WebSockets : ModuleRules
{
protected virtual bool PlatformSupportsLibWebsockets
{
get
{
return
Target.Platform == UnrealTargetPlatform.Win64 ||
Target.Platform == UnrealTargetPlatform.Android ||
Target.Platform == UnrealTargetPlatform.Mac ||
Target.IsInPlatformGroup(UnrealPlatformGroup.Unix) ||
Target.Platform == UnrealTargetPlatform.IOS ||
Target.Platform == UnrealTargetPlatform.Switch;
}
}
protected virtual bool bPlatformSupportsWinHttpWebSockets
{
get
{
// Availability requires Windows 8.1 or greater, as this is the min version of WinHttp that supports WebSockets
return Target.Platform.IsInGroup(UnrealPlatformGroup.Windows) && Target.WindowsPlatform.TargetWindowsVersion >= 0x0603;
}
}
protected virtual bool UsePlatformSSL
{
get
{
return Target.Platform == UnrealTargetPlatform.Switch;
}
}
protected virtual bool ShouldUseModule
{
get
{
bool bPlatformSupportsWinRTWebsockets = Target.Platform == UnrealTargetPlatform.HoloLens;
return PlatformSupportsLibWebsockets || bPlatformSupportsWinRTWebsockets || bPlatformSupportsWinHttpWebSockets;
}
}
public WebSockets(ReadOnlyTargetRules Target) : base(Target)
{
PrivateDependencyModuleNames.AddRange(
new string[] {
"Core",
"HTTP"
}
);
bool bWithWebSockets = false;
bool bWithLibWebSockets = false;
bool bWithWinHttpWebSockets = false;
if (ShouldUseModule)
{
bWithWebSockets = true;
PrivateIncludePaths.AddRange(
new string[] {
"Runtime/Online/WebSockets/Private",
}
);
if (PlatformSupportsLibWebsockets)
{
bWithLibWebSockets = true;
if (UsePlatformSSL)
{
PrivateDefinitions.Add("WITH_SSL=0");
AddEngineThirdPartyPrivateStaticDependencies(Target, "libWebSockets");
}
else
{
AddEngineThirdPartyPrivateStaticDependencies(Target, "OpenSSL", "libWebSockets", "zlib");
PrivateDependencyModuleNames.Add("SSL");
}
}
if (bPlatformSupportsWinHttpWebSockets)
{
// Enable WinHttp Support
bWithWinHttpWebSockets = true;
AddEngineThirdPartyPrivateStaticDependencies(Target, "WinHttp");
// We need to access the WinHttp folder in HTTP
PrivateIncludePaths.AddRange(
new string[] {
"Runtime/Online/HTTP/Private",
}
);
}
}
PublicDefinitions.Add("WEBSOCKETS_PACKAGE=1");
PublicDefinitions.Add("WITH_WEBSOCKETS=" + (bWithWebSockets ? "1" : "0"));
PublicDefinitions.Add("WITH_LIBWEBSOCKETS=" + (bWithLibWebSockets ? "1" : "0"));
PublicDefinitions.Add("WITH_WINHTTPWEBSOCKETS=" + (bWithWinHttpWebSockets ? "1" : "0"));
}
}