Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 5980644

Browse files
authored
Socket.IO is not needed when building for cloud gaming. (#691)
1 parent f109b8e commit 5980644

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

scripts/build-win.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def main():
172172
parser.add_argument('--ssl_root', help='Path for OpenSSL.')
173173
parser.add_argument('--msdk_root', help='Path for MSDK.')
174174
parser.add_argument('--quic_root', help='Path to QUIC library. Not supported yet.')
175-
parser.add_argument('--sio_root', required=True, help='Path to Socket.IO cpp. Headers in include sub-folder, libsioclient_tls.a in lib sub-folder.')
175+
parser.add_argument('--sio_root', required=False, help='Path to Socket.IO cpp. Headers in include sub-folder, libsioclient_tls.a in lib sub-folder.')
176176
parser.add_argument('--scheme', default='debug', choices=('debug', 'release'),
177177
help='Schemes for building. Supported value: debug, release')
178178
parser.add_argument('--gn_gen', default=False, action='store_true',
@@ -185,8 +185,11 @@ def main():
185185
help='To generate the API document.')
186186
parser.add_argument('--output_path', help='Path to copy sdk.')
187187
parser.add_argument('--cloud_gaming', default=False,
188-
help='Build for cloud gaming. Default to false.', action='store_true')
188+
help='Build for cloud gaming. This option is not intended to be used in general purpose. Setting to true may result unexpected behaviors. Default to false.', action='store_true')
189189
opts = parser.parse_args()
190+
if not opts.sio_root and not opts.cloud_gaming:
191+
print("sio_root is missing.")
192+
return 1
190193
if opts.ssl_root and not os.path.exists(os.path.expanduser(opts.ssl_root)):
191194
print('Invalid ssl_root.')
192195
return 1

scripts/build_linux.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def gen_lib_path(scheme):
4545
out_lib = OUT_LIB % {'scheme': scheme}
4646
return os.path.join(HOME_PATH + r'/out', out_lib)
4747

48-
def gngen(arch, ssl_root, msdk_root, quic_root, scheme, tests, use_gcc, fake_audio, shared, cloud_gaming):
48+
def gngen(arch, sio_root, ssl_root, msdk_root, quic_root, scheme, tests, use_gcc, fake_audio, shared, cloud_gaming):
4949
gn_args = list(GN_ARGS)
5050
gn_args.append('target_cpu="%s"' % arch)
5151
if scheme == 'release':
@@ -58,6 +58,9 @@ def gngen(arch, ssl_root, msdk_root, quic_root, scheme, tests, use_gcc, fake_aud
5858
gn_args.append('libsrtp_ssl_root="%s/include"' % ssl_root)
5959
else:
6060
gn_args.append('rtc_build_ssl=true')
61+
if sio_root:
62+
# If sio_root is not specified, conference SDK is not able to build.
63+
gn_args.append('owt_sio_header_root="%s"' % (sio_root + '/include'))
6164
if msdk_root:
6265
if arch == 'x86':
6366
msdk_lib = msdk_root + r'/lib32'
@@ -180,6 +183,7 @@ def main():
180183
parser.add_argument('--arch', default='x86', dest='arch', choices=('x86', 'x64'),
181184
help='Target architecture. Supported value: x86, x64')
182185
parser.add_argument('--ssl_root', help='Path for OpenSSL.')
186+
parser.add_argument('--sio_root', required=False, help='Path to Socket.IO cpp. Headers in include sub-folder, libsioclient_tls.a in lib sub-folder.')
183187
parser.add_argument('--msdk_root', help='Path for MSDK.')
184188
parser.add_argument('--quic_root', help='Path to QUIC library')
185189
parser.add_argument('--scheme', default='debug', choices=('debug', 'release'),
@@ -197,11 +201,13 @@ def main():
197201
parser.add_argument('--output_path', help='Path to copy sdk.')
198202
parser.add_argument('--use_gcc', help='Compile with GCC and libstdc++. Default is clang and libc++.', action='store_true')
199203
parser.add_argument('--shared', default=False, help='Build shared libraries. Default to static.', action='store_true')
200-
parser.add_argument('--cloud_gaming', default=False, help='Build for cloud gaming. Default to false.', action='store_true')
204+
parser.add_argument('--cloud_gaming', default=False, help='Build for cloud gaming. This option is not intended to be used in general purpose. Setting to true may result unexpected behaviors. Default to false.', action='store_true')
201205
opts = parser.parse_args()
202-
print(opts)
206+
if not opts.sio_root and not opts.cloud_gaming:
207+
print("sio_root is missing.")
208+
return 1
203209
if opts.gn_gen:
204-
if not gngen(opts.arch, opts.ssl_root, opts.msdk_root, opts.quic_root, opts.scheme, opts.tests, opts.use_gcc, opts.fake_audio, opts.shared, opts.cloud_gaming):
210+
if not gngen(opts.arch, opts.sio_root, opts.ssl_root, opts.msdk_root, opts.quic_root, opts.scheme, opts.tests, opts.use_gcc, opts.fake_audio, opts.shared, opts.cloud_gaming):
205211
return 1
206212
if opts.sdk:
207213
if not ninjabuild(opts.arch, opts.scheme, opts.shared):

talk/owt/BUILD.gn

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ static_library("owt_deps") {
9090

9191
if (!is_ios) {
9292
if (is_component_build) {
93+
# Component build is only supported by cloud gaming mode on Linux.
94+
assert(owt_cloud_gaming)
9395
shared_library("owt") {
9496
visibility = [ "*" ]
9597
deps = [
@@ -100,31 +102,19 @@ if (!is_ios) {
100102
if (rtc_enable_protobuf) {
101103
deps += [ "//third_party/protobuf:protobuf_lite" ]
102104
}
103-
104-
if (!rtc_build_ssl) {
105-
if (is_win) {
106-
libs = [
107-
"libcrypto.lib",
108-
"libssl.lib",
109-
]
110-
} else {
111-
libs = [
112-
"crypto",
113-
"ssl",
114-
]
115-
}
116-
}
117105
}
118106
} else {
119107
static_library("owt") {
120108
deps = [
121109
":owt_sdk_base",
122-
":owt_sdk_conf",
123110
":owt_sdk_p2p",
124111
"//third_party/webrtc",
125112
"//third_party/webrtc:webrtc",
126113
"//third_party/webrtc/api:libjingle_peerconnection_api",
127114
]
115+
if (!owt_cloud_gaming) {
116+
deps += [ ":owt_sdk_conf" ]
117+
}
128118
complete_static_lib = true
129119
}
130120
}

0 commit comments

Comments
 (0)