-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVivoxCoreLibrary.Build.cs
160 lines (143 loc) · 8.71 KB
/
VivoxCoreLibrary.Build.cs
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/* Copyright (c) 2014-2018 by Mercer Road Corp
*
* Permission to use, copy, modify or distribute this software in binary or source form
* for any purpose is allowed only under explicit prior consent in writing from Mercer Road Corp
*
* THE SOFTWARE IS PROVIDED "AS IS" AND MERCER ROAD CORP DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL MERCER ROAD CORP
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
using System.IO;
using UnrealBuildTool;
public class VivoxCoreLibrary : ModuleRules
{
public VivoxCoreLibrary(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
UnrealTargetPlatform parsedPlatform;
if (UnrealTargetPlatform.TryParse("Win64", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the Win64 specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Windows", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "Windows", "Release", "x64");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "vivoxsdk.lib"));
// Delay-load the DLL, so we can load it from the right place
PublicDelayLoadDLLs.Add("vivoxsdk.dll");
RuntimeDependencies.Add(Path.Combine(VivoxLibraryPath, "vivoxsdk.dll"));
}
else if (UnrealTargetPlatform.TryParse("XboxOne", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the XboxOne specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "XB1", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "XB1", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "vivoxsdk.lib"));
}
else if (UnrealTargetPlatform.TryParse("PS4", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the PS4 specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "PlayStation4", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "PlayStation4", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "libvivoxsdk.a"));
#if UE_4_24_OR_LATER
PublicSystemLibraries.Add("SceSha1");
PublicSystemLibraries.Add("SceAudioIn_stub_weak");
PublicSystemLibraries.Add("SceHmac");
#else
PublicAdditionalLibraries.Add("SceSha1");
PublicAdditionalLibraries.Add("SceAudioIn_stub_weak");
PublicAdditionalLibraries.Add("SceHmac");
#endif
}
else if (UnrealTargetPlatform.TryParse("Mac", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the Mac specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Mac", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "Mac", "Release");
string EnginePluginPath = Path.Combine(Path.GetFullPath(Target.RelativeEnginePath), "Plugins", "VivoxCore", "Source", "ThirdParty", "VivoxCoreLibrary", "Mac", "Release");
string ortpLib = "libortp.dylib";
string sdkLib = "libvivoxsdk.dylib";
// Delay-load the DLLs, so we can load them from the right place
PublicDelayLoadDLLs.Add(Path.Combine(EnginePluginPath, ortpLib));
PublicDelayLoadDLLs.Add(Path.Combine(EnginePluginPath, sdkLib));
RuntimeDependencies.Add(Path.Combine(EnginePluginPath, ortpLib), Path.Combine(VivoxLibraryPath, ortpLib), StagedFileType.NonUFS);
RuntimeDependencies.Add(Path.Combine(EnginePluginPath, sdkLib), Path.Combine(VivoxLibraryPath, sdkLib), StagedFileType.NonUFS);
}
else if (UnrealTargetPlatform.TryParse("Android", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the Android specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Android", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "Android", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "arm64-v8a", "libvivox-sdk.so"));
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "armeabi-v7a", "libvivox-sdk.so"));
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "x86", "libvivox-sdk.so"));
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "x86_64", "libvivox-sdk.so"));
PublicDependencyModuleNames.AddRange(new string[] { "Launch" });
string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "VivoxCoreSDK_UPL.xml"));
}
else if (UnrealTargetPlatform.TryParse("IOS", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the IOS specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "IOS", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "IOS", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "libvivoxsdk.a"));
PublicFrameworks.Add( "CFNetwork" );
PublicFrameworks.Add( "AVFoundation");
}
else if (UnrealTargetPlatform.TryParse("Switch", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the Switch specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "NX", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "NX", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "libvivoxsdk.a"));
#if UE_4_24_OR_LATER
PublicSystemLibraries.Add("curl");
PublicSystemLibraries.Add("z");
#else
PublicAdditionalLibraries.Add("curl");
PublicAdditionalLibraries.Add("z");
#endif
}
else if (UnrealTargetPlatform.TryParse("XSX", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the XSX specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Scarlett", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "Scarlett", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "vivoxsdk.lib"));
}
else if (UnrealTargetPlatform.TryParse("XboxOneGDK", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the XboxOneGDK specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "XB1GDK", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "XB1GDK", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "vivoxsdk.lib"));
}
else if (UnrealTargetPlatform.TryParse("PS5", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the PS5 specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "PlayStation5", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "PlayStation5", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "libvivoxsdk.a"));
#if UE_4_24_OR_LATER
PublicSystemLibraries.Add("SceSha1");
PublicSystemLibraries.Add("SceHmac");
#else
PublicAdditionalLibraries.Add("SceSha1");
PublicAdditionalLibraries.Add("SceHmac");
#endif
}
else if (UnrealTargetPlatform.TryParse("Stadia", out parsedPlatform) && Target.Platform == parsedPlatform)
{
// Add the Stadia specific Include and Library paths
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "GoogleStadia", "include"));
string VivoxLibraryPath = Path.Combine(ModuleDirectory, "GoogleStadia", "Release");
PublicAdditionalLibraries.Add(Path.Combine(VivoxLibraryPath, "libvivoxsdk.so"));
RuntimeDependencies.Add(Path.Combine(VivoxLibraryPath, "libvivoxsdk.so"));
}
}
}