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

Commit 168dfca

Browse files
authored
Add build options for QUIC (#499)
1 parent 39ed411 commit 168dfca

File tree

2 files changed

+35
-9
lines changed

2 files changed

+35
-9
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,23 @@ target_os = []
4747
#### Windows
4848
- Set the environment variable `BOOST_ROOT` to your boost source tree.
4949
- Run `gclient sync`. It may take a long time to download a large amount of data.
50-
- Go to the `src/scripts` directory, and run: `python build-win.py --gn_gen --sdk --tests --ssl_root /path/to/ssl --msdk_root /path/to/msdk --output_path /path/to/out`. The built binary will be under `output_path`, the document for sdk will also be copied to this directory if docs have been generated. If `output_path` is not set, the built binary will be under `src/out` directory. Note the first time you run this it will take a long time to pull chromium/webrtc dependencies and require network access to Google's code/storage infrastructure. Set `ssl_root` to the directory of your OpenSSL 1.1.0 binary. Set `msdk_root` to the directory of your Intel Media SDK for Windows, version 2018 R1 or higher. Use `--gn_gen` to generate args.gn during the first build or when you change the `msdk_root` or `ssl_root` paths.
50+
- Go to the `src/scripts` directory, and run: `python build-win.py --gn_gen --sdk --tests --ssl_root /path/to/ssl --msdk_root /path/to/msdk --output_path /path/to/out`.
51+
The built binary will be under `output_path`, the document for sdk will also be copied to this directory if docs have been generated. If `output_path` is not set,
52+
the built binary will be under `src/out` directory. Note the first time you run this it will take a long time to pull chromium/webrtc dependencies and
53+
require network access to Google's code/storage infrastructure. Set `ssl_root` to the directory of your OpenSSL 1.1.0 binary. Set `msdk_root` to the
54+
directory of your Intel Media SDK for Windows, version 2018 R1 or higher. Use `--gn_gen` to generate args.gn during the first build or when
55+
you change the `msdk_root` or `ssl_root` paths.
56+
- You can also specify `quic_root` to the path containing QUIC library built from owt-deps-quic. This will build the SDK with QUIC enabled for conference mode.
5157

5258
#### Linux
5359
- Run `gclient sync`. It may take a long time to download a large amount of data.
54-
- Go to the `src/scripts` directory, and run: `python build_linux.py --gn_gen --sdk --tests --ssl_root /path/to/ssl --output_path /path/to/out`. The built binary will be under `output_path`, the document for sdk will also be copied to this directory if docs have been generated. If `output_path` is not set, the built binary will be under the `src/out` directory. Note the first time you run this it will take a long time to pull chromium/webrtc dependencies and require network access to Google's code/storage infrastructure. Set `ssl_root` to the directory of your OpenSSL 1.1.0 binary. Use `--gn_gen` to generate args.gn during the first build or when you change the `ssl_root` path. If `--msdk_root` is specified to correct Intel MediaSDK path, for example, '/opt/intel/mediasdk', hardware codecs will be built besides the software implementations. If `--fake_audio` is specified, the internal audio devices implementation based on alsa or pulseaudio will not be built.
60+
- Go to the `src/scripts` directory, and run: `python build_linux.py --gn_gen --sdk --tests --ssl_root /path/to/ssl --output_path /path/to/out`.
61+
The built binary will be under `output_path`, the document for sdk will also be copied to this directory if docs have been generated.
62+
If `output_path` is not set, the built binary will be under the `src/out` directory. Note the first time you run this it will take a
63+
long time to pull chromium/webrtc dependencies and require network access to Google's code/storage infrastructure. Set `ssl_root` to the
64+
directory of your OpenSSL 1.1.0 binary. Use `--gn_gen` to generate args.gn during the first build or when you change the `ssl_root` path.
65+
If `--msdk_root` is specified to correct Intel MediaSDK path, for example, '/opt/intel/mediasdk', hardware codecs will be built besides the
66+
software implementations. If `--fake_audio` is specified, the internal audio devices implementation based on alsa or pulseaudio will not be built.
5567

5668
#### iOS
5769
- Run `gclient sync`. It may take a long time to download a large amount of data.

scripts/build-win.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
]
3737

