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

Commit 6f64c40

Browse files
brgavinoBrandon Gavino
andauthored
Build script enable windows arm64 target (#531)
* Build script enable winarm64 target Build Script changes that enable windows arm64 compile target through VC cross compile toolchain x64/arm64 * Update BUILD.gn * PR review fixes for BUILD.gn * Fix dropped merge line Co-authored-by: Brandon Gavino <[email protected]>
1 parent c4e5103 commit 6f64c40

File tree

2 files changed

+25
-26
lines changed

2 files changed

+25
-26
lines changed

scripts/build-win.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
NONPARALLEL_TEST_TARGET_LIST = ['webrtc_nonparallel_tests']
2525

2626
GN_ARGS = [
27-
'is_clang=false',
2827
'rtc_use_h264=true',
2928
'ffmpeg_branding="Chrome"',
3029
'rtc_use_h265=true',
@@ -39,6 +38,8 @@
3938
def gngen(arch, ssl_root, msdk_root, quic_root, scheme, tests):
4039
gn_args = list(GN_ARGS)
4140
gn_args.append('target_cpu="%s"' % arch)
41+
if arch != 'arm64':
42+
gn_args.append('is_clang=false')
4243
if scheme == 'release':
4344
gn_args.append('is_debug=false')
4445
else:
@@ -170,8 +171,8 @@ def pack_sdk(scheme, output_path):
170171

171172
def main():
172173
parser = argparse.ArgumentParser()
173-
parser.add_argument('--arch', default='x86', dest='arch', choices=('x86', 'x64'),
174-
help='Target architecture. Supported value: x86, x64')
174+
parser.add_argument('--arch', default='x86', dest='arch', choices=('x86', 'x64', 'arm64'),
175+
help='Target architecture. Supported value: x86, x64, arm64')
175176
parser.add_argument('--ssl_root', help='Path for OpenSSL.')
176177
parser.add_argument('--msdk_root', help='Path for MSDK.')
177178
parser.add_argument('--quic_root', help='Path to QUIC library')

talk/owt/BUILD.gn

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,18 @@ import("//testing/test.gni")
88
# Introduced for using libvpx config files. We only enable libvpx rate
99
# controller for VP9 on Windows.
1010
if (is_win) {
11-
os_category = current_os
12-
13-
if (current_cpu == "x86") {
14-
cpu_arch_full = "ia32"
15-
} else if (current_cpu == "x64") {
16-
cpu_arch_full = "x64"
17-
} else if (current_cpu == "arm") {
18-
if (arm_use_neon) {
19-
cpu_arch_full = "arm-neon"
20-
} else if (is_android) {
21-
cpu_arch_full = "arm-neon-cpu-detect"
22-
} else {
23-
cpu_arch_full = "arm"
24-
}
25-
}
11+
12+
if (current_cpu == "x86") {
13+
cpu_arch_full = "ia32"
14+
} else if (current_cpu == "x64") {
15+
cpu_arch_full = "x64"
16+
} else if (current_cpu == "arm") {
17+
if (arm_use_neon) {
18+
cpu_arch_full = "arm-neon"
19+
} else {
20+
cpu_arch_full = "arm"
21+
}
22+
}
2623
}
2724

2825
if (is_android) {
@@ -204,6 +201,14 @@ static_library("owt_sdk_base") {
204201
"sdk/base/win/sysmem_allocator.cc",
205202
"sdk/base/win/sysmem_allocator.h",
206203
"sdk/base/win/vpedefs.h",
204+
"sdk/base/win/vp9ratecontrol.cc",
205+
"sdk/base/win/vp9ratecontrol.h",
206+
]
207+
public_deps += [ "//third_party/libvpx" ]
208+
include_dirs += [
209+
"//third_party/libvpx/source/config",
210+
"//third_party/libvpx/source/config/$current_os/$cpu_arch_full",
211+
"//third_party/libvpx/source/libvpx",
207212
]
208213
}
209214

@@ -241,21 +246,14 @@ static_library("owt_sdk_base") {
241246
"sdk/base/win/videorendererwin.h",
242247
"sdk/base/win/videorendererd3d11.cc",
243248
"sdk/base/win/videorendererd3d11.h",
244-
"sdk/base/win/vp9ratecontrol.cc",
245-
"sdk/base/win/vp9ratecontrol.h",
246249
"sdk/base/win/d3d11_manager.h",
247250
"sdk/base/win/device_info_mf.h",
248251
"sdk/base/win/device_info_mf.cc",
249252
"sdk/base/win/video_capture_mf.h",
250253
"sdk/base/win/video_capture_mf.cc",
251254
]
252255
public_deps += [ "//third_party/webrtc/modules/audio_device:audio_device_module_from_input_and_output" ]
253-
public_deps += [ "//third_party/libvpx" ]
254-
include_dirs += [
255-
"//third_party/libvpx/source/config",
256-
"//third_party/libvpx/source/config/$os_category/$cpu_arch_full",
257-
"//third_party/libvpx/source/libvpx",
258-
]
256+
259257
}
260258
if (is_linux) {
261259
if (owt_msdk_header_root != "") {

0 commit comments

Comments
 (0)