andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | # Copyright (c) 2012 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 | |
| 9 | # This file contains common settings for building WebRTC components. |
| 10 | |
| 11 | { |
| 12 | # Nesting is required in order to use variables for setting other variables. |
| 13 | 'variables': { |
| 14 | 'variables': { |
| 15 | 'variables': { |
| 16 | 'variables': { |
henrike@webrtc.org | 7ef7df5 | 2014-01-21 15:54:56 +0000 | [diff] [blame] | 17 | # This will already be set to zero by supplement.gypi |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 18 | 'build_with_chromium%': 1, |
kwiberg | 0edb05b | 2016-01-19 05:54:28 -0800 | [diff] [blame] | 19 | |
| 20 | # Enable to use the Mozilla internal settings. |
| 21 | 'build_with_mozilla%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 22 | }, |
| 23 | 'build_with_chromium%': '<(build_with_chromium)', |
kwiberg | 0edb05b | 2016-01-19 05:54:28 -0800 | [diff] [blame] | 24 | 'build_with_mozilla%': '<(build_with_mozilla%)', |
| 25 | 'include_opus%': 1, |
kwiberg | f8c2bac | 2016-01-18 06:38:32 -0800 | [diff] [blame] | 26 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 27 | 'conditions': [ |
kwiberg | 0edb05b | 2016-01-19 05:54:28 -0800 | [diff] [blame] | 28 | # Include the iLBC audio codec? |
| 29 | ['build_with_chromium==1 or build_with_mozilla==1', { |
| 30 | 'include_ilbc%': 0, |
| 31 | }, { |
| 32 | 'include_ilbc%': 1, |
| 33 | }], |
| 34 | |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 35 | ['build_with_chromium==1', { |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 36 | 'webrtc_root%': '<(DEPTH)/third_party/webrtc', |
kjellander | 208d198 | 2016-05-31 04:01:38 -0700 | [diff] [blame] | 37 | 'android_tests_path%': '<(DEPTH)/third_party/webrtc/build/android_tests_noop.gyp', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 38 | }, { |
| 39 | 'webrtc_root%': '<(DEPTH)/webrtc', |
kjellander | 208d198 | 2016-05-31 04:01:38 -0700 | [diff] [blame] | 40 | 'android_tests_path%': '<(DEPTH)/webrtc/build/android_tests.gyp', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 41 | }], |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 42 | |
| 43 | # Controls whether we use libevent on posix platforms. |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 44 | # TODO(phoglund): should arguably be controlled by platform #ifdefs |
| 45 | # in the code instead. |
| 46 | ['OS=="win" or OS=="mac" or OS=="ios"', { |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 47 | 'build_libevent%': 0, |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 48 | 'enable_libevent%': 0, |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 49 | }, { |
| 50 | 'build_libevent%': 1, |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 51 | 'enable_libevent%': 1, |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 52 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 53 | ], |
| 54 | }, |
| 55 | 'build_with_chromium%': '<(build_with_chromium)', |
kwiberg | f8c2bac | 2016-01-18 06:38:32 -0800 | [diff] [blame] | 56 | 'build_with_mozilla%': '<(build_with_mozilla)', |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 57 | 'build_libevent%': '<(build_libevent)', |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 58 | 'enable_libevent%': '<(enable_libevent)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 59 | 'webrtc_root%': '<(webrtc_root)', |
kjellander | 208d198 | 2016-05-31 04:01:38 -0700 | [diff] [blame] | 60 | 'android_tests_path%': '<(android_tests_path)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 61 | 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8', |
marpan@webrtc.org | 5b88317 | 2014-11-01 06:10:48 +0000 | [diff] [blame] | 62 | 'webrtc_vp9_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp9', |
kwiberg | 0edb05b | 2016-01-19 05:54:28 -0800 | [diff] [blame] | 63 | 'include_ilbc%': '<(include_ilbc)', |
| 64 | 'include_opus%': '<(include_opus)', |
kjellander@webrtc.org | 2b69eab | 2015-02-09 10:01:17 +0000 | [diff] [blame] | 65 | 'opus_dir%': '<(DEPTH)/third_party/opus', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 66 | }, |
| 67 | 'build_with_chromium%': '<(build_with_chromium)', |
kwiberg | 98ab3a4 | 2015-09-30 21:54:21 -0700 | [diff] [blame] | 68 | 'build_with_mozilla%': '<(build_with_mozilla)', |
tommi | c06b133 | 2016-05-14 11:31:40 -0700 | [diff] [blame] | 69 | 'build_libevent%': '<(build_libevent)', |
phoglund | ff27439 | 2016-05-17 03:44:28 -0700 | [diff] [blame] | 70 | 'enable_libevent%': '<(enable_libevent)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 71 | 'webrtc_root%': '<(webrtc_root)', |
kjellander | 208d198 | 2016-05-31 04:01:38 -0700 | [diff] [blame] | 72 | 'android_tests_path%': '<(android_tests_path)', |
agrieve | 39530c4 | 2016-04-07 08:18:34 -0700 | [diff] [blame] | 73 | 'test_runner_path': '<(DEPTH)/webrtc/build/android/test_runner.py', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 74 | 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)', |
marpan@webrtc.org | 5b88317 | 2014-11-01 06:10:48 +0000 | [diff] [blame] | 75 | 'webrtc_vp9_dir%': '<(webrtc_vp9_dir)', |
kwiberg | f8c2bac | 2016-01-18 06:38:32 -0800 | [diff] [blame] | 76 | 'include_ilbc%': '<(include_ilbc)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 77 | 'include_opus%': '<(include_opus)', |
phoglund | c6c00b3 | 2016-05-04 01:54:35 -0700 | [diff] [blame] | 78 | 'rtc_relative_path%': 1, |
henrike@webrtc.org | 9f36c08 | 2014-06-16 21:35:20 +0000 | [diff] [blame] | 79 | 'external_libraries%': '0', |
| 80 | 'json_root%': '<(DEPTH)/third_party/jsoncpp/source/include/', |
| 81 | # openssl needs to be defined or gyp will complain. Is is only used when |
| 82 | # when providing external libraries so just use current directory as a |
| 83 | # placeholder. |
| 84 | 'ssl_root%': '.', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 85 | |
| 86 | # The Chromium common.gypi we use treats all gyp files without |
| 87 | # chromium_code==1 as third party code. This disables many of the |
| 88 | # preferred warning settings. |
| 89 | # |
| 90 | # We can set this here to have WebRTC code treated as Chromium code. Our |
| 91 | # third party code will still have the reduced warning settings. |
| 92 | 'chromium_code': 1, |
| 93 | |
kjellander@webrtc.org | 03d45b0 | 2016-05-20 09:52:43 +0200 | [diff] [blame] | 94 | # Targets are by default not NaCl untrusted code. Use this variable exclude |
| 95 | # code that uses libraries that aren't available in the NaCl sandbox. |
| 96 | 'nacl_untrusted_build%': 0, |
| 97 | |
kjellander@webrtc.org | 0aa04f9 | 2014-03-28 13:14:00 +0000 | [diff] [blame] | 98 | # Set to 1 to enable code coverage on Linux using the gcov library. |
| 99 | 'coverage%': 0, |
| 100 | |
Johan Ahlers | 9ddac18 | 2016-07-22 08:57:23 +0200 | [diff] [blame] | 101 | # Set to "func", "block", "edge" for coverage generation. |
| 102 | # At unit test runtime set UBSAN_OPTIONS="coverage=1". |
| 103 | # It is recommend to set include_examples=0. |
| 104 | # Use llvm's sancov -html-report for human readable reports. |
| 105 | # See http://clang.llvm.org/docs/SanitizerCoverage.html . |
| 106 | 'webrtc_sanitize_coverage%': "", |
| 107 | |
solenberg@webrtc.org | d6e4663 | 2013-10-30 16:06:26 +0000 | [diff] [blame] | 108 | # Remote bitrate estimator logging/plotting. |
| 109 | 'enable_bwe_test_logging%': 0, |
| 110 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 111 | # Selects fixed-point code where possible. |
| 112 | 'prefer_fixed_point%': 0, |
| 113 | |
| 114 | # Enable data logging. Produces text files with data logged within engines |
| 115 | # which can be easily parsed for offline processing. |
| 116 | 'enable_data_logging%': 0, |
| 117 | |
andrew@webrtc.org | f9825e5 | 2013-05-20 21:18:04 +0000 | [diff] [blame] | 118 | # Enables the use of protocol buffers for debug recordings. |
| 119 | 'enable_protobuf%': 1, |
| 120 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 121 | # Disable these to not build components which can be externally provided. |
Henrik Kjellander | e6cefb6 | 2015-04-27 14:39:04 +0200 | [diff] [blame] | 122 | 'build_expat%': 1, |
henrike@webrtc.org | a685c9d | 2014-06-17 14:48:44 +0000 | [diff] [blame] | 123 | 'build_json%': 1, |
kjellander@webrtc.org | 9b8df25 | 2016-02-12 06:47:59 +0100 | [diff] [blame] | 124 | 'build_libsrtp%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 125 | 'build_libvpx%': 1, |
Peter Boström | 1299615 | 2016-05-14 02:03:18 +0200 | [diff] [blame] | 126 | 'libvpx_build_vp9%': 1, |
Henrik Kjellander | e6cefb6 | 2015-04-27 14:39:04 +0200 | [diff] [blame] | 127 | 'build_libyuv%': 1, |
andrew@webrtc.org | d2c09dd | 2015-03-11 22:06:55 +0000 | [diff] [blame] | 128 | 'build_openmax_dl%': 1, |
minyue@webrtc.org | 7c112f3 | 2015-03-17 14:04:56 +0000 | [diff] [blame] | 129 | 'build_opus%': 1, |
kjellander | 292e192 | 2016-01-13 05:46:58 -0800 | [diff] [blame] | 130 | 'build_protobuf%': 1, |
Henrik Kjellander | e6cefb6 | 2015-04-27 14:39:04 +0200 | [diff] [blame] | 131 | 'build_ssl%': 1, |
kjellander | a96e2d7 | 2016-02-04 23:52:28 -0800 | [diff] [blame] | 132 | 'build_usrsctp%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 133 | |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 134 | # Disable by default |
| 135 | 'have_dbus_glib%': 0, |
| 136 | |
kjellander@webrtc.org | 2b69eab | 2015-02-09 10:01:17 +0000 | [diff] [blame] | 137 | # Make it possible to provide custom locations for some libraries. |
kjellander | e26e787 | 2016-03-04 14:39:28 -0800 | [diff] [blame] | 138 | 'libvpx_dir%': '<(DEPTH)/third_party/libvpx', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 139 | 'libyuv_dir%': '<(DEPTH)/third_party/libyuv', |
kjellander@webrtc.org | 2b69eab | 2015-02-09 10:01:17 +0000 | [diff] [blame] | 140 | 'opus_dir%': '<(opus_dir)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 141 | |
henrika@webrtc.org | 45db7ee | 2015-01-12 14:27:23 +0000 | [diff] [blame] | 142 | # Use Java based audio layer as default for Android. |
| 143 | # Change this setting to 1 to use Open SL audio instead. |
| 144 | # TODO(henrika): add support for Open SL ES. |
| 145 | 'enable_android_opensl%': 0, |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 146 | |
andrew@webrtc.org | af7fdfc | 2014-08-29 17:41:13 +0000 | [diff] [blame] | 147 | # Link-Time Optimizations |
| 148 | # Executes code generation at link-time instead of compile-time |
| 149 | # https://gcc.gnu.org/wiki/LinkTimeOptimization |
| 150 | 'use_lto%': 0, |
| 151 | |
tpsiaki@google.com | 67eabc0 | 2014-09-10 18:06:47 +0000 | [diff] [blame] | 152 | # Defer ssl perference to that specified through sslconfig.h instead of |
| 153 | # choosing openssl or nss directly. In practice, this can be used to |
| 154 | # enable schannel on windows. |
| 155 | 'use_legacy_ssl_defaults%': 0, |
| 156 | |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 157 | # Determines whether NEON code will be built. |
| 158 | 'build_with_neon%': 0, |
| 159 | |
Henrik Kjellander | 15583c1 | 2016-02-10 10:53:12 +0100 | [diff] [blame] | 160 | # Disable this to skip building source requiring GTK. |
| 161 | 'use_gtk%': 1, |
| 162 | |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 163 | # Enable this to use HW H.264 encoder/decoder on iOS/Mac PeerConnections. |
| 164 | # Enabling this may break interop with Android clients that support H264. |
| 165 | 'use_objc_h264%': 0, |
| 166 | |
tkchin | 1bd9553 | 2016-03-23 13:19:18 -0700 | [diff] [blame] | 167 | # Enable this to prevent extern symbols from being hidden on iOS builds. |
| 168 | # The chromium settings we inherit hide symbols by default on Release |
| 169 | # builds. We want our symbols to be visible when distributing WebRTC via |
| 170 | # static libraries to avoid linker warnings. |
| 171 | 'ios_override_visibility%': 0, |
| 172 | |
mikescarlett | cd0e475 | 2016-02-08 17:35:47 -0800 | [diff] [blame] | 173 | # Determines whether QUIC code will be built. |
| 174 | 'use_quic%': 0, |
| 175 | |
hbos | a81f6a3 | 2016-02-07 15:05:22 -0800 | [diff] [blame] | 176 | 'conditions': [ |
hbos | 62756ee | 2016-02-08 02:57:00 -0800 | [diff] [blame] | 177 | # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported |
| 178 | # on all platforms except Android and iOS. Because FFmpeg can be built |
| 179 | # with/without H.264 support, |ffmpeg_branding| has to separately be set |
| 180 | # to a value that includes H.264, for example "Chrome". If FFmpeg is built |
| 181 | # without H.264, compilation succeeds but |H264DecoderImpl| fails to |
| 182 | # initialize. See also: |rtc_initialize_ffmpeg|. |
| 183 | # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING. |
| 184 | # http://www.openh264.org, https://www.ffmpeg.org/ |
| 185 | ['proprietary_codecs==1 and OS!="android" and OS!="ios"', { |
| 186 | 'rtc_use_h264%': 1, |
| 187 | }, { |
| 188 | 'rtc_use_h264%': 0, |
| 189 | }], |
| 190 | |
hbos | c5a39c2 | 2016-02-02 02:26:05 -0800 | [diff] [blame] | 191 | # FFmpeg must be initialized for |H264DecoderImpl| to work. This can be |
| 192 | # done by WebRTC during |H264DecoderImpl::InitDecode| or externally. |
| 193 | # FFmpeg must only be initialized once. Projects that initialize FFmpeg |
| 194 | # externally, such as Chromium, must turn this flag off so that WebRTC |
| 195 | # does not also initialize. |
| 196 | ['build_with_chromium==0', { |
| 197 | 'rtc_initialize_ffmpeg%': 1, |
| 198 | }, { |
| 199 | 'rtc_initialize_ffmpeg%': 0, |
| 200 | }], |
| 201 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 202 | ['build_with_chromium==1', { |
kjellander | 1c24a6d | 2016-02-05 13:10:34 -0800 | [diff] [blame] | 203 | # Build sources requiring GTK. NOTICE: This is not present in Chrome OS |
| 204 | # build environments, even if available for Chromium builds. |
| 205 | 'use_gtk%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 206 | # Exclude pulse audio on Chromium since its prerequisites don't require |
| 207 | # pulse audio. |
| 208 | 'include_pulse_audio%': 0, |
| 209 | |
| 210 | # Exclude internal ADM since Chromium uses its own IO handling. |
| 211 | 'include_internal_audio_device%': 0, |
kjellander@webrtc.org | f22695c | 2015-11-19 15:39:29 +0100 | [diff] [blame] | 212 | |
| 213 | # Remove tests for Chromium to avoid slowing down GYP generation. |
| 214 | 'include_tests%': 0, |
| 215 | 'restrict_webrtc_logging%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 216 | }, { # Settings for the standalone (not-in-Chromium) build. |
kjellander | 1c24a6d | 2016-02-05 13:10:34 -0800 | [diff] [blame] | 217 | 'use_gtk%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 218 | # TODO(andrew): For now, disable the Chrome plugins, which causes a |
| 219 | # flood of chromium-style warnings. Investigate enabling them: |
| 220 | # http://code.google.com/p/webrtc/issues/detail?id=163 |
| 221 | 'clang_use_chrome_plugins%': 0, |
| 222 | |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 223 | 'include_pulse_audio%': 1, |
| 224 | 'include_internal_audio_device%': 1, |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 225 | 'include_tests%': 1, |
andrew@webrtc.org | f1a4817 | 2013-11-07 23:47:26 +0000 | [diff] [blame] | 226 | 'restrict_webrtc_logging%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 227 | }], |
peah | c8da45f | 2016-03-03 01:28:49 -0800 | [diff] [blame] | 228 | ['target_arch=="arm" or target_arch=="arm64" or target_arch=="mipsel"', { |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 229 | 'prefer_fixed_point%': 1, |
| 230 | }], |
pasko | e305d95 | 2016-05-17 10:56:40 -0700 | [diff] [blame] | 231 | ['(target_arch=="arm" and arm_neon==1) or target_arch=="arm64"', { |
Andrew MacDonald | ac4234c | 2015-06-24 18:25:54 -0700 | [diff] [blame] | 232 | 'build_with_neon%': 1, |
| 233 | }], |
andrew@webrtc.org | 34ac956 | 2014-12-30 18:19:56 +0000 | [diff] [blame] | 234 | ['OS!="ios" and (target_arch!="arm" or arm_version>=7) and target_arch!="mips64el"', { |
andrew@webrtc.org | 4165f7a | 2014-10-08 18:01:27 +0000 | [diff] [blame] | 235 | 'rtc_use_openmax_dl%': 1, |
| 236 | }, { |
| 237 | 'rtc_use_openmax_dl%': 0, |
| 238 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 239 | ], # conditions |
| 240 | }, |
| 241 | 'target_defaults': { |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 242 | 'conditions': [ |
andrew@webrtc.org | f1a4817 | 2013-11-07 23:47:26 +0000 | [diff] [blame] | 243 | ['restrict_webrtc_logging==1', { |
| 244 | 'defines': ['WEBRTC_RESTRICT_LOGGING',], |
andrew@webrtc.org | c3e5d34 | 2012-11-23 19:30:59 +0000 | [diff] [blame] | 245 | }], |
tina.legrand@webrtc.org | 1f8c02a | 2012-10-25 12:37:08 +0000 | [diff] [blame] | 246 | ['build_with_mozilla==1', { |
| 247 | 'defines': [ |
| 248 | # Changes settings for Mozilla build. |
| 249 | 'WEBRTC_MOZILLA_BUILD', |
| 250 | ], |
| 251 | }], |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 252 | ['have_dbus_glib==1', { |
| 253 | 'defines': [ |
| 254 | 'HAVE_DBUS_GLIB', |
| 255 | ], |
| 256 | 'cflags': [ |
| 257 | '<!@(pkg-config --cflags dbus-glib-1)', |
| 258 | ], |
| 259 | }], |
phoglund | c6c00b3 | 2016-05-04 01:54:35 -0700 | [diff] [blame] | 260 | ['rtc_relative_path==1', { |
| 261 | 'defines': ['EXPAT_RELATIVE_PATH',], |
| 262 | }], |
tommi@webrtc.org | a32f064 | 2015-03-08 07:38:31 +0000 | [diff] [blame] | 263 | ['os_posix==1', { |
| 264 | 'configurations': { |
| 265 | 'Debug_Base': { |
| 266 | 'defines': [ |
| 267 | # Chromium's build/common.gypi defines _DEBUG for all posix |
| 268 | # _except_ for ios & mac. The size of data types such as |
| 269 | # pthread_mutex_t varies between release and debug builds |
| 270 | # and is controlled via this flag. Since we now share code |
| 271 | # between base/base.gyp and build/common.gypi (this file), |
| 272 | # both gyp(i) files, must consistently set this flag uniformly |
| 273 | # or else we'll run in to hard-to-figure-out problems where |
| 274 | # one compilation unit uses code from another but expects |
| 275 | # differently laid out types. |
| 276 | # For WebRTC, we want it there as well, because ASSERT and |
| 277 | # friends trigger off of it. |
| 278 | '_DEBUG', |
| 279 | ], |
| 280 | }, |
| 281 | }, |
| 282 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 283 | ['build_with_chromium==1', { |
| 284 | 'defines': [ |
| 285 | # Changes settings for Chromium build. |
kjellander | f0e174a | 2016-05-30 06:27:50 -0700 | [diff] [blame] | 286 | # TODO(kjellander): Cleanup unused ones and move defines closer to the |
| 287 | # source when webrtc:4256 is completed. |
| 288 | 'ENABLE_EXTERNAL_AUTH', |
| 289 | 'FEATURE_ENABLE_SSL', |
| 290 | 'HAVE_OPENSSL_SSL_H', |
| 291 | 'HAVE_SCTP', |
| 292 | 'HAVE_SRTP', |
| 293 | 'HAVE_WEBRTC_VIDEO', |
| 294 | 'HAVE_WEBRTC_VOICE', |
kjellander | 602f41e | 2016-04-04 23:39:45 -0700 | [diff] [blame] | 295 | 'LOGGING_INSIDE_WEBRTC', |
kjellander | f0e174a | 2016-05-30 06:27:50 -0700 | [diff] [blame] | 296 | 'NO_MAIN_THREAD_WRAPPING', |
| 297 | 'NO_SOUND_SYSTEM', |
| 298 | 'SRTP_RELATIVE_PATH', |
| 299 | 'SSL_USE_OPENSSL', |
| 300 | 'USE_WEBRTC_DEV_BRANCH', |
| 301 | 'WEBRTC_CHROMIUM_BUILD', |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 302 | ], |
| 303 | 'include_dirs': [ |
kjellander@webrtc.org | f2ec814 | 2015-01-30 14:54:36 +0000 | [diff] [blame] | 304 | # Include the top-level directory when building in Chrome, so we can |
| 305 | # use full paths (e.g. headers inside testing/ or third_party/). |
| 306 | '<(DEPTH)', |
| 307 | # The overrides must be included before the WebRTC root as that's the |
| 308 | # mechanism for selecting the override headers in Chromium. |
henrikg | ee2bf41 | 2015-09-30 03:48:52 -0700 | [diff] [blame] | 309 | '../../webrtc_overrides', |
kjellander@webrtc.org | f2ec814 | 2015-01-30 14:54:36 +0000 | [diff] [blame] | 310 | # The WebRTC root is needed to allow includes in the WebRTC code base |
| 311 | # to be prefixed with webrtc/. |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 312 | '../..', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 313 | ], |
| 314 | }, { |
kjellander@webrtc.org | f2ec814 | 2015-01-30 14:54:36 +0000 | [diff] [blame] | 315 | # Include the top-level dir so the WebRTC code can use full paths. |
| 316 | 'include_dirs': [ |
| 317 | '../..', |
| 318 | ], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 319 | 'conditions': [ |
| 320 | ['os_posix==1', { |
solenberg@webrtc.org | c6db88b | 2014-06-04 17:15:42 +0000 | [diff] [blame] | 321 | 'conditions': [ |
| 322 | # -Wextra is currently disabled in Chromium's common.gypi. Enable |
| 323 | # for targets that can handle it. For Android/arm64 right now |
| 324 | # there will be an 'enumeral and non-enumeral type in conditional |
| 325 | # expression' warning in android_tools/ndk_experimental's version |
| 326 | # of stlport. |
| 327 | # See: https://code.google.com/p/chromium/issues/detail?id=379699 |
| 328 | ['target_arch!="arm64" or OS!="android"', { |
| 329 | 'cflags': [ |
| 330 | '-Wextra', |
| 331 | # We need to repeat some flags from Chromium's common.gypi |
| 332 | # here that get overridden by -Wextra. |
| 333 | '-Wno-unused-parameter', |
| 334 | '-Wno-missing-field-initializers', |
| 335 | '-Wno-strict-overflow', |
| 336 | ], |
| 337 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 338 | ], |
| 339 | 'cflags_cc': [ |
pbos@webrtc.org | b3cc78d | 2013-11-21 11:42:02 +0000 | [diff] [blame] | 340 | '-Wnon-virtual-dtor', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 341 | # This is enabled for clang; enable for gcc as well. |
| 342 | '-Woverloaded-virtual', |
| 343 | ], |
| 344 | }], |
andresp@webrtc.org | 7fb75ec | 2013-12-20 20:20:50 +0000 | [diff] [blame] | 345 | ['clang==1', { |
| 346 | 'cflags': [ |
kjellander@webrtc.org | 7d2b6a9 | 2015-01-28 18:37:58 +0000 | [diff] [blame] | 347 | '-Wimplicit-fallthrough', |
andresp@webrtc.org | 7fb75ec | 2013-12-20 20:20:50 +0000 | [diff] [blame] | 348 | '-Wthread-safety', |
nisse | 4996eaa | 2016-05-10 23:28:10 -0700 | [diff] [blame] | 349 | '-Winconsistent-missing-override', |
andresp@webrtc.org | 7fb75ec | 2013-12-20 20:20:50 +0000 | [diff] [blame] | 350 | ], |
| 351 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 352 | ], |
| 353 | }], |
tkchin@webrtc.org | 14146e4 | 2014-10-31 00:14:39 +0000 | [diff] [blame] | 354 | ['target_arch=="arm64"', { |
| 355 | 'defines': [ |
Andrew MacDonald | cb7f8ce | 2015-05-19 22:20:17 -0700 | [diff] [blame] | 356 | 'WEBRTC_ARCH_ARM64', |
| 357 | 'WEBRTC_HAS_NEON', |
tkchin@webrtc.org | 14146e4 | 2014-10-31 00:14:39 +0000 | [diff] [blame] | 358 | ], |
| 359 | }], |
andrew@webrtc.org | 1090a6e | 2014-12-18 21:36:18 +0000 | [diff] [blame] | 360 | ['target_arch=="arm"', { |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 361 | 'defines': [ |
| 362 | 'WEBRTC_ARCH_ARM', |
| 363 | ], |
| 364 | 'conditions': [ |
andrew@webrtc.org | a56a2c5 | 2014-11-26 17:01:40 +0000 | [diff] [blame] | 365 | ['arm_version>=7', { |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 366 | 'defines': ['WEBRTC_ARCH_ARM_V7',], |
| 367 | 'conditions': [ |
| 368 | ['arm_neon==1', { |
Andrew MacDonald | cb7f8ce | 2015-05-19 22:20:17 -0700 | [diff] [blame] | 369 | 'defines': ['WEBRTC_HAS_NEON',], |
andrew@webrtc.org | a56a2c5 | 2014-11-26 17:01:40 +0000 | [diff] [blame] | 370 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 371 | ], |
| 372 | }], |
| 373 | ], |
| 374 | }], |
Richard Coles | d417c93 | 2015-04-09 17:36:12 +0200 | [diff] [blame] | 375 | ['target_arch=="mipsel" and mips_arch_variant!="r6"', { |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 376 | 'defines': [ |
| 377 | 'MIPS32_LE', |
| 378 | ], |
| 379 | 'conditions': [ |
kjellander@webrtc.org | 6dab6d7 | 2015-03-04 09:50:31 +0000 | [diff] [blame] | 380 | ['mips_float_abi=="hard"', { |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 381 | 'defines': [ |
| 382 | 'MIPS_FPU_LE', |
| 383 | ], |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 384 | }], |
andrew@webrtc.org | d05756f | 2014-09-30 15:53:24 +0000 | [diff] [blame] | 385 | ['mips_arch_variant=="r2"', { |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 386 | 'defines': [ |
| 387 | 'MIPS32_R2_LE', |
| 388 | ], |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 389 | }], |
| 390 | ['mips_dsp_rev==1', { |
| 391 | 'defines': [ |
| 392 | 'MIPS_DSP_R1_LE', |
| 393 | ], |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 394 | }], |
| 395 | ['mips_dsp_rev==2', { |
| 396 | 'defines': [ |
| 397 | 'MIPS_DSP_R1_LE', |
| 398 | 'MIPS_DSP_R2_LE', |
| 399 | ], |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 400 | }], |
| 401 | ], |
| 402 | }], |
kjellander@webrtc.org | 0aa04f9 | 2014-03-28 13:14:00 +0000 | [diff] [blame] | 403 | ['coverage==1 and OS=="linux"', { |
| 404 | 'cflags': [ '-ftest-coverage', |
| 405 | '-fprofile-arcs' ], |
kjellander | 6e6941f | 2016-04-18 23:08:09 -0700 | [diff] [blame] | 406 | 'ldflags': [ '--coverage' ], |
kjellander@webrtc.org | 0aa04f9 | 2014-03-28 13:14:00 +0000 | [diff] [blame] | 407 | 'link_settings': { 'libraries': [ '-lgcov' ] }, |
| 408 | }], |
Johan Ahlers | 9ddac18 | 2016-07-22 08:57:23 +0200 | [diff] [blame] | 409 | ['webrtc_sanitize_coverage!=""', { |
| 410 | 'cflags': [ '-fsanitize-coverage=<(webrtc_sanitize_coverage)' ], |
| 411 | 'ldflags': [ '-fsanitize-coverage=<(webrtc_sanitize_coverage)' ], |
| 412 | }], |
| 413 | ['webrtc_sanitize_coverage!="" and OS=="mac"', { |
| 414 | 'xcode_settings': { |
| 415 | 'OTHER_CFLAGS': [ |
| 416 | '-fsanitize-coverage=func', |
| 417 | ], |
| 418 | }, |
| 419 | }], |
henrike@webrtc.org | cc08e3f | 2014-03-07 15:30:21 +0000 | [diff] [blame] | 420 | ['os_posix==1', { |
| 421 | # For access to standard POSIXish features, use WEBRTC_POSIX instead of |
| 422 | # a more specific macro. |
| 423 | 'defines': [ |
| 424 | 'WEBRTC_POSIX', |
| 425 | ], |
| 426 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 427 | ['OS=="ios"', { |
| 428 | 'defines': [ |
| 429 | 'WEBRTC_MAC', |
| 430 | 'WEBRTC_IOS', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 431 | ], |
| 432 | }], |
tkchin | 1bd9553 | 2016-03-23 13:19:18 -0700 | [diff] [blame] | 433 | ['OS=="ios" and ios_override_visibility==1', { |
| 434 | 'xcode_settings': { |
| 435 | 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO', |
| 436 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', |
| 437 | } |
| 438 | }], |
Zeke Chin | 71f6f44 | 2015-06-29 14:34:58 -0700 | [diff] [blame] | 439 | ['OS=="ios" and use_objc_h264==1', { |
| 440 | 'defines': [ |
| 441 | 'WEBRTC_OBJC_H264', |
| 442 | ], |
| 443 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 444 | ['OS=="linux"', { |
| 445 | 'defines': [ |
| 446 | 'WEBRTC_LINUX', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 447 | ], |
| 448 | }], |
| 449 | ['OS=="mac"', { |
| 450 | 'defines': [ |
| 451 | 'WEBRTC_MAC', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 452 | ], |
| 453 | }], |
| 454 | ['OS=="win"', { |
| 455 | 'defines': [ |
| 456 | 'WEBRTC_WIN', |
| 457 | ], |
| 458 | # TODO(andrew): enable all warnings when possible. |
kjellander@webrtc.org | fa53d87 | 2013-02-04 10:07:17 +0000 | [diff] [blame] | 459 | # TODO(phoglund): get rid of 4373 supression when |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 460 | # http://code.google.com/p/webrtc/issues/detail?id=261 is solved. |
kjellander@webrtc.org | fa53d87 | 2013-02-04 10:07:17 +0000 | [diff] [blame] | 461 | 'msvs_disabled_warnings': [ |
| 462 | 4373, # legacy warning for ignoring const / volatile in signatures. |
| 463 | 4389, # Signed/unsigned mismatch. |
| 464 | ], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 465 | # Re-enable some warnings that Chromium disables. |
| 466 | 'msvs_disabled_warnings!': [4189,], |
| 467 | }], |
| 468 | ['OS=="android"', { |
| 469 | 'defines': [ |
| 470 | 'WEBRTC_LINUX', |
| 471 | 'WEBRTC_ANDROID', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 472 | ], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 473 | 'conditions': [ |
Henrik Kjellander | c0c7d2e | 2015-09-07 12:57:42 +0200 | [diff] [blame] | 474 | ['clang==0', { |
Henrik Kjellander | 5bfc6cb | 2015-09-21 16:50:45 +0200 | [diff] [blame] | 475 | # The Android NDK doesn't provide optimized versions of these |
| 476 | # functions. Ensure they are disabled for all compilers. |
wjia@webrtc.org | b119369 | 2013-01-12 01:52:07 +0000 | [diff] [blame] | 477 | 'cflags': [ |
| 478 | '-fno-builtin-cos', |
| 479 | '-fno-builtin-sin', |
| 480 | '-fno-builtin-cosf', |
| 481 | '-fno-builtin-sinf', |
| 482 | ], |
| 483 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 484 | ], |
| 485 | }], |
kjellander | f0e174a | 2016-05-30 06:27:50 -0700 | [diff] [blame] | 486 | ['chromeos==1', { |
| 487 | 'defines': [ |
| 488 | 'CHROMEOS', |
| 489 | ], |
| 490 | }], |
| 491 | ['os_bsd==1', { |
| 492 | 'defines': [ |
| 493 | 'BSD', |
| 494 | ], |
| 495 | }], |
| 496 | ['OS=="openbsd"', { |
| 497 | 'defines': [ |
| 498 | 'OPENBSD', |
| 499 | ], |
| 500 | }], |
| 501 | ['OS=="freebsd"', { |
| 502 | 'defines': [ |
| 503 | 'FREEBSD', |
| 504 | ], |
| 505 | }], |
Tommi | 931e658 | 2015-05-20 09:44:38 +0200 | [diff] [blame] | 506 | ['include_internal_audio_device==1', { |
| 507 | 'defines': [ |
| 508 | 'WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE', |
| 509 | ], |
| 510 | }], |
Peter Boström | 1299615 | 2016-05-14 02:03:18 +0200 | [diff] [blame] | 511 | ['libvpx_build_vp9==0', { |
| 512 | 'defines': [ |
| 513 | 'RTC_DISABLE_VP9', |
| 514 | ], |
| 515 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 516 | ], # conditions |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 517 | 'direct_dependent_settings': { |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 518 | 'conditions': [ |
| 519 | ['build_with_mozilla==1', { |
| 520 | 'defines': [ |
| 521 | # Changes settings for Mozilla build. |
| 522 | 'WEBRTC_MOZILLA_BUILD', |
| 523 | ], |
| 524 | }], |
| 525 | ['build_with_chromium==1', { |
| 526 | 'defines': [ |
| 527 | # Changes settings for Chromium build. |
kjellander | f0e174a | 2016-05-30 06:27:50 -0700 | [diff] [blame] | 528 | # TODO(kjellander): Cleanup unused ones and move defines closer to |
| 529 | # the source when webrtc:4256 is completed. |
| 530 | 'FEATURE_ENABLE_SSL', |
| 531 | 'FEATURE_ENABLE_VOICEMAIL', |
| 532 | 'EXPAT_RELATIVE_PATH', |
| 533 | 'GTEST_RELATIVE_PATH', |
| 534 | 'NO_MAIN_THREAD_WRAPPING', |
| 535 | 'NO_SOUND_SYSTEM', |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 536 | 'WEBRTC_CHROMIUM_BUILD', |
| 537 | ], |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 538 | 'include_dirs': [ |
henrikg | ee2bf41 | 2015-09-30 03:48:52 -0700 | [diff] [blame] | 539 | # The overrides must be included first as that is the mechanism for |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 540 | # selecting the override headers in Chromium. |
henrikg | ee2bf41 | 2015-09-30 03:48:52 -0700 | [diff] [blame] | 541 | '../../webrtc_overrides', |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 542 | '../..', |
| 543 | ], |
| 544 | }, { |
| 545 | 'include_dirs': [ |
| 546 | '../..', |
| 547 | ], |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 548 | }], |
| 549 | ['OS=="mac"', { |
| 550 | 'defines': [ |
| 551 | 'WEBRTC_MAC', |
| 552 | ], |
| 553 | }], |
| 554 | ['OS=="ios"', { |
| 555 | 'defines': [ |
| 556 | 'WEBRTC_MAC', |
| 557 | 'WEBRTC_IOS', |
| 558 | ], |
| 559 | }], |
| 560 | ['OS=="win"', { |
| 561 | 'defines': [ |
| 562 | 'WEBRTC_WIN', |
kjellander | f0e174a | 2016-05-30 06:27:50 -0700 | [diff] [blame] | 563 | '_CRT_SECURE_NO_WARNINGS', # Suppress warnings about _vsnprinf |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 564 | ], |
| 565 | }], |
| 566 | ['OS=="linux"', { |
| 567 | 'defines': [ |
| 568 | 'WEBRTC_LINUX', |
| 569 | ], |
| 570 | }], |
| 571 | ['OS=="android"', { |
| 572 | 'defines': [ |
| 573 | 'WEBRTC_LINUX', |
| 574 | 'WEBRTC_ANDROID', |
| 575 | ], |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 576 | }], |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 +0000 | [diff] [blame] | 577 | ['os_posix==1', { |
| 578 | # For access to standard POSIXish features, use WEBRTC_POSIX instead |
| 579 | # of a more specific macro. |
| 580 | 'defines': [ |
| 581 | 'WEBRTC_POSIX', |
| 582 | ], |
| 583 | }], |
kjellander | f0e174a | 2016-05-30 06:27:50 -0700 | [diff] [blame] | 584 | ['chromeos==1', { |
| 585 | 'defines': [ |
| 586 | 'CHROMEOS', |
| 587 | ], |
| 588 | }], |
| 589 | ['os_bsd==1', { |
| 590 | 'defines': [ |
| 591 | 'BSD', |
| 592 | ], |
| 593 | }], |
| 594 | ['OS=="openbsd"', { |
| 595 | 'defines': [ |
| 596 | 'OPENBSD', |
| 597 | ], |
| 598 | }], |
| 599 | ['OS=="freebsd"', { |
| 600 | 'defines': [ |
| 601 | 'FREEBSD', |
| 602 | ], |
| 603 | }], |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 604 | ], |
| 605 | }, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 606 | }, # target_defaults |
| 607 | } |