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