-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathJavascriptWebSocket.Build.cs
More file actions
64 lines (54 loc) · 2.04 KB
/
JavascriptWebSocket.Build.cs
File metadata and controls
64 lines (54 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using UnrealBuildTool;
using System.IO;
using System;
public class JavascriptWebSocket : ModuleRules
{
public JavascriptWebSocket(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] {
"Core",
"CoreUObject",
"Engine",
"V8",
"Sockets",
"OnlineSubsystemUtils",
"Networking"
});
bool bPlatformSupportsLibWebsockets =
Target.IsInPlatformGroup(UnrealPlatformGroup.Windows) ||
Target.Platform == UnrealTargetPlatform.Android ||
Target.Platform == UnrealTargetPlatform.Mac ||
Target.IsInPlatformGroup(UnrealPlatformGroup.Unix);
if (bPlatformSupportsLibWebsockets)
{
PublicDefinitions.Add("WITH_JSWEBSOCKET=1");
HackWebSocketIncludeDir(Path.Combine(Directory.GetCurrentDirectory(), "ThirdParty", "libWebSockets", "libWebSockets"), Target);
}
else
{
PublicDefinitions.Add("WITH_JSWEBSOCKET=0");
}
}
private void HackWebSocketIncludeDir(String WebsocketPath, ReadOnlyTargetRules Target)
{
string PlatformSubdir = Target.Platform.ToString();
bool bHasZlib = false;
if (Target.IsInPlatformGroup(UnrealPlatformGroup.Windows))
{
PlatformSubdir = Path.Combine(PlatformSubdir, "VS" + Target.WindowsPlatform.GetVisualStudioCompilerVersionName());
bHasZlib = true;
}
else if (Target.Platform == UnrealTargetPlatform.Linux)
{
PlatformSubdir = Path.Combine(PlatformSubdir, Target.Architecture.ToString());
}
PrivateDependencyModuleNames.Add("libWebSockets");
if (bHasZlib)
{
PrivateDependencyModuleNames.Add("zlib");
}
PrivateIncludePaths.Add(Path.Combine(WebsocketPath, "include"));
PrivateIncludePaths.Add(Path.Combine(WebsocketPath, "include", PlatformSubdir));
}
}