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': { |
| 17 | # This will be set to zero in the supplement.gypi triggered by a |
| 18 | # gclient hook in the standalone build. |
| 19 | 'build_with_chromium%': 1, |
| 20 | }, |
| 21 | 'build_with_chromium%': '<(build_with_chromium)', |
| 22 | |
| 23 | 'conditions': [ |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 24 | ['build_with_chromium==1', { |
| 25 | 'build_with_libjingle': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 26 | 'webrtc_root%': '<(DEPTH)/third_party/webrtc', |
henrike@webrtc.org | 1303af3 | 2013-07-03 21:50:33 +0000 | [diff] [blame] | 27 | 'apk_tests_path%': '<(DEPTH)/third_party/webrtc/build/apk_tests.gyp', |
henrike@webrtc.org | a2073af | 2013-07-08 18:14:58 +0000 | [diff] [blame] | 28 | 'modules_java_gyp_path%': '<(DEPTH)/third_party/webrtc/modules/modules_java_chromium.gyp', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 29 | }, { |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 30 | 'build_with_libjingle%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 31 | 'webrtc_root%': '<(DEPTH)/webrtc', |
henrike@webrtc.org | 1303af3 | 2013-07-03 21:50:33 +0000 | [diff] [blame] | 32 | 'apk_tests_path%': '<(DEPTH)/webrtc/build/apk_test_noop.gyp', |
henrike@webrtc.org | a2073af | 2013-07-08 18:14:58 +0000 | [diff] [blame] | 33 | 'modules_java_gyp_path%': '<(DEPTH)/webrtc/modules/modules_java.gyp', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 34 | }], |
| 35 | ], |
| 36 | }, |
| 37 | 'build_with_chromium%': '<(build_with_chromium)', |
fischman@webrtc.org | f61e02c | 2013-02-20 23:13:46 +0000 | [diff] [blame] | 38 | 'build_with_libjingle%': '<(build_with_libjingle)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 39 | 'webrtc_root%': '<(webrtc_root)', |
henrike@webrtc.org | 1303af3 | 2013-07-03 21:50:33 +0000 | [diff] [blame] | 40 | 'apk_tests_path%': '<(apk_tests_path)', |
henrike@webrtc.org | a2073af | 2013-07-08 18:14:58 +0000 | [diff] [blame] | 41 | 'modules_java_gyp_path%': '<(modules_java_gyp_path)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 42 | |
| 43 | 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8', |
stefan@webrtc.org | f56d612 | 2013-07-09 12:32:35 +0000 | [diff] [blame] | 44 | 'rbe_components_path%': '<(webrtc_root)/modules/remote_bitrate_estimator', |
leozwang@webrtc.org | 6f19b1b | 2012-10-27 17:46:55 +0000 | [diff] [blame] | 45 | 'include_opus%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 46 | }, |
| 47 | 'build_with_chromium%': '<(build_with_chromium)', |
fischman@webrtc.org | f61e02c | 2013-02-20 23:13:46 +0000 | [diff] [blame] | 48 | 'build_with_libjingle%': '<(build_with_libjingle)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 49 | 'webrtc_root%': '<(webrtc_root)', |
henrike@webrtc.org | 1303af3 | 2013-07-03 21:50:33 +0000 | [diff] [blame] | 50 | 'apk_tests_path%': '<(apk_tests_path)', |
henrike@webrtc.org | a2073af | 2013-07-08 18:14:58 +0000 | [diff] [blame] | 51 | 'modules_java_gyp_path%': '<(modules_java_gyp_path)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 52 | 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)', |
| 53 | 'include_opus%': '<(include_opus)', |
stefan@webrtc.org | f56d612 | 2013-07-09 12:32:35 +0000 | [diff] [blame] | 54 | 'rbe_components_path%': '<(rbe_components_path)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 55 | |
| 56 | # The Chromium common.gypi we use treats all gyp files without |
| 57 | # chromium_code==1 as third party code. This disables many of the |
| 58 | # preferred warning settings. |
| 59 | # |
| 60 | # We can set this here to have WebRTC code treated as Chromium code. Our |
| 61 | # third party code will still have the reduced warning settings. |
| 62 | 'chromium_code': 1, |
| 63 | |
solenberg@webrtc.org | d6e4663 | 2013-10-30 16:06:26 +0000 | [diff] [blame] | 64 | # Remote bitrate estimator logging/plotting. |
| 65 | 'enable_bwe_test_logging%': 0, |
| 66 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 67 | # Adds video support to dependencies shared by voice and video engine. |
| 68 | # This should normally be enabled; the intended use is to disable only |
| 69 | # when building voice engine exclusively. |
| 70 | 'enable_video%': 1, |
| 71 | |
| 72 | # Selects fixed-point code where possible. |
| 73 | 'prefer_fixed_point%': 0, |
| 74 | |
| 75 | # Enable data logging. Produces text files with data logged within engines |
| 76 | # which can be easily parsed for offline processing. |
| 77 | 'enable_data_logging%': 0, |
| 78 | |
andrew@webrtc.org | f9825e5 | 2013-05-20 21:18:04 +0000 | [diff] [blame] | 79 | # Enables the use of protocol buffers for debug recordings. |
| 80 | 'enable_protobuf%': 1, |
| 81 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 82 | # Disable these to not build components which can be externally provided. |
| 83 | 'build_libjpeg%': 1, |
| 84 | 'build_libyuv%': 1, |
| 85 | 'build_libvpx%': 1, |
| 86 | |
tina.legrand@webrtc.org | 1f8c02a | 2012-10-25 12:37:08 +0000 | [diff] [blame] | 87 | # Enable to use the Mozilla internal settings. |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 88 | 'build_with_mozilla%': 0, |
| 89 | |
| 90 | 'libyuv_dir%': '<(DEPTH)/third_party/libyuv', |
| 91 | |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 92 | # Define MIPS architecture variant, MIPS DSP variant and MIPS FPU |
| 93 | # This may be subject to change in accordance to Chromium's MIPS flags |
| 94 | 'mips_arch_variant%': 'mips32r1', |
| 95 | 'mips_dsp_rev%': 0, |
| 96 | 'mips_fpu%' : 1, |
henrike@webrtc.org | 34c50c1 | 2013-09-27 22:34:35 +0000 | [diff] [blame] | 97 | 'enable_android_opensl%': 1, |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 98 | |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 99 | 'conditions': [ |
| 100 | ['build_with_chromium==1', { |
| 101 | # Exclude pulse audio on Chromium since its prerequisites don't require |
| 102 | # pulse audio. |
| 103 | 'include_pulse_audio%': 0, |
| 104 | |
| 105 | # Exclude internal ADM since Chromium uses its own IO handling. |
| 106 | 'include_internal_audio_device%': 0, |
| 107 | |
| 108 | # Exclude internal VCM in Chromium build. |
| 109 | 'include_internal_video_capture%': 0, |
| 110 | |
| 111 | # Exclude internal video render module in Chromium build. |
| 112 | 'include_internal_video_render%': 0, |
| 113 | |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 114 | # Include ndk cpu features in Chromium build. |
| 115 | 'include_ndk_cpu_features%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 116 | }, { # Settings for the standalone (not-in-Chromium) build. |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 117 | # TODO(andrew): For now, disable the Chrome plugins, which causes a |
| 118 | # flood of chromium-style warnings. Investigate enabling them: |
| 119 | # http://code.google.com/p/webrtc/issues/detail?id=163 |
| 120 | 'clang_use_chrome_plugins%': 0, |
| 121 | |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 122 | 'include_pulse_audio%': 1, |
| 123 | 'include_internal_audio_device%': 1, |
| 124 | 'include_internal_video_capture%': 1, |
| 125 | 'include_internal_video_render%': 1, |
| 126 | 'include_ndk_cpu_features%': 0, |
| 127 | }], |
| 128 | ['build_with_libjingle==1', { |
| 129 | 'include_tests%': 0, |
andrew@webrtc.org | f1a4817 | 2013-11-07 23:47:26 +0000 | [diff] [blame] | 130 | 'restrict_webrtc_logging%': 1, |
henrike@webrtc.org | 4258154 | 2013-07-16 16:37:22 +0000 | [diff] [blame] | 131 | }, { |
| 132 | 'include_tests%': 1, |
andrew@webrtc.org | f1a4817 | 2013-11-07 23:47:26 +0000 | [diff] [blame] | 133 | 'restrict_webrtc_logging%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 134 | }], |
| 135 | ['OS=="ios"', { |
fischman@webrtc.org | d0f4c21 | 2013-08-20 22:16:55 +0000 | [diff] [blame] | 136 | 'build_libjpeg%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 137 | 'enable_protobuf%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 138 | 'include_tests%': 0, |
| 139 | }], |
fischman@webrtc.org | 31b4a5a | 2013-09-05 16:46:36 +0000 | [diff] [blame] | 140 | ['target_arch=="arm" or target_arch=="armv7"', { |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 141 | 'prefer_fixed_point%': 1, |
| 142 | }], |
| 143 | ], # conditions |
| 144 | }, |
| 145 | 'target_defaults': { |
| 146 | 'include_dirs': [ |
kjellander@webrtc.org | e1888af | 2013-01-28 20:00:03 +0000 | [diff] [blame] | 147 | # Allow includes to be prefixed with webrtc/ in case it is not an |
| 148 | # immediate subdirectory of <(DEPTH). |
andrew@webrtc.org | be8ec38 | 2012-10-22 21:51:58 +0000 | [diff] [blame] | 149 | '../..', |
kjellander@webrtc.org | e1888af | 2013-01-28 20:00:03 +0000 | [diff] [blame] | 150 | # To include the top-level directory when building in Chrome, so we can |
| 151 | # use full paths (e.g. headers inside testing/ or third_party/). |
| 152 | '<(DEPTH)', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 153 | ], |
| 154 | 'defines': [ |
| 155 | # TODO(leozwang): Run this as a gclient hook rather than at build-time: |
| 156 | # http://code.google.com/p/webrtc/issues/detail?id=687 |
| 157 | 'WEBRTC_SVNREVISION="Unavailable(issue687)"', |
| 158 | #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"', |
| 159 | ], |
| 160 | 'conditions': [ |
andrew@webrtc.org | f1a4817 | 2013-11-07 23:47:26 +0000 | [diff] [blame] | 161 | ['restrict_webrtc_logging==1', { |
| 162 | 'defines': ['WEBRTC_RESTRICT_LOGGING',], |
andrew@webrtc.org | c3e5d34 | 2012-11-23 19:30:59 +0000 | [diff] [blame] | 163 | }], |
tina.legrand@webrtc.org | 1f8c02a | 2012-10-25 12:37:08 +0000 | [diff] [blame] | 164 | ['build_with_mozilla==1', { |
| 165 | 'defines': [ |
| 166 | # Changes settings for Mozilla build. |
| 167 | 'WEBRTC_MOZILLA_BUILD', |
| 168 | ], |
| 169 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 170 | ['build_with_chromium==1', { |
| 171 | 'defines': [ |
| 172 | # Changes settings for Chromium build. |
| 173 | 'WEBRTC_CHROMIUM_BUILD', |
| 174 | ], |
| 175 | }, { |
| 176 | 'conditions': [ |
| 177 | ['os_posix==1', { |
| 178 | 'cflags': [ |
| 179 | '-Wextra', |
| 180 | # We need to repeat some flags from Chromium's common.gypi here |
| 181 | # that get overridden by -Wextra. |
| 182 | '-Wno-unused-parameter', |
| 183 | '-Wno-missing-field-initializers', |
| 184 | ], |
| 185 | 'cflags_cc': [ |
pbos@webrtc.org | b3cc78d | 2013-11-21 11:42:02 +0000 | [diff] [blame^] | 186 | '-Wnon-virtual-dtor', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 187 | # This is enabled for clang; enable for gcc as well. |
| 188 | '-Woverloaded-virtual', |
| 189 | ], |
| 190 | }], |
| 191 | ], |
| 192 | }], |
fischman@webrtc.org | 31b4a5a | 2013-09-05 16:46:36 +0000 | [diff] [blame] | 193 | ['target_arch=="arm" or target_arch=="armv7"', { |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 194 | 'defines': [ |
| 195 | 'WEBRTC_ARCH_ARM', |
| 196 | ], |
| 197 | 'conditions': [ |
| 198 | ['armv7==1', { |
| 199 | 'defines': ['WEBRTC_ARCH_ARM_V7',], |
| 200 | 'conditions': [ |
| 201 | ['arm_neon==1', { |
| 202 | 'defines': ['WEBRTC_ARCH_ARM_NEON',], |
| 203 | }, { |
| 204 | 'defines': ['WEBRTC_DETECT_ARM_NEON',], |
| 205 | }], |
| 206 | ], |
| 207 | }], |
| 208 | ], |
| 209 | }], |
andrew@webrtc.org | 5140e24 | 2013-02-21 20:12:21 +0000 | [diff] [blame] | 210 | ['target_arch=="mipsel"', { |
| 211 | 'defines': [ |
| 212 | 'MIPS32_LE', |
| 213 | ], |
| 214 | 'conditions': [ |
| 215 | ['mips_fpu==1', { |
| 216 | 'defines': [ |
| 217 | 'MIPS_FPU_LE', |
| 218 | ], |
| 219 | 'cflags': [ |
| 220 | '-mhard-float', |
| 221 | ], |
| 222 | }, { |
| 223 | 'cflags': [ |
| 224 | '-msoft-float', |
| 225 | ], |
| 226 | }], |
| 227 | ['mips_arch_variant=="mips32r2"', { |
| 228 | 'defines': [ |
| 229 | 'MIPS32_R2_LE', |
| 230 | ], |
| 231 | 'cflags': [ |
| 232 | '-mips32r2', |
| 233 | ], |
| 234 | 'cflags_cc': [ |
| 235 | '-mips32r2', |
| 236 | ], |
| 237 | }], |
| 238 | ['mips_dsp_rev==1', { |
| 239 | 'defines': [ |
| 240 | 'MIPS_DSP_R1_LE', |
| 241 | ], |
| 242 | 'cflags': [ |
| 243 | '-mdsp', |
| 244 | ], |
| 245 | 'cflags_cc': [ |
| 246 | '-mdsp', |
| 247 | ], |
| 248 | }], |
| 249 | ['mips_dsp_rev==2', { |
| 250 | 'defines': [ |
| 251 | 'MIPS_DSP_R1_LE', |
| 252 | 'MIPS_DSP_R2_LE', |
| 253 | ], |
| 254 | 'cflags': [ |
| 255 | '-mdspr2', |
| 256 | ], |
| 257 | 'cflags_cc': [ |
| 258 | '-mdspr2', |
| 259 | ], |
| 260 | }], |
| 261 | ], |
| 262 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 263 | ['OS=="ios"', { |
| 264 | 'defines': [ |
| 265 | 'WEBRTC_MAC', |
| 266 | 'WEBRTC_IOS', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 267 | ], |
| 268 | }], |
| 269 | ['OS=="linux"', { |
| 270 | 'defines': [ |
| 271 | 'WEBRTC_LINUX', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 272 | ], |
| 273 | }], |
| 274 | ['OS=="mac"', { |
| 275 | 'defines': [ |
| 276 | 'WEBRTC_MAC', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 277 | ], |
| 278 | }], |
| 279 | ['OS=="win"', { |
| 280 | 'defines': [ |
| 281 | 'WEBRTC_WIN', |
| 282 | ], |
| 283 | # TODO(andrew): enable all warnings when possible. |
kjellander@webrtc.org | fa53d87 | 2013-02-04 10:07:17 +0000 | [diff] [blame] | 284 | # TODO(phoglund): get rid of 4373 supression when |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 285 | # 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] | 286 | 'msvs_disabled_warnings': [ |
| 287 | 4373, # legacy warning for ignoring const / volatile in signatures. |
| 288 | 4389, # Signed/unsigned mismatch. |
| 289 | ], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 290 | # Re-enable some warnings that Chromium disables. |
| 291 | 'msvs_disabled_warnings!': [4189,], |
| 292 | }], |
| 293 | ['OS=="android"', { |
| 294 | 'defines': [ |
| 295 | 'WEBRTC_LINUX', |
| 296 | 'WEBRTC_ANDROID', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 297 | ], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 298 | 'conditions': [ |
| 299 | ['enable_android_opensl==1', { |
| 300 | 'defines': [ |
| 301 | 'WEBRTC_ANDROID_OPENSLES', |
| 302 | ], |
| 303 | }], |
wjia@webrtc.org | b119369 | 2013-01-12 01:52:07 +0000 | [diff] [blame] | 304 | ['clang!=1', { |
| 305 | # The Android NDK doesn't provide optimized versions of these |
| 306 | # functions. Ensure they are disabled for all compilers. |
| 307 | 'cflags': [ |
| 308 | '-fno-builtin-cos', |
| 309 | '-fno-builtin-sin', |
| 310 | '-fno-builtin-cosf', |
| 311 | '-fno-builtin-sinf', |
| 312 | ], |
| 313 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 314 | ], |
| 315 | }], |
| 316 | ], # conditions |
sergeyu@chromium.org | 6ebfd34 | 2013-05-22 18:22:21 +0000 | [diff] [blame] | 317 | 'direct_dependent_settings': { |
| 318 | 'include_dirs': [ |
| 319 | '../..', |
| 320 | ], |
| 321 | 'conditions': [ |
| 322 | ['build_with_mozilla==1', { |
| 323 | 'defines': [ |
| 324 | # Changes settings for Mozilla build. |
| 325 | 'WEBRTC_MOZILLA_BUILD', |
| 326 | ], |
| 327 | }], |
| 328 | ['build_with_chromium==1', { |
| 329 | 'defines': [ |
| 330 | # Changes settings for Chromium build. |
| 331 | 'WEBRTC_CHROMIUM_BUILD', |
| 332 | ], |
| 333 | }], |
| 334 | ['OS=="mac"', { |
| 335 | 'defines': [ |
| 336 | 'WEBRTC_MAC', |
| 337 | ], |
| 338 | }], |
| 339 | ['OS=="ios"', { |
| 340 | 'defines': [ |
| 341 | 'WEBRTC_MAC', |
| 342 | 'WEBRTC_IOS', |
| 343 | ], |
| 344 | }], |
| 345 | ['OS=="win"', { |
| 346 | 'defines': [ |
| 347 | 'WEBRTC_WIN', |
| 348 | ], |
| 349 | }], |
| 350 | ['OS=="linux"', { |
| 351 | 'defines': [ |
| 352 | 'WEBRTC_LINUX', |
| 353 | ], |
| 354 | }], |
| 355 | ['OS=="android"', { |
| 356 | 'defines': [ |
| 357 | 'WEBRTC_LINUX', |
| 358 | 'WEBRTC_ANDROID', |
| 359 | ], |
| 360 | 'conditions': [ |
| 361 | ['enable_android_opensl==1', { |
| 362 | 'defines': [ |
| 363 | 'WEBRTC_ANDROID_OPENSLES', |
| 364 | ], |
| 365 | }] |
| 366 | ], |
| 367 | }], |
| 368 | ], |
| 369 | }, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 370 | }, # target_defaults |
| 371 | } |
| 372 | |