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': [ |
| 24 | ['build_with_chromium==1', { |
| 25 | 'webrtc_root%': '<(DEPTH)/third_party/webrtc', |
| 26 | }, { |
| 27 | 'webrtc_root%': '<(DEPTH)/webrtc', |
| 28 | }], |
| 29 | ], |
| 30 | }, |
| 31 | 'build_with_chromium%': '<(build_with_chromium)', |
| 32 | 'webrtc_root%': '<(webrtc_root)', |
| 33 | |
| 34 | 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8', |
leozwang@webrtc.org | 6f19b1b | 2012-10-27 17:46:55 +0000 | [diff] [blame] | 35 | 'include_opus%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 36 | }, |
| 37 | 'build_with_chromium%': '<(build_with_chromium)', |
| 38 | 'webrtc_root%': '<(webrtc_root)', |
| 39 | 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)', |
| 40 | 'include_opus%': '<(include_opus)', |
| 41 | |
| 42 | # The Chromium common.gypi we use treats all gyp files without |
| 43 | # chromium_code==1 as third party code. This disables many of the |
| 44 | # preferred warning settings. |
| 45 | # |
| 46 | # We can set this here to have WebRTC code treated as Chromium code. Our |
| 47 | # third party code will still have the reduced warning settings. |
| 48 | 'chromium_code': 1, |
| 49 | |
| 50 | # Adds video support to dependencies shared by voice and video engine. |
| 51 | # This should normally be enabled; the intended use is to disable only |
| 52 | # when building voice engine exclusively. |
| 53 | 'enable_video%': 1, |
| 54 | |
| 55 | # Selects fixed-point code where possible. |
| 56 | 'prefer_fixed_point%': 0, |
| 57 | |
| 58 | # Enable data logging. Produces text files with data logged within engines |
| 59 | # which can be easily parsed for offline processing. |
| 60 | 'enable_data_logging%': 0, |
| 61 | |
| 62 | # Disable these to not build components which can be externally provided. |
| 63 | 'build_libjpeg%': 1, |
| 64 | 'build_libyuv%': 1, |
| 65 | 'build_libvpx%': 1, |
| 66 | |
tina.legrand@webrtc.org | 1f8c02a | 2012-10-25 12:37:08 +0000 | [diff] [blame] | 67 | # Enable to use the Mozilla internal settings. |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 68 | 'build_with_mozilla%': 0, |
| 69 | |
| 70 | 'libyuv_dir%': '<(DEPTH)/third_party/libyuv', |
| 71 | |
| 72 | 'conditions': [ |
| 73 | ['build_with_chromium==1', { |
| 74 | # Exclude pulse audio on Chromium since its prerequisites don't require |
| 75 | # pulse audio. |
| 76 | 'include_pulse_audio%': 0, |
| 77 | |
| 78 | # Exclude internal ADM since Chromium uses its own IO handling. |
| 79 | 'include_internal_audio_device%': 0, |
| 80 | |
| 81 | # Exclude internal VCM in Chromium build. |
| 82 | 'include_internal_video_capture%': 0, |
| 83 | |
| 84 | # Exclude internal video render module in Chromium build. |
| 85 | 'include_internal_video_render%': 0, |
| 86 | |
| 87 | 'include_video_engine_file_api%': 0, |
| 88 | |
| 89 | 'include_tests%': 0, |
| 90 | |
| 91 | # Disable the use of protocol buffers in production code. |
| 92 | 'enable_protobuf%': 0, |
| 93 | |
andrew@webrtc.org | 50419b0 | 2012-11-14 19:07:54 +0000 | [diff] [blame] | 94 | 'enable_tracing%': 0, |
| 95 | |
wjia@webrtc.org | 5c38d90 | 2012-11-19 01:41:59 +0000 | [diff] [blame] | 96 | 'enable_android_opensl%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 97 | }, { # Settings for the standalone (not-in-Chromium) build. |
| 98 | 'include_pulse_audio%': 1, |
| 99 | 'include_internal_audio_device%': 1, |
| 100 | 'include_internal_video_capture%': 1, |
| 101 | 'include_internal_video_render%': 1, |
| 102 | 'include_video_engine_file_api%': 1, |
| 103 | 'enable_protobuf%': 1, |
andrew@webrtc.org | 50419b0 | 2012-11-14 19:07:54 +0000 | [diff] [blame] | 104 | 'enable_tracing%': 1, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 105 | 'include_tests%': 1, |
| 106 | |
| 107 | # TODO(andrew): For now, disable the Chrome plugins, which causes a |
| 108 | # flood of chromium-style warnings. Investigate enabling them: |
| 109 | # http://code.google.com/p/webrtc/issues/detail?id=163 |
| 110 | 'clang_use_chrome_plugins%': 0, |
| 111 | |
| 112 | # Switch between Android audio device OpenSL ES implementation |
| 113 | # and Java Implementation |
leozwang@webrtc.org | 56a1c2c | 2012-11-29 03:13:00 +0000 | [diff] [blame] | 114 | 'enable_android_opensl%': 0, |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 115 | }], |
| 116 | ['OS=="ios"', { |
| 117 | 'enable_video%': 0, |
| 118 | 'enable_protobuf%': 0, |
| 119 | 'build_libjpeg%': 0, |
| 120 | 'build_libyuv%': 0, |
| 121 | 'build_libvpx%': 0, |
| 122 | 'include_tests%': 0, |
| 123 | }], |
| 124 | ['target_arch=="arm"', { |
| 125 | 'prefer_fixed_point%': 1, |
| 126 | }], |
| 127 | ], # conditions |
| 128 | }, |
| 129 | 'target_defaults': { |
| 130 | 'include_dirs': [ |
andrew@webrtc.org | be8ec38 | 2012-10-22 21:51:58 +0000 | [diff] [blame] | 131 | # TODO(andrew): Remove '..' when we've added webrtc/ to include paths. |
| 132 | '..', |
| 133 | '../..', |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 134 | ], |
| 135 | 'defines': [ |
| 136 | # TODO(leozwang): Run this as a gclient hook rather than at build-time: |
| 137 | # http://code.google.com/p/webrtc/issues/detail?id=687 |
| 138 | 'WEBRTC_SVNREVISION="Unavailable(issue687)"', |
| 139 | #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"', |
| 140 | ], |
| 141 | 'conditions': [ |
andrew@webrtc.org | c3e5d34 | 2012-11-23 19:30:59 +0000 | [diff] [blame] | 142 | ['enable_tracing==1', { |
| 143 | 'defines': ['WEBRTC_LOGGING',], |
| 144 | }], |
tina.legrand@webrtc.org | 1f8c02a | 2012-10-25 12:37:08 +0000 | [diff] [blame] | 145 | ['build_with_mozilla==1', { |
| 146 | 'defines': [ |
| 147 | # Changes settings for Mozilla build. |
| 148 | 'WEBRTC_MOZILLA_BUILD', |
| 149 | ], |
| 150 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 151 | ['build_with_chromium==1', { |
| 152 | 'defines': [ |
| 153 | # Changes settings for Chromium build. |
| 154 | 'WEBRTC_CHROMIUM_BUILD', |
| 155 | ], |
| 156 | }, { |
| 157 | 'conditions': [ |
| 158 | ['os_posix==1', { |
| 159 | 'cflags': [ |
| 160 | '-Wextra', |
| 161 | # We need to repeat some flags from Chromium's common.gypi here |
| 162 | # that get overridden by -Wextra. |
| 163 | '-Wno-unused-parameter', |
| 164 | '-Wno-missing-field-initializers', |
| 165 | ], |
| 166 | 'cflags_cc': [ |
| 167 | # This is enabled for clang; enable for gcc as well. |
| 168 | '-Woverloaded-virtual', |
| 169 | ], |
| 170 | }], |
| 171 | ], |
| 172 | }], |
| 173 | ['target_arch=="arm"', { |
| 174 | 'defines': [ |
| 175 | 'WEBRTC_ARCH_ARM', |
| 176 | ], |
| 177 | 'conditions': [ |
| 178 | ['armv7==1', { |
| 179 | 'defines': ['WEBRTC_ARCH_ARM_V7',], |
| 180 | 'conditions': [ |
| 181 | ['arm_neon==1', { |
| 182 | 'defines': ['WEBRTC_ARCH_ARM_NEON',], |
| 183 | }, { |
| 184 | 'defines': ['WEBRTC_DETECT_ARM_NEON',], |
| 185 | }], |
| 186 | ], |
| 187 | }], |
| 188 | ], |
| 189 | }], |
| 190 | ['OS=="ios"', { |
| 191 | 'defines': [ |
| 192 | 'WEBRTC_MAC', |
| 193 | 'WEBRTC_IOS', |
| 194 | 'WEBRTC_THREAD_RR', |
| 195 | 'WEBRTC_CLOCK_TYPE_REALTIME', |
| 196 | ], |
| 197 | }], |
| 198 | ['OS=="linux"', { |
| 199 | 'defines': [ |
| 200 | 'WEBRTC_LINUX', |
| 201 | 'WEBRTC_THREAD_RR', |
| 202 | # TODO(andrew): can we select this automatically? |
| 203 | # Define this if the Linux system does not support CLOCK_MONOTONIC. |
| 204 | #'WEBRTC_CLOCK_TYPE_REALTIME', |
| 205 | ], |
| 206 | }], |
| 207 | ['OS=="mac"', { |
| 208 | 'defines': [ |
| 209 | 'WEBRTC_MAC', |
| 210 | 'WEBRTC_THREAD_RR', |
| 211 | 'WEBRTC_CLOCK_TYPE_REALTIME', |
| 212 | ], |
| 213 | }], |
| 214 | ['OS=="win"', { |
| 215 | 'defines': [ |
| 216 | 'WEBRTC_WIN', |
| 217 | ], |
| 218 | # TODO(andrew): enable all warnings when possible. |
| 219 | # 4389: Signed/unsigned mismatch. |
| 220 | # 4373: MSVC legacy warning for ignoring const / volatile in |
| 221 | # signatures. TODO(phoglund): get rid of 4373 supression when |
| 222 | # http://code.google.com/p/webrtc/issues/detail?id=261 is solved. |
| 223 | 'msvs_disabled_warnings': [4389, 4373], |
| 224 | |
| 225 | # Re-enable some warnings that Chromium disables. |
| 226 | 'msvs_disabled_warnings!': [4189,], |
| 227 | }], |
| 228 | ['OS=="android"', { |
| 229 | 'defines': [ |
| 230 | 'WEBRTC_LINUX', |
| 231 | 'WEBRTC_ANDROID', |
| 232 | # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC |
| 233 | # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now, |
| 234 | # remove it after I verify that CLOCK_MONOTONIC is fully functional |
| 235 | # with condition and event functions in system_wrappers. |
| 236 | 'WEBRTC_CLOCK_TYPE_REALTIME', |
| 237 | 'WEBRTC_THREAD_RR', |
| 238 | ], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 239 | 'conditions': [ |
| 240 | ['enable_android_opensl==1', { |
| 241 | 'defines': [ |
| 242 | 'WEBRTC_ANDROID_OPENSLES', |
| 243 | ], |
| 244 | }], |
wjia@webrtc.org | b119369 | 2013-01-12 01:52:07 +0000 | [diff] [blame^] | 245 | ['clang!=1', { |
| 246 | # The Android NDK doesn't provide optimized versions of these |
| 247 | # functions. Ensure they are disabled for all compilers. |
| 248 | 'cflags': [ |
| 249 | '-fno-builtin-cos', |
| 250 | '-fno-builtin-sin', |
| 251 | '-fno-builtin-cosf', |
| 252 | '-fno-builtin-sinf', |
| 253 | ], |
| 254 | }], |
andrew@webrtc.org | 14b43be | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 255 | ], |
| 256 | }], |
| 257 | ], # conditions |
| 258 | }, # target_defaults |
| 259 | } |
| 260 | |