blob: f340c1882a33f13f1d51506f84077ecbea5002d0 [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,
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000020 'build_with_libjingle%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000021 },
22 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000023 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000024
25 'conditions': [
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000026 ['build_with_chromium==1 or build_with_libjingle==1', {
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000027 'webrtc_root%': '<(DEPTH)/third_party/webrtc',
28 }, {
29 'webrtc_root%': '<(DEPTH)/webrtc',
30 }],
31 ],
32 },
33 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000034 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000035 'webrtc_root%': '<(webrtc_root)',
36
37 'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
leozwang@webrtc.org6f19b1b2012-10-27 17:46:55 +000038 'include_opus%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000039 },
40 'build_with_chromium%': '<(build_with_chromium)',
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +000041 'build_with_libjingle%': '<(build_with_libjingle)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000042 'webrtc_root%': '<(webrtc_root)',
43 'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
44 'include_opus%': '<(include_opus)',
45
46 # The Chromium common.gypi we use treats all gyp files without
47 # chromium_code==1 as third party code. This disables many of the
48 # preferred warning settings.
49 #
50 # We can set this here to have WebRTC code treated as Chromium code. Our
51 # third party code will still have the reduced warning settings.
52 'chromium_code': 1,
53
54 # Adds video support to dependencies shared by voice and video engine.
55 # This should normally be enabled; the intended use is to disable only
56 # when building voice engine exclusively.
57 'enable_video%': 1,
58
59 # Selects fixed-point code where possible.
60 'prefer_fixed_point%': 0,
61
62 # Enable data logging. Produces text files with data logged within engines
63 # which can be easily parsed for offline processing.
64 'enable_data_logging%': 0,
65
66 # Disable these to not build components which can be externally provided.
67 'build_libjpeg%': 1,
68 'build_libyuv%': 1,
69 'build_libvpx%': 1,
70
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +000071 # Enable to use the Mozilla internal settings.
andrew@webrtc.org14b43be2012-10-22 18:19:23 +000072 'build_with_mozilla%': 0,
73
74 'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
75
76 'conditions': [
77 ['build_with_chromium==1', {
78 # Exclude pulse audio on Chromium since its prerequisites don't require
79 # pulse audio.
80 'include_pulse_audio%': 0,
81
82 # Exclude internal ADM since Chromium uses its own IO handling.
83 'include_internal_audio_device%': 0,
84
85 # Exclude internal VCM in Chromium build.
86 'include_internal_video_capture%': 0,
87
88 # Exclude internal video render module in Chromium build.
89 'include_internal_video_render%': 0,
90
91 'include_video_engine_file_api%': 0,
92
93 'include_tests%': 0,
94
95 # Disable the use of protocol buffers in production code.
96 'enable_protobuf%': 0,
97
andrew@webrtc.org50419b02012-11-14 19:07:54 +000098 'enable_tracing%': 0,
99
wjia@webrtc.org5c38d902012-11-19 01:41:59 +0000100 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000101 }, { # Settings for the standalone (not-in-Chromium) build.
102 'include_pulse_audio%': 1,
103 'include_internal_audio_device%': 1,
104 'include_internal_video_capture%': 1,
105 'include_internal_video_render%': 1,
106 'include_video_engine_file_api%': 1,
107 'enable_protobuf%': 1,
andrew@webrtc.org50419b02012-11-14 19:07:54 +0000108 'enable_tracing%': 1,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000109 '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
leozwang@webrtc.org56a1c2c2012-11-29 03:13:00 +0000118 'enable_android_opensl%': 0,
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000119 }],
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 }],
fischman@webrtc.orgf61e02c2013-02-20 23:13:46 +0000128 ['build_with_libjingle==1', {
129 'include_tests%': 0,
130 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000131 ['target_arch=="arm"', {
132 'prefer_fixed_point%': 1,
133 }],
134 ], # conditions
135 },
136 'target_defaults': {
137 'include_dirs': [
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000138 # TODO(andrew): Remove '..' when we've added webrtc/ to include paths.
139 '..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000140 # Allow includes to be prefixed with webrtc/ in case it is not an
141 # immediate subdirectory of <(DEPTH).
andrew@webrtc.orgbe8ec382012-10-22 21:51:58 +0000142 '../..',
kjellander@webrtc.orge1888af2013-01-28 20:00:03 +0000143 # To include the top-level directory when building in Chrome, so we can
144 # use full paths (e.g. headers inside testing/ or third_party/).
145 '<(DEPTH)',
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000146 ],
147 'defines': [
148 # TODO(leozwang): Run this as a gclient hook rather than at build-time:
149 # http://code.google.com/p/webrtc/issues/detail?id=687
150 'WEBRTC_SVNREVISION="Unavailable(issue687)"',
151 #'WEBRTC_SVNREVISION="<!(python <(webrtc_root)/build/version.py)"',
152 ],
153 'conditions': [
andrew@webrtc.orgc3e5d342012-11-23 19:30:59 +0000154 ['enable_tracing==1', {
155 'defines': ['WEBRTC_LOGGING',],
156 }],
tina.legrand@webrtc.org1f8c02a2012-10-25 12:37:08 +0000157 ['build_with_mozilla==1', {
158 'defines': [
159 # Changes settings for Mozilla build.
160 'WEBRTC_MOZILLA_BUILD',
161 ],
162 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000163 ['build_with_chromium==1', {
164 'defines': [
165 # Changes settings for Chromium build.
166 'WEBRTC_CHROMIUM_BUILD',
167 ],
168 }, {
169 'conditions': [
170 ['os_posix==1', {
171 'cflags': [
172 '-Wextra',
173 # We need to repeat some flags from Chromium's common.gypi here
174 # that get overridden by -Wextra.
175 '-Wno-unused-parameter',
176 '-Wno-missing-field-initializers',
177 ],
178 'cflags_cc': [
179 # This is enabled for clang; enable for gcc as well.
180 '-Woverloaded-virtual',
181 ],
182 }],
183 ],
184 }],
185 ['target_arch=="arm"', {
186 'defines': [
187 'WEBRTC_ARCH_ARM',
188 ],
189 'conditions': [
190 ['armv7==1', {
191 'defines': ['WEBRTC_ARCH_ARM_V7',],
192 'conditions': [
193 ['arm_neon==1', {
194 'defines': ['WEBRTC_ARCH_ARM_NEON',],
195 }, {
196 'defines': ['WEBRTC_DETECT_ARM_NEON',],
197 }],
198 ],
199 }],
200 ],
201 }],
202 ['OS=="ios"', {
203 'defines': [
204 'WEBRTC_MAC',
205 'WEBRTC_IOS',
206 'WEBRTC_THREAD_RR',
207 'WEBRTC_CLOCK_TYPE_REALTIME',
208 ],
209 }],
210 ['OS=="linux"', {
211 'defines': [
212 'WEBRTC_LINUX',
213 'WEBRTC_THREAD_RR',
214 # TODO(andrew): can we select this automatically?
215 # Define this if the Linux system does not support CLOCK_MONOTONIC.
216 #'WEBRTC_CLOCK_TYPE_REALTIME',
217 ],
218 }],
219 ['OS=="mac"', {
220 'defines': [
221 'WEBRTC_MAC',
222 'WEBRTC_THREAD_RR',
223 'WEBRTC_CLOCK_TYPE_REALTIME',
224 ],
225 }],
226 ['OS=="win"', {
227 'defines': [
228 'WEBRTC_WIN',
229 ],
230 # TODO(andrew): enable all warnings when possible.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000231 # TODO(phoglund): get rid of 4373 supression when
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000232 # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
kjellander@webrtc.orgfa53d872013-02-04 10:07:17 +0000233 'msvs_disabled_warnings': [
234 4373, # legacy warning for ignoring const / volatile in signatures.
235 4389, # Signed/unsigned mismatch.
236 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000237 # Re-enable some warnings that Chromium disables.
238 'msvs_disabled_warnings!': [4189,],
239 }],
240 ['OS=="android"', {
241 'defines': [
242 'WEBRTC_LINUX',
243 'WEBRTC_ANDROID',
244 # TODO(leozwang): Investigate CLOCK_REALTIME and CLOCK_MONOTONIC
245 # support on Android. Keep WEBRTC_CLOCK_TYPE_REALTIME for now,
246 # remove it after I verify that CLOCK_MONOTONIC is fully functional
247 # with condition and event functions in system_wrappers.
248 'WEBRTC_CLOCK_TYPE_REALTIME',
249 'WEBRTC_THREAD_RR',
250 ],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000251 'conditions': [
252 ['enable_android_opensl==1', {
253 'defines': [
254 'WEBRTC_ANDROID_OPENSLES',
255 ],
256 }],
wjia@webrtc.orgb1193692013-01-12 01:52:07 +0000257 ['clang!=1', {
258 # The Android NDK doesn't provide optimized versions of these
259 # functions. Ensure they are disabled for all compilers.
260 'cflags': [
261 '-fno-builtin-cos',
262 '-fno-builtin-sin',
263 '-fno-builtin-cosf',
264 '-fno-builtin-sinf',
265 ],
266 }],
andrew@webrtc.org14b43be2012-10-22 18:19:23 +0000267 ],
268 }],
269 ], # conditions
270 }, # target_defaults
271}
272