blob: 2a072793bc85911dd408420c833ec74ffaa29956 [file] [log] [blame]
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +00001# 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
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +00009import("//build/config/arm.gni")
hbos62756ee2016-02-08 02:57:00 -080010import("//build/config/features.gni")
kjellander@webrtc.orgacb80852015-01-25 19:17:56 +000011import("//build/config/mips.gni")
Henrik Kjellanderb79472a2015-10-14 08:13:58 +020012import("//build_overrides/webrtc.gni")
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000013
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000014declare_args() {
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000015 # Disable this to avoid building the Opus audio codec.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000016 rtc_include_opus = true
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000017
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000018 # Used to specify an external Jsoncpp include path when not compiling the
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000019 # library that comes with WebRTC (i.e. rtc_build_json == 0).
20 rtc_jsoncpp_root = "//third_party/jsoncpp/source/include"
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000021
22 # Used to specify an external OpenSSL include path when not compiling the
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000023 # library that comes with WebRTC (i.e. rtc_build_ssl == 0).
24 rtc_ssl_root = ""
kjellander@webrtc.orge281f7f2014-09-02 11:22:06 +000025
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000026 # Selects fixed-point code where possible.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000027 rtc_prefer_fixed_point = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000028
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000029 # Enable data logging. Produces text files with data logged within engines
30 # which can be easily parsed for offline processing.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000031 rtc_enable_data_logging = false
kjellander@webrtc.org78f440c2014-06-21 14:25:16 +000032
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000033 # Enables the use of protocol buffers for debug recordings.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000034 rtc_enable_protobuf = true
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000035
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000036 # Disable these to not build components which can be externally provided.
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020037 rtc_build_expat = true
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000038 rtc_build_json = true
39 rtc_build_libjpeg = true
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000040 rtc_build_libvpx = true
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020041 rtc_build_libyuv = true
Andrew MacDonald23dc68e2015-04-24 08:46:51 -070042 rtc_build_openmax_dl = true
Henrik Kjellandere6cefb62015-04-27 14:39:04 +020043 rtc_build_opus = true
44 rtc_build_ssl = true
kjellander@webrtc.org11bea892014-07-03 17:04:12 +000045
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000046 # Disable by default.
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000047 rtc_have_dbus_glib = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000048
49 # Enable to use the Mozilla internal settings.
50 build_with_mozilla = false
51
henrika@webrtc.org45db7ee2015-01-12 14:27:23 +000052 rtc_enable_android_opensl = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000053
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000054 # Link-Time Optimizations.
55 # Executes code generation at link-time instead of compile-time.
56 # https://gcc.gnu.org/wiki/LinkTimeOptimization
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000057 rtc_use_lto = false
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000058
kjellander@webrtc.org2db1dbb2016-03-11 21:34:24 -080059 rtc_include_tests = false
60 rtc_restrict_logging = true
kjellander@webrtc.org788f0582014-08-28 13:51:08 +000061
phoglundff274392016-05-17 03:44:28 -070062 # Enable libevent task queues on platforms that support it.
63 if (is_win || is_mac || is_ios || is_nacl) {
64 rtc_enable_libevent = false
65 rtc_build_libevent = false
66 } else {
67 rtc_enable_libevent = true
68 rtc_build_libevent = true
69 }
70
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000071 if (is_ios) {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000072 rtc_build_libjpeg = false
73 rtc_enable_protobuf = false
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000074 }
75
pkotwicza75339c2016-02-10 10:21:07 -080076 if (current_cpu == "arm" || current_cpu == "arm64") {
kjellander@webrtc.org6d08ca62014-09-07 17:36:10 +000077 rtc_prefer_fixed_point = true
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +000078 }
kjellander@webrtc.org524b8f72014-08-31 20:32:53 +000079
andrew@webrtc.org34ac9562014-12-30 18:19:56 +000080 # TODO(ljubomir): Unset rtc_use_openmax_dl for mips64el once mips64el gets
81 # supported in GN (since openmax_dl is not supported for mips64el).
kjellander@webrtc.org72273912015-02-23 19:08:31 +000082 if (!is_ios && (current_cpu != "arm" || arm_version >= 7)) {
andrew@webrtc.org4165f7a2014-10-08 18:01:27 +000083 rtc_use_openmax_dl = true
84 } else {
85 rtc_use_openmax_dl = false
86 }
87
Andrew MacDonaldac4234c2015-06-24 18:25:54 -070088 # Determines whether NEON code will be built.
petermayo50cf10d2015-07-09 09:45:04 -070089 rtc_build_with_neon =
90 (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)) ||
91 current_cpu == "arm64"
Zeke Chin71f6f442015-06-29 14:34:58 -070092
93 # Enable this to use HW H.264 encoder/decoder on iOS PeerConnections.
94 # Enabling this may break interop with Android clients that support H264.
95 rtc_use_objc_h264 = false
hbosa9a1d2a2016-01-11 10:19:02 -080096
hbos902c03e2016-01-21 03:34:40 -080097 # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on
hbos62756ee2016-02-08 02:57:00 -080098 # all platforms except Android and iOS. Because FFmpeg can be built
99 # with/without H.264 support, |ffmpeg_branding| has to separately be set to a
100 # value that includes H.264, for example "Chrome". If FFmpeg is built without
101 # H.264, compilation succeeds but |H264DecoderImpl| fails to initialize. See
102 # also: |rtc_initialize_ffmpeg|.
hbosa9a1d2a2016-01-11 10:19:02 -0800103 # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
104 # http://www.openh264.org, https://www.ffmpeg.org/
hbos62756ee2016-02-08 02:57:00 -0800105 rtc_use_h264 = proprietary_codecs && !is_android && !is_ios
hbosc5a39c22016-02-02 02:26:05 -0800106
107 # FFmpeg must be initialized for |H264DecoderImpl| to work. This can be done
108 # by WebRTC during |H264DecoderImpl::InitDecode| or externally. FFmpeg must
109 # only be initialized once. Projects that initialize FFmpeg externally, such
110 # as Chromium, must turn this flag off so that WebRTC does not also
111 # initialize.
112 rtc_initialize_ffmpeg = !build_with_chromium
kjellander@webrtc.org851a09e2014-06-17 08:54:03 +0000113}
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +0000114
kwibergf8c2bac2016-01-18 06:38:32 -0800115# A second declare_args block, so that declarations within it can
116# depend on the possibly overridden variables in the first
117# declare_args block.
118declare_args() {
119 # Include the iLBC audio codec?
120 rtc_include_ilbc = !(build_with_chromium || build_with_mozilla)
121}
122
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +0000123# Make it possible to provide custom locations for some libraries (move these
124# up into declare_args should we need to actually use them for the GN build).
kjellandere26e7872016-03-04 14:39:28 -0800125rtc_libvpx_dir = "//third_party/libvpx"
kjellander@webrtc.orgce22f132015-02-16 12:47:20 +0000126rtc_libyuv_dir = "//third_party/libyuv"
127rtc_opus_dir = "//third_party/opus"