kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 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 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 9 | import("//build/config/arm.gni") |
kjellander@webrtc.org | acb8085 | 2015-01-25 19:17:56 +0000 | [diff] [blame] | 10 | import("//build/config/mips.gni") |
Henrik Kjellander | b79472a | 2015-10-14 08:13:58 +0200 | [diff] [blame] | 11 | import("//build_overrides/webrtc.gni") |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 12 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 13 | declare_args() { |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 14 | build_with_libjingle = true |
| 15 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 16 | # Disable this to avoid building the Opus audio codec. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 17 | rtc_include_opus = true |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 18 | |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 19 | # Used to specify an external Jsoncpp include path when not compiling the |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 20 | # library that comes with WebRTC (i.e. rtc_build_json == 0). |
| 21 | rtc_jsoncpp_root = "//third_party/jsoncpp/source/include" |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 22 | |
| 23 | # Used to specify an external OpenSSL include path when not compiling the |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 24 | # library that comes with WebRTC (i.e. rtc_build_ssl == 0). |
| 25 | rtc_ssl_root = "" |
kjellander@webrtc.org | e281f7f | 2014-09-02 11:22:06 +0000 | [diff] [blame] | 26 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 27 | # Selects fixed-point code where possible. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 28 | rtc_prefer_fixed_point = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 29 | |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 30 | # Enable data logging. Produces text files with data logged within engines |
| 31 | # which can be easily parsed for offline processing. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 32 | rtc_enable_data_logging = false |
kjellander@webrtc.org | 78f440c | 2014-06-21 14:25:16 +0000 | [diff] [blame] | 33 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 34 | # Enables the use of protocol buffers for debug recordings. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 35 | rtc_enable_protobuf = true |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 36 | |
kjellander@webrtc.org | 11bea89 | 2014-07-03 17:04:12 +0000 | [diff] [blame] | 37 | # Disable these to not build components which can be externally provided. |
Henrik Kjellander | e6cefb6 | 2015-04-27 14:39:04 +0200 | [diff] [blame] | 38 | rtc_build_expat = true |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 39 | rtc_build_json = true |
| 40 | rtc_build_libjpeg = true |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 41 | rtc_build_libvpx = true |
Henrik Kjellander | e6cefb6 | 2015-04-27 14:39:04 +0200 | [diff] [blame] | 42 | rtc_build_libyuv = true |
Andrew MacDonald | 23dc68e | 2015-04-24 08:46:51 -0700 | [diff] [blame] | 43 | rtc_build_openmax_dl = true |
Henrik Kjellander | e6cefb6 | 2015-04-27 14:39:04 +0200 | [diff] [blame] | 44 | rtc_build_opus = true |
| 45 | rtc_build_ssl = true |
kjellander@webrtc.org | 11bea89 | 2014-07-03 17:04:12 +0000 | [diff] [blame] | 46 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 47 | # Disable by default. |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 48 | rtc_have_dbus_glib = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 49 | |
| 50 | # Enable to use the Mozilla internal settings. |
| 51 | build_with_mozilla = false |
| 52 | |
henrika@webrtc.org | 45db7ee | 2015-01-12 14:27:23 +0000 | [diff] [blame] | 53 | rtc_enable_android_opensl = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 54 | |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 55 | # Link-Time Optimizations. |
| 56 | # Executes code generation at link-time instead of compile-time. |
| 57 | # https://gcc.gnu.org/wiki/LinkTimeOptimization |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 58 | rtc_use_lto = false |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 59 | |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 60 | if (build_with_libjingle) { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 61 | rtc_include_tests = false |
| 62 | rtc_restrict_logging = true |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 63 | } else { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 64 | rtc_include_tests = true |
| 65 | rtc_restrict_logging = false |
kjellander@webrtc.org | 788f058 | 2014-08-28 13:51:08 +0000 | [diff] [blame] | 66 | } |
| 67 | |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 68 | if (is_ios) { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 69 | rtc_build_libjpeg = false |
| 70 | rtc_enable_protobuf = false |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 71 | } |
| 72 | |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 73 | if (current_cpu == "arm") { |
kjellander@webrtc.org | 6d08ca6 | 2014-09-07 17:36:10 +0000 | [diff] [blame] | 74 | rtc_prefer_fixed_point = true |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 75 | } |
kjellander@webrtc.org | 524b8f7 | 2014-08-31 20:32:53 +0000 | [diff] [blame] | 76 | |
andrew@webrtc.org | 34ac956 | 2014-12-30 18:19:56 +0000 | [diff] [blame] | 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). |
kjellander@webrtc.org | 7227391 | 2015-02-23 19:08:31 +0000 | [diff] [blame] | 79 | if (!is_ios && (current_cpu != "arm" || arm_version >= 7)) { |
andrew@webrtc.org | 4165f7a | 2014-10-08 18:01:27 +0000 | [diff] [blame] | 80 | rtc_use_openmax_dl = true |
| 81 | } else { |
| 82 | rtc_use_openmax_dl = false |
| 83 | } |
| 84 | |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 85 | # Determines whether NEON code will be built. |
petermayo | 50cf10d | 2015-07-09 09:45:04 -0700 | [diff] [blame] | 86 | rtc_build_with_neon = |
| 87 | (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)) || |
| 88 | current_cpu == "arm64" |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 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 |
hbos | a9a1d2a | 2016-01-11 10:19:02 -0800 | [diff] [blame] | 93 | |
hbos | 902c03e | 2016-01-21 03:34:40 -0800 | [diff] [blame] | 94 | # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported on |
hbos | a81f6a3 | 2016-02-07 15:05:22 -0800 | [diff] [blame] | 95 | # all platforms except iOS. Because FFmpeg can be built with/without H.264 |
| 96 | # support, |ffmpeg_branding| has to separately be set to a value that |
| 97 | # includes H.264, for example "Chrome". If FFmpeg is built without H.264, |
| 98 | # compilation succeeds but |H264DecoderImpl| fails to initialize. |
| 99 | # See also: |rtc_initialize_ffmpeg|. |
hbos | a9a1d2a | 2016-01-11 10:19:02 -0800 | [diff] [blame] | 100 | # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING. |
| 101 | # http://www.openh264.org, https://www.ffmpeg.org/ |
hbos | a81f6a3 | 2016-02-07 15:05:22 -0800 | [diff] [blame] | 102 | rtc_use_h264 = false |
hbos | c5a39c2 | 2016-02-02 02:26:05 -0800 | [diff] [blame] | 103 | |
| 104 | # FFmpeg must be initialized for |H264DecoderImpl| to work. This can be done |
| 105 | # by WebRTC during |H264DecoderImpl::InitDecode| or externally. FFmpeg must |
| 106 | # only be initialized once. Projects that initialize FFmpeg externally, such |
| 107 | # as Chromium, must turn this flag off so that WebRTC does not also |
| 108 | # initialize. |
| 109 | rtc_initialize_ffmpeg = !build_with_chromium |
kjellander@webrtc.org | 851a09e | 2014-06-17 08:54:03 +0000 | [diff] [blame] | 110 | } |
kjellander@webrtc.org | ce22f13 | 2015-02-16 12:47:20 +0000 | [diff] [blame] | 111 | |
kwiberg | f8c2bac | 2016-01-18 06:38:32 -0800 | [diff] [blame] | 112 | # A second declare_args block, so that declarations within it can |
| 113 | # depend on the possibly overridden variables in the first |
| 114 | # declare_args block. |
| 115 | declare_args() { |
| 116 | # Include the iLBC audio codec? |
| 117 | rtc_include_ilbc = !(build_with_chromium || build_with_mozilla) |
| 118 | } |
| 119 | |
kjellander@webrtc.org | ce22f13 | 2015-02-16 12:47:20 +0000 | [diff] [blame] | 120 | # Make it possible to provide custom locations for some libraries (move these |
| 121 | # up into declare_args should we need to actually use them for the GN build). |
kjellander | d6024e3 | 2015-09-28 21:16:48 -0700 | [diff] [blame] | 122 | rtc_libvpx_dir = "//third_party/libvpx_new" |
kjellander@webrtc.org | ce22f13 | 2015-02-16 12:47:20 +0000 | [diff] [blame] | 123 | rtc_libyuv_dir = "//third_party/libyuv" |
| 124 | rtc_opus_dir = "//third_party/opus" |