blob: 0921906d4ba033952354d85c4513f2fda04d8024 [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',
leozwang@webrtc.org6f19b1b2012-10-27 17:46:55 +000035 'include_opus%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000036 },
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.org1f8c02a2012-10-25 12:37:08 +000067 # Enable to use the Mozilla internal settings.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000068 '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.org50419b02012-11-14 19:07:54 +000094 'enable_tracing%': 0,
95
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000096 }, { # Settings for the standalone (not-in-Chromium) build.
97 'include_pulse_audio%': 1,
98 'include_internal_audio_device%': 1,
99 'include_internal_video_capture%': 1,
100 'include_internal_video_render%': 1,
101 'include_video_engine_file_api%': 1,
102 'enable_protobuf%': 1,
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000103 'enable_tracing%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000104 'include_tests%': 1,
105
106 # TODO(andrew): For now, disable the Chrome plugins, which causes a
107 # flood of chromium-style warnings. Investigate enabling them:
108 # http://code.google.com/p/webrtc/issues/detail?id=163
109 'clang_use_chrome_plugins%': 0,
110
111 # Switch between Android audio device OpenSL ES implementation
112 # and Java Implementation
113 'enable_android_opensl%': 1,
114 }],
115 ['OS=="ios"', {
116 'enable_video%': 0,
117 'enable_protobuf%': 0,
118 'build_libjpeg%': 0,
119 'build_libyuv%': 0,
120 'build_libvpx%': 0,
121 'include_tests%': 0,
122 }],
123 ['target_arch=="arm"', {
124 'prefer_fixed_point%': 1,
125 }],
126 ], # conditions
127 },
128 'target_defaults': {
129 'include_dirs': [
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000130 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
131 '..',
132 '../..',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000133 ],
134 'defines': [
135 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
136 # http://code.google.com/p/webrtc/issues/detail?id=687
137 'WEBRTC_SVNREVISION="Unavailable(issue687)"',
138 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
139 ],
140 'conditions': [
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000141 ['build_with_mozilla==1', {
142 'defines': [
143 # Changes settings for Mozilla build.
144 'WEBRTC_MOZILLA_BUILD',
145 ],
146 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000147 ['build_with_chromium==1', {
148 'defines': [
149 # Changes settings for Chromium build.
150 'WEBRTC_CHROMIUM_BUILD',
151 ],
152 }, {
153 'conditions': [
154 ['os_posix==1', {
155 'cflags': [
156 '-Wextra',
157 # We need to repeat some flags from Chromium's common.gypi here
158 # that get overridden by -Wextra.
159 '-Wno-unused-parameter',
160 '-Wno-missing-field-initializers',
161 ],
162 'cflags_cc': [
163 # This is enabled for clang; enable for gcc as well.
164 '-Woverloaded-virtual',
165 ],
166 }],
167 ],
168 }],
169 ['target_arch=="arm"', {
170 'defines': [
171 'WEBRTC_ARCH_ARM',
172 ],
173 'conditions': [
174 ['armv7==1', {
175 'defines': ['WEBRTC_ARCH_ARM_V7',],
176 'conditions': [
177 ['arm_neon==1', {
178 'defines': ['WEBRTC_ARCH_ARM_NEON',],
179 }, {
180 'defines': ['WEBRTC_DETECT_ARM_NEON',],
181 }],
182 ],
183 }],
184 ],
185 }],
186 ['OS=="ios"', {
187 'defines': [
188 'WEBRTC_MAC',
189 'WEBRTC_IOS',
190 'WEBRTC_THREAD_RR',
191 'WEBRTC_CLOCK_TYPE_REALTIME',
192 ],
193 }],
194 ['OS=="linux"', {
195 'defines': [
196 'WEBRTC_LINUX',
197 'WEBRTC_THREAD_RR',
198 # TODO(andrew): can we select this automatically?
199 # Define this if the Linux system does not support CLOCK_MONOTONIC.
200 #'WEBRTC_CLOCK_TYPE_REALTIME',
201 ],
202 }],
203 ['OS=="mac"', {
204 'defines': [
205 'WEBRTC_MAC',
206 'WEBRTC_THREAD_RR',
207 'WEBRTC_CLOCK_TYPE_REALTIME',
208 ],
209 }],
210 ['OS=="win"', {
211 'defines': [
212 'WEBRTC_WIN',
213 ],
214 # TODO(andrew): enable all warnings when possible.
215 # 4389: Signed/unsigned mismatch.
216 # 4373: MSVC legacy warning for ignoring const / volatile in
217 # signatures. TODO(phoglund): get rid of 4373 supression when
218 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
219 'msvs_disabled_warnings': [4389, 4373],
220
221 # Re-enable some warnings that Chromium disables.
222 'msvs_disabled_warnings!': [4189,],
223 }],
224 ['OS=="android"', {
225 'defines': [
226 'WEBRTC_LINUX',
227 'WEBRTC_ANDROID',
228 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
229 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
230 # remove it after I verify that CLOCK_MONOTONIC is fully functional
231 # with condition and event functions in system_wrappers.
232 'WEBRTC_CLOCK_TYPE_REALTIME',
233 'WEBRTC_THREAD_RR',
234 ],
235 'conditions': [
236 ['enable_android_opensl==1', {
237 'defines': [
238 'WEBRTC_ANDROID_OPENSLES',
239 ],
240 }],
241 ],
242 }],
243 ], # conditions
244 }, # target_defaults
245}
246