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