1# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS.  All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9import("//build/config/arm.gni")
10import("//build/config/mips.gni")
11import("//build_overrides/webrtc.gni")
12
13declare_args() {
14  build_with_libjingle = true
15
16  # Disable this to avoid building the Opus audio codec.
17  rtc_include_opus = true
18
19  # Used to specify an external Jsoncpp include path when not compiling the
20  # library that comes with WebRTC (i.e. rtc_build_json == 0).
21  rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
22
23  # Used to specify an external OpenSSL include path when not compiling the
24  # library that comes with WebRTC (i.e. rtc_build_ssl == 0).
25  rtc_ssl_root = ""
26
27  # Selects fixed-point code where possible.
28  rtc_prefer_fixed_point = false
29
30  # Enable data logging. Produces text files with data logged within engines
31  # which can be easily parsed for offline processing.
32  rtc_enable_data_logging = false
33
34  # Enables the use of protocol buffers for debug recordings.
35  rtc_enable_protobuf = true
36
37  # Disable these to not build components which can be externally provided.
38  rtc_build_expat = true
39  rtc_build_json = true
40  rtc_build_libjpeg = true
41  rtc_build_libvpx = true
42  rtc_build_libyuv = true
43  rtc_build_openmax_dl = true
44  rtc_build_opus = true
45  rtc_build_ssl = true
46
47  # Disable by default.
48  rtc_have_dbus_glib = false
49
50  # Enable to use the Mozilla internal settings.
51  build_with_mozilla = false
52
53  rtc_enable_android_opensl = false
54
55  # Link-Time Optimizations.
56  # Executes code generation at link-time instead of compile-time.
57  # https://gcc.gnu.org/wiki/LinkTimeOptimization
58  rtc_use_lto = false
59
60  if (build_with_libjingle) {
61    rtc_include_tests = false
62    rtc_restrict_logging = true
63  } else {
64    rtc_include_tests = true
65    rtc_restrict_logging = false
66  }
67
68  if (is_ios) {
69    rtc_build_libjpeg = false
70    rtc_enable_protobuf = false
71  }
72
73  if (current_cpu == "arm") {
74    rtc_prefer_fixed_point = true
75  }
76
77  # TODO(ljubomir): Unset rtc_use_openmax_dl for mips64el once mips64el gets
78  # supported in GN (since openmax_dl is not supported for mips64el).
79  if (!is_ios && (current_cpu != "arm" || arm_version >= 7)) {
80    rtc_use_openmax_dl = true
81  } else {
82    rtc_use_openmax_dl = false
83  }
84
85  # Determines whether NEON code will be built.
86  rtc_build_with_neon =
87      (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)) ||
88      current_cpu == "arm64"
89
90  # Enable this to use HW H.264 encoder/decoder on iOS PeerConnections.
91  # Enabling this may break interop with Android clients that support H264.
92  rtc_use_objc_h264 = false
93
94  # Enable this to build H.264 encoder/decoder using third party libraries.
95  # Encoding uses OpenH264 and decoding uses FFmpeg. Because of this, OpenH264
96  # and FFmpeg have to be correctly enabled separately.
97  # - use_openh264=true is required for OpenH264 targets to be defined.
98  # - ffmpeg_branding="Chrome" is one way to support H.264 decoding in FFmpeg.
99  #   FFmpeg can be built with/without H.264 support, see 'ffmpeg_branding'.
100  #   Without it, it compiles but H264DecoderImpl fails to initialize.
101  # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
102  # http://www.openh264.org, https://www.ffmpeg.org/
103  use_third_party_h264 = false  # TODO(hbos): To be used in follow-up CL(s).
104}
105
106# Make it possible to provide custom locations for some libraries (move these
107# up into declare_args should we need to actually use them for the GN build).
108rtc_libvpx_dir = "//third_party/libvpx_new"
109rtc_libyuv_dir = "//third_party/libyuv"
110rtc_opus_dir = "//third_party/opus"
111