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

Commit

Permalink
Socket.IO is not needed when building for cloud gaming. (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
jianjunz authored Mar 2, 2023
1 parent f109b8e commit 5980644
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
7 changes: 5 additions & 2 deletions scripts/build-win.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def main():
parser.add_argument('--ssl_root', help='Path for OpenSSL.')
parser.add_argument('--msdk_root', help='Path for MSDK.')
parser.add_argument('--quic_root', help='Path to QUIC library. Not supported yet.')
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.')
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.')
parser.add_argument('--scheme', default='debug', choices=('debug', 'release'),
help='Schemes for building. Supported value: debug, release')
parser.add_argument('--gn_gen', default=False, action='store_true',
Expand All @@ -185,8 +185,11 @@ def main():
help='To generate the API document.')
parser.add_argument('--output_path', help='Path to copy sdk.')
parser.add_argument('--cloud_gaming', default=False,
help='Build for cloud gaming. Default to false.', action='store_true')
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')
opts = parser.parse_args()
if not opts.sio_root and not opts.cloud_gaming:
print("sio_root is missing.")
return 1
if opts.ssl_root and not os.path.exists(os.path.expanduser(opts.ssl_root)):
print('Invalid ssl_root.')
return 1
Expand Down
14 changes: 10 additions & 4 deletions scripts/build_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def gen_lib_path(scheme):
out_lib = OUT_LIB % {'scheme': scheme}
return os.path.join(HOME_PATH + r'/out', out_lib)

def gngen(arch, ssl_root, msdk_root, quic_root, scheme, tests, use_gcc, fake_audio, shared, cloud_gaming):
def gngen(arch, sio_root, ssl_root, msdk_root, quic_root, scheme, tests, use_gcc, fake_audio, shared, cloud_gaming):
gn_args = list(GN_ARGS)
gn_args.append('target_cpu="%s"' % arch)
if scheme == 'release':
Expand All @@ -58,6 +58,9 @@ def gngen(arch, ssl_root, msdk_root, quic_root, scheme, tests, use_gcc, fake_aud
gn_args.append('libsrtp_ssl_root="%s/include"' % ssl_root)
else:
gn_args.append('rtc_build_ssl=true')
if sio_root:
# If sio_root is not specified, conference SDK is not able to build.
gn_args.append('owt_sio_header_root="%s"' % (sio_root + '/include'))
if msdk_root:
if arch == 'x86':
msdk_lib = msdk_root + r'/lib32'
Expand Down Expand Up @@ -180,6 +183,7 @@ def main():
parser.add_argument('--arch', default='x86', dest='arch', choices=('x86', 'x64'),
help='Target architecture. Supported value: x86, x64')
parser.add_argument('--ssl_root', help='Path for OpenSSL.')
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.')
parser.add_argument('--msdk_root', help='Path for MSDK.')
parser.add_argument('--quic_root', help='Path to QUIC library')
parser.add_argument('--scheme', default='debug', choices=('debug', 'release'),
Expand All @@ -197,11 +201,13 @@ def main():
parser.add_argument('--output_path', help='Path to copy sdk.')
parser.add_argument('--use_gcc', help='Compile with GCC and libstdc++. Default is clang and libc++.', action='store_true')
parser.add_argument('--shared', default=False, help='Build shared libraries. Default to static.', action='store_true')
parser.add_argument('--cloud_gaming', default=False, help='Build for cloud gaming. Default to false.', action='store_true')
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')
opts = parser.parse_args()
print(opts)
if not opts.sio_root and not opts.cloud_gaming:
print("sio_root is missing.")
return 1
if opts.gn_gen:
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):
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):
return 1
if opts.sdk:
if not ninjabuild(opts.arch, opts.scheme, opts.shared):
Expand Down
20 changes: 5 additions & 15 deletions talk/owt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ static_library("owt_deps") {

if (!is_ios) {
if (is_component_build) {
# Component build is only supported by cloud gaming mode on Linux.
assert(owt_cloud_gaming)
shared_library("owt") {
visibility = [ "*" ]
deps = [
Expand All @@ -100,31 +102,19 @@ if (!is_ios) {
if (rtc_enable_protobuf) {
deps += [ "//third_party/protobuf:protobuf_lite" ]
}

if (!rtc_build_ssl) {
if (is_win) {
libs = [
"libcrypto.lib",
"libssl.lib",
]
} else {
libs = [
"crypto",
"ssl",
]
}
}
}
} else {
static_library("owt") {
deps = [
":owt_sdk_base",
":owt_sdk_conf",
":owt_sdk_p2p",
"//third_party/webrtc",
"//third_party/webrtc:webrtc",
"//third_party/webrtc/api:libjingle_peerconnection_api",
]
if (!owt_cloud_gaming) {
deps += [ ":owt_sdk_conf" ]
}
complete_static_lib = true
}
}
Expand Down

0 comments on commit 5980644

Please sign in to comment.