3838

39-
def gngen(arch, ssl_root, msdk_root, scheme, tests):
39+
def gngen(arch, ssl_root, msdk_root, quic_root, scheme, tests):
4040
gn_args = list(GN_ARGS)
4141
gn_args.append('target_cpu="%s"' % arch)
4242
if scheme == 'release':
@@ -59,6 +59,15 @@ def gngen(arch, ssl_root, msdk_root, scheme, tests):
5959
gn_args.append('owt_msdk_lib_root="%s"' % msdk_lib)
6060
else:
6161
print('msdk_root is not set.')
62+
if quic_root:
63+
gn_args.append('owt_quic_header_root="%s"' % (quic_root + r'\include'))
64+
if scheme == 'release':
65+
quic_lib = quic_root + r'\bin\release'
66+
elif scheme == 'debug':
67+
quic_lib = quic_root + r'\bin\debug'
68+
else:
69+
return False
70+
gn_args.append('owt_use_quic=true')
6271
if tests:
6372
gn_args.append('rtc_include_tests=true')
6473
gn_args.append('owt_include_tests=true')
@@ -113,10 +122,10 @@ def _mergelibs(arch, scheme, ssl_root):
113122

114123

115124
# Run unit tests on simulator. Return True if all tests are passed.
116-
def runtest(scheme):
117-
test_root_path = os.path.join(OUT_PATH, '%s-x86' % scheme)
125+
def runtest(arch, scheme):
126+
test_root_path = os.path.join(OUT_PATH, r'%s-%s' % (scheme, arch))
118127
for test_target in PARALLEL_TEST_TARGET_LIST:
119-
if subprocess.call(['python', 'third_party\gtest-parallel\gtest-parallel',
128+
if subprocess.call(['python', 'third_party\gtest-parallel\gtest_parallel.py',
120129
'%s\%s.exe' % (test_root_path, test_target)],
121130
cwd=HOME_PATH, shell=False):
122131
return False
@@ -165,6 +174,7 @@ def main():
165174
help='Target architecture. Supported value: x86, x64')
166175
parser.add_argument('--ssl_root', help='Path for OpenSSL.')
167176
parser.add_argument('--msdk_root', help='Path for MSDK.')
177+
parser.add_argument('--quic_root', help='Path to QUIC library')
168178
parser.add_argument('--scheme', default='debug', choices=('debug', 'release'),
169179
help='Schemes for building. Supported value: debug, release')
170180
parser.add_argument('--gn_gen', default=False, action='store_true',
@@ -180,20 +190,24 @@ def main():
180190
if opts.ssl_root and not os.path.exists(os.path.expanduser(opts.ssl_root)):
181191
print('Invalid ssl_root.')
182192
return 1
183-
if opts.ssl_root and not os.path.exists(os.path.expanduser(opts.msdk_root)):
193+
if opts.msdk_root and not os.path.exists(os.path.expanduser(opts.msdk_root)):
184194
print('Invalid msdk_root')
185195
return 1
196+
if opts.quic_root and not os.path.exists(os.path.expanduser(opts.quic_root)):
197+
print('Invalid quic_root')
198+
return 1
186199
print(opts)
187200
if opts.gn_gen:
188-
if not gngen(opts.arch, opts.ssl_root, opts.msdk_root, opts.scheme, opts.tests):
201+
if not gngen(opts.arch, opts.ssl_root, opts.msdk_root, opts.quic_root,
202+
opts.scheme, opts.tests):
189203
return 1
190204
if opts.sdk:
191205
if not ninjabuild(opts.arch, opts.scheme):
192206
return 1
193207
else:
194208
_mergelibs(opts.arch, opts.scheme, opts.ssl_root)
195209
if opts.tests:
196-
if not runtest(opts.scheme):
210+
if not runtest(opts.arch, opts.scheme):
197211
return 1
198212
if opts.docs:
199213
if not gendocs():

0 commit comments

Comments
 (0)