blob: 7b3b8471debb515b6c22ea2e303c09f3498dd062 [file] [log] [blame]
[email protected]225c8f52010-02-05 22:23:201# Copyright (c) 2010 The Chromium Authors. All rights reserved.
[email protected]2f80c312009-02-25 21:26:552# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
[email protected]21642ab2009-09-15 23:52:145# IMPORTANT:
6# Please don't directly include this file if you are building via gyp_chromium,
7# since gyp_chromium is automatically forcing its inclusion.
[email protected]2f80c312009-02-25 21:26:558{
9 'variables': {
[email protected]a6e22132010-02-10 20:43:1810 # .gyp files or targets should set chromium_code to 1 if they build
11 # Chromium-specific code, as opposed to external code. This variable is
12 # used to control such things as the set of warnings to enable, and
13 # whether warnings are treated as errors.
[email protected]2f80c312009-02-25 21:26:5514 'chromium_code%': 0,
[email protected]b3fb8092009-03-12 19:09:2415
16 # Variables expected to be overriden on the GYP command line (-D) or by
17 # ~/.gyp/include.gypi.
18
[email protected]e14a9f92009-08-05 19:26:0719 # Putting a variables dict inside another variables dict looks kind of
20 # weird. This is done so that "branding" and "buildtype" are defined as
21 # variables within the outer variables dict here. This is necessary
22 # to get these variables defined for the conditions within this variables
23 # dict that operate on these variables.
24 'variables': {
25 # Override branding to select the desired branding flavor.
26 'branding%': 'Chromium',
27
28 # Override buildtype to select the desired build flavor.
29 # Dev - everyday build for development/testing
30 # Official - release build (generally implies additional processing)
31 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
32 # conversion is done), some of the things which are now controlled by
33 # 'branding', such as symbol generation, will need to be refactored based
34 # on 'buildtype' (i.e. we don't care about saving symbols for non-Official
35 # builds).
36 'buildtype%': 'Dev',
[email protected]cbd5fd52009-08-26 00:14:2737
[email protected]cf185b32010-01-12 04:29:5938 'variables': {
39 # Compute the architecture that we're building on.
40 'conditions': [
[email protected]65df0582010-01-23 02:37:5641 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
[email protected]cf185b32010-01-12 04:29:5942 # This handles the Linux platforms we generally deal with. Anything
43 # else gets passed through, which probably won't work very well; such
44 # hosts should pass an explicit target_arch to gyp.
45 'host_arch%':
46 '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
47 }, { # OS!="linux"
48 'host_arch%': 'ia32',
49 }],
50 ],
[email protected]b3f23ba2010-04-26 22:58:1751
52 # Whether we're building a ChromeOS build. We set the initial
53 # value at this level of nesting so it's available for the
54 # toolkit_views test below.
55 'chromeos%': '0',
[email protected]cf185b32010-01-12 04:29:5956 },
[email protected]b3f23ba2010-04-26 22:58:1757
58 # Set default value of toolkit_views on for Windows and Chrome OS.
59 # We set it at this level of nesting so the value is available for
60 # other conditionals below.
61 'conditions': [
62 ['OS=="win" or chromeos==1', {
63 'toolkit_views%': 1,
64 }, {
65 'toolkit_views%': 0,
66 }],
67 ],
68
[email protected]cf185b32010-01-12 04:29:5969 'host_arch%': '<(host_arch)',
70
71 # Default architecture we're building for is the architecture we're
72 # building on.
73 'target_arch%': '<(host_arch)',
[email protected]e0d00142009-09-18 22:10:2774
[email protected]cbd5fd52009-08-26 00:14:2775 # We do want to build Chromium with Breakpad support in certain
76 # situations. I.e. for Chrome bot.
77 'linux_chromium_breakpad%': 0,
[email protected]4c9cc6c2009-10-01 18:54:5778 # And if we want to dump symbols.
[email protected]05cb6962009-10-01 23:29:0379 'linux_chromium_dump_symbols%': 0,
80 # Also see linux_strip_binary below.
[email protected]c153e5352009-09-22 12:37:4481
[email protected]b3f23ba2010-04-26 22:58:1782 # Copy conditionally-set chromeos variable out one scope.
83 'chromeos%': '<(chromeos)',
[email protected]b2f030c2009-09-24 20:36:2184
85 # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
86 # are built under a chromium full build (1) or a webkit.org chromium
87 # build (0).
88 'inside_chromium_build%': 1,
[email protected]9c1949e2009-10-02 19:59:5489
90 # Set to 1 to enable fast builds. It disables debug info for fastest
91 # compilation.
92 'fastbuild%': 0,
[email protected]84352455e72010-02-03 17:02:2793
94 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
95 # libraries on linux x86-64 and arm.
96 'linux_fpic%': 0,
[email protected]eafc0b452010-02-26 21:53:4397
[email protected]a76fe1a2010-03-01 23:39:3698 # Python version.
99 'python_ver%': '2.5',
100
[email protected]eafc0b452010-02-26 21:53:43101 # Set ARM-v7 compilation flags
102 'armv7%': 0,
103
104 # Set Neon compilation flags (only meaningful if armv7==1).
105 'arm_neon%': 1,
[email protected]4d83eb72010-03-04 16:42:23106
107 # The system root for cross-compiles. Default: none.
108 'sysroot%': '',
[email protected]ac120ff2010-04-28 02:14:22109
110 # On Linux, we build with sse2 for Chromium builds.
111 'disable_sse2%': 0,
[email protected]e14a9f92009-08-05 19:26:07112 },
113
114 # Define branding and buildtype on the basis of their settings within the
115 # variables sub-dict above, unless overridden.
116 'branding%': '<(branding)',
117 'buildtype%': '<(buildtype)',
[email protected]e0d00142009-09-18 22:10:27118 'target_arch%': '<(target_arch)',
[email protected]cf185b32010-01-12 04:29:59119 'host_arch%': '<(host_arch)',
[email protected]c153e5352009-09-22 12:37:44120 'toolkit_views%': '<(toolkit_views)',
121 'chromeos%': '<(chromeos)',
[email protected]b2f030c2009-09-24 20:36:21122 'inside_chromium_build%': '<(inside_chromium_build)',
[email protected]9c1949e2009-10-02 19:59:54123 'fastbuild%': '<(fastbuild)',
[email protected]84352455e72010-02-03 17:02:27124 'linux_fpic%': '<(linux_fpic)',
[email protected]a76fe1a2010-03-01 23:39:36125 'python_ver%': '<(python_ver)',
[email protected]eafc0b452010-02-26 21:53:43126 'armv7%': '<(armv7)',
127 'arm_neon%': '<(arm_neon)',
[email protected]4d83eb72010-03-04 16:42:23128 'sysroot%': '<(sysroot)',
[email protected]ac120ff2010-04-28 02:14:22129 'disable_sse2%': '<(disable_sse2)',
[email protected]e14a9f92009-08-05 19:26:07130
[email protected]caa95c82009-11-23 22:39:32131 # The release channel that this build targets. This is used to restrict
132 # channel-specific build options, like which installer packages to create.
133 # The default is 'all', which does no channel-specific filtering.
134 'channel%': 'all',
135
[email protected]b3fb8092009-03-12 19:09:24136 # Override chromium_mac_pch and set it to 0 to suppress the use of
137 # precompiled headers on the Mac. Prefix header injection may still be
138 # used, but prefix headers will not be precompiled. This is useful when
139 # using distcc to distribute a build to compile slaves that don't
140 # share the same compiler executable as the system driving the compilation,
141 # because precompiled headers rely on pointers into a specific compiler
142 # executable's image. Setting this to 0 is needed to use an experimental
143 # Linux-Mac cross compiler distcc farm.
144 'chromium_mac_pch%': 1,
145
[email protected]3224dcd2009-09-16 17:31:25146 # Mac OS X SDK and deployment target support.
147 # The SDK identifies the version of the system headers that will be used,
148 # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
149 # "Maximum allowed" refers to the operating system version whose APIs are
150 # available in the headers.
151 # The deployment target identifies the minimum system version that the
152 # built products are expected to function on. It corresponds to the
153 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
154 # To ensure these macros are available, #include <AvailabilityMacros.h>.
155 # Additional documentation on these macros is available at
156 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
157 # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
158 # deployment target to 10.5. Other projects, such as O3D, may override
159 # these defaults.
160 'mac_sdk%': '10.5',
161 'mac_deployment_target%': '10.5',
[email protected]9543af052009-09-15 22:42:59162
[email protected]f5ecbba12009-04-03 04:35:18163 # Set to 1 to enable code coverage. In addition to build changes
164 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
165 # project file called "coverage".
166 # Currently ignored on Windows.
167 'coverage%': 0,
[email protected]653bd5f032009-04-08 12:55:49168
[email protected]c61f6432009-04-22 01:16:42169 # Overridable specification for potential use of alternative
170 # JavaScript engines.
171 'javascript_engine%': 'v8',
172
[email protected]7477ea6f2009-12-22 23:28:15173 # Although base/allocator lets you select a heap library via an
[email protected]7e0d664a2009-12-03 21:07:47174 # environment variable, the libcmt shim it uses sometimes gets in
175 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
176 # 'win_use_allocator_shim': 0,
177 # 'win_release_RuntimeLibrary': 2
178 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
179 'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
180
[email protected]653bd5f032009-04-08 12:55:49181 # To do a shared build on linux we need to be able to choose between type
182 # static_library and shared_library. We default to doing a static build
183 # but you can override this with "gyp -Dlibrary=shared_library" or you
184 # can add the following line (without the #) to ~/.gyp/include.gypi
185 # {'variables': {'library': 'shared_library'}}
186 # to compile as shared by default
187 'library%': 'static_library',
[email protected]279cd4212009-09-11 22:32:11188
[email protected]95ff8082009-11-13 22:21:01189 # Whether usage of OpenMAX is enabled.
190 'enable_openmax%': 0,
191
[email protected]e5b2eaa2009-04-14 01:39:12192 # TODO(bradnelson): eliminate this when possible.
193 # To allow local gyp files to prevent release.vsprops from being included.
194 # Yes(1) means include release.vsprops.
195 # Once all vsprops settings are migrated into gyp, this can go away.
196 'msvs_use_common_release%': 1,
[email protected]606116d22009-05-06 22:38:23197
[email protected]cbd5fd52009-08-26 00:14:27198 # TODO(bradnelson): eliminate this when possible.
199 # To allow local gyp files to override additional linker options for msvs.
200 # Yes(1) means set use the common linker options.
[email protected]48c7af72009-07-03 22:00:19201 'msvs_use_common_linker_extras%': 1,
202
[email protected]1ffb6502009-06-02 07:46:24203 # TODO(sgk): eliminate this if possible.
204 # It would be nicer to support this via a setting in 'target_defaults'
205 # in chrome/app/locales/locales.gypi overriding the setting in the
206 # 'Debug' configuration in the 'target_defaults' dict below,
207 # but that doesn't work as we'd like.
208 'msvs_debug_link_incremental%': '2',
209
[email protected]573136142009-07-15 22:48:37210 # This is the location of the sandbox binary. Chrome looks for this before
211 # running the zygote process. If found, and SUID, it will be used to
212 # sandbox the zygote process and, thus, all renderer processes.
213 'linux_sandbox_path%': '',
214
[email protected]ad6d2c42009-09-15 20:13:38215 # Set this to true to enable SELinux support.
216 'selinux%': 0,
[email protected]4c9cc6c2009-10-01 18:54:57217
[email protected]05cb6962009-10-01 23:29:03218 # Strip the binary after dumping symbols.
219 'linux_strip_binary%': 0,
220
[email protected]01699e22009-11-11 19:24:24221 # Enable TCMalloc.
[email protected]abc00712010-04-21 19:19:45222 'linux_use_tcmalloc%': 1,
[email protected]01699e22009-11-11 19:24:24223
[email protected]39ca7de2010-04-16 08:04:03224 # Disable TCMalloc's debugallocation.
225 'linux_use_debugallocation%': 0,
226
[email protected]d8b60602010-03-26 09:41:22227 # Disable TCMalloc's heapchecker.
228 'linux_use_heapchecker%': 0,
229
[email protected]cc2d7cd2010-03-30 22:46:21230 # Set to 1 to turn on seccomp sandbox by default.
231 # (Note: this is ignored for official builds.)
232 'linux_use_seccomp_sandbox%': 0,
[email protected]39c4e1a82010-03-30 19:47:41233
[email protected]c153e5352009-09-22 12:37:44234 # Set to select the Title Case versions of strings in GRD files.
235 'use_titlecase_in_grd_files%': 0,
[email protected]ad6d2c42009-09-15 20:13:38236
[email protected]d8c7cbcc2009-10-02 19:00:31237 # Used to disable Native Client at compile time, for platforms where it
238 # isn't supported
239 'disable_nacl%': 0,
240
[email protected]77c1b29392009-12-04 06:21:29241 # Set Thumb compilation flags.
242 'arm_thumb%': 0,
243
[email protected]53e0f642010-03-05 01:41:56244 # Set ARM fpu compilation flags (only meaningful if armv7==1 and
245 # arm_neon==0).
246 'arm_fpu%': 'vfpv3',
247
[email protected]9821d0d2010-04-16 22:40:37248 # Enable new NPDevice API.
249 'enable_new_npdevice_api%': 0,
250
[email protected]ed154592010-04-29 00:18:50251 # Enable OpenGL ES.
252 'enable_gles%': 0,
253
254 # Enable EGLImage support in OpenMAX
255 'enable_eglimage%': 0,
256
[email protected]912c55c2009-07-31 23:33:55257 'conditions': [
[email protected]47deeb62009-12-17 14:49:39258 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
[email protected]242a9e62009-11-03 17:32:10259 # This will set gcc_version to XY if you are running gcc X.Y.*.
260 # This is used to tweak build flags for gcc 4.4.
261 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
[email protected]4d83eb72010-03-04 16:42:23262 # Figure out the python architecture to decide if we build pyauto.
[email protected]efd68462010-03-04 17:07:54263 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
[email protected]cbd5fd52009-08-26 00:14:27264 'conditions': [
265 ['branding=="Chrome" or linux_chromium_breakpad==1', {
266 'linux_breakpad%': 1,
267 }, {
268 'linux_breakpad%': 0,
269 }],
[email protected]4c9cc6c2009-10-01 18:54:57270 # All Chrome builds have breakpad symbols, but only process the
271 # symbols from official builds.
272 # TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and
273 # crash server handle 64-bit symbols.
274 ['linux_chromium_dump_symbols==1 or '
275 '(branding=="Chrome" and buildtype=="Official" and '
276 'target_arch=="ia32")', {
277 'linux_dump_symbols%': 1,
278 }, {
279 'linux_dump_symbols%': 0,
280 }],
[email protected]06c756182010-04-27 18:31:31281 ['toolkit_views==0', {
[email protected]c153e5352009-09-22 12:37:44282 # GTK wants Title Case strings
283 'use_titlecase_in_grd_files%': 1,
284 }],
[email protected]cbd5fd52009-08-26 00:14:27285 ],
[email protected]47deeb62009-12-17 14:49:39286 }], # OS=="linux" or OS=="freebsd" or OS=="openbsd"
[email protected]e14a9f92009-08-05 19:26:07287 ['OS=="mac"', {
[email protected]c153e5352009-09-22 12:37:44288 # Mac wants Title Case strings
289 'use_titlecase_in_grd_files%': 1,
[email protected]e14a9f92009-08-05 19:26:07290 'conditions': [
291 # mac_product_name is set to the name of the .app bundle as it should
292 # appear on disk. This duplicates data from
293 # chrome/app/theme/chromium/BRANDING and
294 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
295 # these names into the build system.
296 ['branding=="Chrome"', {
297 'mac_product_name%': 'Google Chrome',
298 }, { # else: branding!="Chrome"
299 'mac_product_name%': 'Chromium',
300 }],
301
302 # Feature variables for enabling Mac Breakpad and Keystone auto-update
303 # support. Both features are on by default in official builds with
304 # Chrome branding.
305 ['branding=="Chrome" and buildtype=="Official"', {
306 'mac_breakpad%': 1,
307 'mac_keystone%': 1,
308 }, { # else: branding!="Chrome" or buildtype!="Official"
309 'mac_breakpad%': 0,
310 'mac_keystone%': 0,
311 }],
312 ],
313 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55314 # Whether to use multiple cores to compile with visual studio. This is
315 # optional because it sometimes causes corruption on VS 2005.
316 # It is on by default on VS 2008 and off on VS 2005.
317 ['OS=="win"', {
318 'conditions': [
319 ['MSVS_VERSION=="2005"', {
[email protected]669795372009-08-14 17:51:13320 'msvs_multi_core_compile%': 0,
[email protected]912c55c2009-07-31 23:33:55321 },{
322 'msvs_multi_core_compile%': 1,
323 }],
[email protected]10bb8c92009-08-07 21:16:03324 # Don't do incremental linking for large modules on 32-bit.
325 ['MSVS_OS_BITS==32', {
326 'msvs_large_module_debug_link_mode%': '1', # No
327 },{
328 'msvs_large_module_debug_link_mode%': '2', # Yes
329 }],
[email protected]912c55c2009-07-31 23:33:55330 ],
[email protected]ef4fa4072009-12-04 22:46:50331 'nacl_win64_defines': [
332 # This flag is used to minimize dependencies when building
333 # Native Client loader for 64-bit Windows.
334 'NACL_WIN64',
335 ],
[email protected]912c55c2009-07-31 23:33:55336 }],
[email protected]43f28f832010-02-03 02:28:48337 # Compute based on OS and target architecture whether the GPU
338 # plugin / process is supported.
339 [ 'OS=="win" or (OS=="linux" and target_arch!="arm") or OS=="mac"', {
340 # Enable a variable used elsewhere throughout the GYP files to determine
341 # whether to compile in the sources for the GPU plugin / process.
342 'enable_gpu%': 1,
343 }, { # GPU plugin not supported
344 'enable_gpu%': 0,
345 }],
[email protected]912c55c2009-07-31 23:33:55346 ],
[email protected]f703c4e2009-09-17 21:54:28347
348 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
349 # so Cocoa is happy (http://crbug.com/20441).
350 'locales': [
[email protected]af27c8c2009-11-04 20:36:50351 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
[email protected]f703c4e2009-09-17 21:54:28352 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
353 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
[email protected]cf1ab6f2010-03-25 19:38:23354 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
355 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
356 'vi', 'zh-CN', 'zh-TW',
[email protected]f703c4e2009-09-17 21:54:28357 ],
[email protected]2f80c312009-02-25 21:26:55358 },
359 'target_defaults': {
[email protected]1c966092009-08-20 21:19:26360 'variables': {
[email protected]a6e22132010-02-10 20:43:18361 # The condition that operates on chromium_code is in a target_conditions
362 # section, and will not have access to the default fallback value of
363 # chromium_code at the top of this file, or to the chromium_code
364 # variable placed at the root variables scope of .gyp files, because
365 # those variables are not set at target scope. As a workaround,
366 # if chromium_code is not set at target scope, define it in target scope
367 # to contain whatever value it has during early variable expansion.
368 # That's enough to make it available during target conditional
369 # processing.
370 'chromium_code%': '<(chromium_code)',
371
[email protected]7e0d664a2009-12-03 21:07:47372 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
[email protected]d5d593a2009-08-28 23:23:29373 'mac_release_optimization%': '3', # Use -O3 unless overridden
[email protected]ffd984b12009-09-11 19:37:00374 'mac_debug_optimization%': '0', # Use -O0 unless overridden
[email protected]7e0d664a2009-12-03 21:07:47375 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
376 'win_release_Optimization%': '2', # 2 = /Os
377 'win_debug_Optimization%': '0', # 0 = /Od
378 # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
379 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
380 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
381
[email protected]ffd984b12009-09-11 19:37:00382 'release_extra_cflags%': '',
383 'debug_extra_cflags%': '',
[email protected]92822e82009-09-18 14:26:56384 'release_valgrind_build%': 0,
[email protected]1c966092009-08-20 21:19:26385 },
[email protected]32aa8cc2009-03-04 21:36:39386 'conditions': [
387 ['branding=="Chrome"', {
388 'defines': ['GOOGLE_CHROME_BUILD'],
389 }, { # else: branding!="Chrome"
390 'defines': ['CHROMIUM_BUILD'],
391 }],
[email protected]06c756182010-04-27 18:31:31392 ['toolkit_views==1', {
[email protected]e6970232009-05-12 23:51:17393 'defines': ['TOOLKIT_VIEWS=1'],
394 }],
[email protected]fdc5bed2010-01-09 01:16:57395 ['chromeos==1', {
[email protected]16779842009-07-08 23:45:29396 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50397 }],
[email protected]9c1949e2009-10-02 19:59:54398 ['fastbuild!=0', {
399 'conditions': [
400 # Finally, for Windows, we simply turn on profiling.
401 ['OS=="win"', {
402 'msvs_settings': {
403 'VCLinkerTool': {
404 'GenerateDebugInformation': 'false',
405 },
406 'VCCLCompilerTool': {
407 'DebugInformationFormat': '0',
408 }
409 }
[email protected]37c84192010-04-14 21:37:40410 }, { # else: OS != "win"
411 'cflags': [ '-g1' ],
412 }],
[email protected]9c1949e2009-10-02 19:59:54413 ], # conditions for fastbuild.
414 }], # fastbuild!=0
[email protected]ad6d2c42009-09-15 20:13:38415 ['selinux==1', {
416 'defines': ['CHROMIUM_SELINUX=1'],
417 }],
[email protected]7e0d664a2009-12-03 21:07:47418 ['win_use_allocator_shim==0', {
419 'conditions': [
420 ['OS=="win"', {
421 'defines': ['NO_TCMALLOC'],
422 }],
423 ],
424 }],
[email protected]43f28f832010-02-03 02:28:48425 ['enable_gpu==1', {
[email protected]7477ea6f2009-12-22 23:28:15426 'defines': [
427 'ENABLE_GPU=1',
428 ],
429 }],
[email protected]1a8374f82010-04-26 22:33:54430 ['enable_gles==1', {
431 'defines': [
432 'ENABLE_GLES=1',
433 ],
434 }],
[email protected]ed154592010-04-29 00:18:50435 ['enable_eglimage==1', {
436 'defines': [
437 'ENABLE_EGLIMAGE=1',
438 ],
439 }],
[email protected]f5ecbba12009-04-03 04:35:18440 ['coverage!=0', {
441 'conditions': [
442 ['OS=="mac"', {
443 'xcode_settings': {
[email protected]ab2956372009-08-13 18:11:04444 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
445 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
[email protected]5ae4f55e2009-04-13 23:19:47446 },
[email protected]e4fb84c2009-12-28 20:45:43447 # Add -lgcov for types executable, shared_library, and
[email protected]dc259ce52010-04-13 04:03:10448 # loadable_module; not for static_library.
[email protected]e4fb84c2009-12-28 20:45:43449 # This is a delayed conditional.
[email protected]f5ecbba12009-04-03 04:35:18450 'target_conditions': [
[email protected]e4fb84c2009-12-28 20:45:43451 ['_type!="static_library"', {
[email protected]f5ecbba12009-04-03 04:35:18452 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47453 }],
454 ],
455 }],
[email protected]7122ffd52009-04-30 23:19:00456 # Linux gyp (into scons) doesn't like target_conditions?
457 # TODO(???): track down why 'target_conditions' doesn't work
458 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18459 ['OS=="linux"', {
460 'cflags': [ '-ftest-coverage',
461 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00462 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18463 }],
[email protected]e8f6ff42009-07-07 18:20:53464 # Finally, for Windows, we simply turn on profiling.
465 ['OS=="win"', {
466 'msvs_settings': {
467 'VCLinkerTool': {
468 'Profile': 'true',
469 },
[email protected]10bb8c92009-08-07 21:16:03470 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53471 # /Z7, not /Zi, so coverage is happyb
472 'DebugInformationFormat': '1',
[email protected]1f9471a2010-01-04 06:40:16473 'AdditionalOptions': ['/Yd'],
[email protected]e8f6ff42009-07-07 18:20:53474 }
475 }
476 }], # OS==win
477 ], # conditions for coverage
478 }], # coverage!=0
[email protected]a6e22132010-02-10 20:43:18479 ], # conditions for 'target_defaults'
480 'target_conditions': [
[email protected]c14d8e772010-02-09 22:06:15481 ['chromium_code==0', {
[email protected]d8543312010-02-10 17:43:28482 'conditions': [
483 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
484 'cflags!': [
485 '-Wall',
486 '-Wextra',
487 '-Werror',
488 ],
489 }],
490 [ 'OS=="win"', {
491 'defines': [
492 '_CRT_SECURE_NO_DEPRECATE',
493 '_CRT_NONSTDC_NO_WARNINGS',
494 '_CRT_NONSTDC_NO_DEPRECATE',
495 '_SCL_SECURE_NO_DEPRECATE',
496 ],
497 'msvs_disabled_warnings': [4800],
498 'msvs_settings': {
499 'VCCLCompilerTool': {
500 'WarnAsError': 'false',
501 'Detect64BitPortabilityProblems': 'false',
502 },
503 },
504 }],
505 [ 'OS=="mac"', {
506 'xcode_settings': {
507 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
508 'WARNING_CFLAGS!': ['-Wall'],
509 },
510 }],
[email protected]c14d8e772010-02-09 22:06:15511 ],
512 }, {
513 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
514 # C99 macros on Mac and Linux.
515 'defines': [
516 '__STDC_FORMAT_MACROS',
517 ],
518 'conditions': [
519 ['OS!="win"', {
520 'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'],
521 ['exclude', '/win/'],
522 ['exclude', '/win_[^/]*\\.cc$'] ],
523 }],
524 ['OS!="mac"', {
525 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
526 ['exclude', '/(cocoa|mac)/'],
[email protected]e603d952010-02-10 22:36:26527 ['exclude', '\.mm?$' ] ],
[email protected]c14d8e772010-02-09 22:06:15528 }],
529 ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
530 'sources/': [
[email protected]1c657852010-04-22 23:28:05531 ['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.cc$'],
[email protected]c14d8e772010-02-09 22:06:15532 ['exclude', '/gtk/'],
[email protected]18cff3d2010-02-17 18:03:13533 ['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
534 ],
535 }],
536 ['OS!="linux"', {
537 'sources/': [
538 ['exclude', '_linux(_unittest)?\\.cc$'],
539 ['exclude', '/linux/'],
540 ],
[email protected]c14d8e772010-02-09 22:06:15541 }],
542 # We use "POSIX" to refer to all non-Windows operating systems.
543 ['OS=="win"', {
544 'sources/': [ ['exclude', '_posix\\.cc$'] ],
545 }],
546 # Though Skia is conceptually shared by Linux and Windows,
547 # the only _skia files in our tree are Linux-specific.
548 ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
549 'sources/': [ ['exclude', '_skia\\.cc$'] ],
550 }],
551 ['chromeos!=1', {
552 'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
553 }],
[email protected]06c756182010-04-27 18:31:31554 ['toolkit_views==0', {
[email protected]c14d8e772010-02-09 22:06:15555 'sources/': [ ['exclude', '_views\\.cc$'] ]
556 }],
557 ],
558 }],
[email protected]a6e22132010-02-10 20:43:18559 ], # target_conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55560 'default_configuration': 'Debug',
561 'configurations': {
[email protected]5153767c2009-12-22 01:52:50562 # VCLinkerTool LinkIncremental values below:
563 # 0 == default
564 # 1 == /INCREMENTAL:NO
565 # 2 == /INCREMENTAL
566 # Debug links incremental, Release does not.
567 #
568 # Abstract base configurations to cover common
569 # attributes.
570 #
571 'Common_Base': {
[email protected]bb05e452009-10-29 21:24:56572 'abstract': 1,
573 'msvs_configuration_attributes': {
574 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
575 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
576 'CharacterSet': '1',
577 },
[email protected]5153767c2009-12-22 01:52:50578 },
579 'x86_Base': {
580 'abstract': 1,
[email protected]ef4fa4072009-12-04 22:46:50581 'msvs_settings': {
582 'VCLinkerTool': {
583 'TargetMachine': '1',
584 },
585 },
[email protected]2fa40782009-11-01 21:17:34586 'msvs_configuration_platform': 'Win32',
[email protected]bb05e452009-10-29 21:24:56587 },
[email protected]5153767c2009-12-22 01:52:50588 'x64_Base': {
589 'abstract': 1,
590 'msvs_configuration_platform': 'x64',
591 'msvs_settings': {
592 'VCLinkerTool': {
593 'TargetMachine': '17', # x86 - 64
[email protected]5153767c2009-12-22 01:52:50594 'AdditionalLibraryDirectories!':
595 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
596 'AdditionalLibraryDirectories':
597 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
598 },
[email protected]d26b4418ab2010-03-24 22:06:35599 'VCLibrarianTool': {
[email protected]5153767c2009-12-22 01:52:50600 'AdditionalLibraryDirectories!':
601 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
602 'AdditionalLibraryDirectories':
603 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
604 },
605 },
606 'defines': [
607 # Not sure if tcmalloc works on 64-bit Windows.
608 'NO_TCMALLOC',
609 ],
610 },
611 'Debug_Base': {
612 'abstract': 1,
[email protected]1c966092009-08-20 21:19:26613 'xcode_settings': {
614 'COPY_PHASE_STRIP': 'NO',
[email protected]d5d593a2009-08-28 23:23:29615 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
[email protected]bd232ac2009-10-21 02:23:53616 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26617 },
[email protected]bb05e452009-10-29 21:24:56618 'msvs_settings': {
619 'VCCLCompilerTool': {
[email protected]7e0d664a2009-12-03 21:07:47620 'Optimization': '<(win_debug_Optimization)',
[email protected]bb05e452009-10-29 21:24:56621 'PreprocessorDefinitions': ['_DEBUG'],
622 'BasicRuntimeChecks': '3',
[email protected]7e0d664a2009-12-03 21:07:47623 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
[email protected]bb05e452009-10-29 21:24:56624 },
625 'VCLinkerTool': {
626 'LinkIncremental': '<(msvs_debug_link_incremental)',
627 },
628 'VCResourceCompilerTool': {
629 'PreprocessorDefinitions': ['_DEBUG'],
630 },
631 },
[email protected]2f80c312009-02-25 21:26:55632 'conditions': [
[email protected]bb05e452009-10-29 21:24:56633 ['OS=="linux"', {
634 'cflags': [
635 '<@(debug_extra_cflags)',
636 ],
[email protected]2f80c312009-02-25 21:26:55637 }],
638 ],
639 },
[email protected]5153767c2009-12-22 01:52:50640 'Release_Base': {
641 'abstract': 1,
[email protected]2f80c312009-02-25 21:26:55642 'defines': [
643 'NDEBUG',
644 ],
[email protected]1c966092009-08-20 21:19:26645 'xcode_settings': {
646 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
647 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
[email protected]ffd984b12009-09-11 19:37:00648 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26649 },
[email protected]bb05e452009-10-29 21:24:56650 'msvs_settings': {
[email protected]7e0d664a2009-12-03 21:07:47651 'VCCLCompilerTool': {
652 'Optimization': '<(win_release_Optimization)',
653 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
654 },
[email protected]bb05e452009-10-29 21:24:56655 'VCLinkerTool': {
656 'LinkIncremental': '1',
657 },
658 },
[email protected]2f80c312009-02-25 21:26:55659 'conditions': [
[email protected]92822e82009-09-18 14:26:56660 ['release_valgrind_build==0', {
661 'defines': ['NVALGRIND'],
662 }],
[email protected]7e0d664a2009-12-03 21:07:47663 ['win_use_allocator_shim==0', {
664 'defines': ['NO_TCMALLOC'],
665 }],
666 ['win_release_RuntimeLibrary==2', {
667 # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
[email protected]7477ea6f2009-12-22 23:28:15668 # VC\include\typeinfo(139) : warning C4275: non dll-interface
669 # class 'stdext::exception' used as base for dll-interface
[email protected]7e0d664a2009-12-03 21:07:47670 # class 'std::bad_cast'
671 'msvs_disabled_warnings': [4275],
672 }],
[email protected]bb05e452009-10-29 21:24:56673 ['OS=="linux"', {
674 'cflags': [
[email protected]ffd984b12009-09-11 19:37:00675 '<@(release_extra_cflags)',
[email protected]bb05e452009-10-29 21:24:56676 ],
677 }],
[email protected]2f80c312009-02-25 21:26:55678 ],
679 },
[email protected]5153767c2009-12-22 01:52:50680 'Purify_Base': {
681 'abstract': 1,
682 'defines': [
683 'PURIFY',
684 'NO_TCMALLOC',
685 ],
686 'msvs_settings': {
687 'VCCLCompilerTool': {
688 'Optimization': '0',
689 'RuntimeLibrary': '0',
690 'BufferSecurityCheck': 'false',
691 },
692 'VCLinkerTool': {
693 'EnableCOMDATFolding': '1',
694 'LinkIncremental': '1',
695 },
696 },
697 },
698 #
699 # Concrete configurations
700 #
701 'Debug': {
702 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
703 },
704 'Release': {
705 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
706 'conditions': [
707 ['msvs_use_common_release', {
[email protected]1f9471a2010-01-04 06:40:16708 'includes': ['release.gypi'],
[email protected]5153767c2009-12-22 01:52:50709 }],
710 ]
711 },
[email protected]f926fa0a2009-08-04 22:50:13712 'conditions': [
713 [ 'OS=="win"', {
714 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
715 'Purify': {
[email protected]5153767c2009-12-22 01:52:50716 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
[email protected]ef4fa4072009-12-04 22:46:50717 },
718 'Debug_x64': {
[email protected]5153767c2009-12-22 01:52:50719 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
[email protected]78263c12009-11-01 23:45:30720 },
721 'Release_x64': {
[email protected]5153767c2009-12-22 01:52:50722 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
[email protected]78263c12009-11-01 23:45:30723 },
724 'Purify_x64': {
[email protected]1f9471a2010-01-04 06:40:16725 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
[email protected]78263c12009-11-01 23:45:30726 },
[email protected]f926fa0a2009-08-04 22:50:13727 }],
728 ],
[email protected]2f80c312009-02-25 21:26:55729 },
730 },
731 'conditions': [
[email protected]93f21e42010-04-01 00:35:15732 ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
[email protected]9d384032009-03-20 23:13:26733 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27734 # Enable -Werror by default, but put it in a variable so it can
735 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
736 'variables': {
[email protected]ecf52cb82010-01-13 19:25:42737 # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
738 # issues that slip through the cracks. We could do this just for
739 # gcc 4.4 but it makes more sense to be consistent on all
740 # compilers in use. TODO(Craig): turn this off again when
741 # there is some 4.4 test infrastructure in place and existing
742 # aliasing issues have been fixed.
743 'no_strict_aliasing%': 1,
[email protected]47deeb62009-12-17 14:49:39744 'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
745 ['OS=="freebsd"', {'werror%': '',}],
746 ['OS=="openbsd"', {'werror%': '',}],
747 ],
[email protected]5315f2842009-04-28 00:43:27748 },
[email protected]9d384032009-03-20 23:13:26749 'cflags': [
[email protected]1bba09c2009-08-13 12:53:16750 '<(werror)', # See note above about the werror variable.
751 '-pthread',
752 '-fno-exceptions',
753 '-Wall',
[email protected]0fa17082010-03-26 00:48:05754 # TODO(evan): turn this back on once all the builds work.
755 # '-Wextra',
[email protected]225c8f52010-02-05 22:23:20756 # Don't warn about unused function params. We use those everywhere.
757 '-Wno-unused-parameter',
758 # Don't warn about the "struct foo f = {0};" initialization pattern.
759 '-Wno-missing-field-initializers',
[email protected]1bba09c2009-08-13 12:53:16760 '-D_FILE_OFFSET_BITS=64',
[email protected]3df6e3a2010-01-21 20:23:12761 # Don't export any symbols (for example, to plugins we dlopen()).
762 # Note: this is *required* to make some plugins work.
763 '-fvisibility=hidden',
[email protected]8a2fcba2009-07-29 00:52:24764 ],
765 'cflags_cc': [
[email protected]832d0212009-10-28 19:12:22766 '-fno-rtti',
[email protected]8a2fcba2009-07-29 00:52:24767 '-fno-threadsafe-statics',
[email protected]f5986c42009-11-17 18:39:36768 # Make inline functions have hidden visiblity by default.
769 # Surprisingly, not covered by -fvisibility=hidden.
770 '-fvisibility-inlines-hidden',
[email protected]9d384032009-03-20 23:13:26771 ],
[email protected]a6cf87e2009-04-03 04:07:38772 'ldflags': [
[email protected]138241f2010-03-30 23:53:10773 '-pthread', '-Wl,-z,noexecstack',
[email protected]9d384032009-03-20 23:13:26774 ],
[email protected]b5e46b92009-03-26 18:58:10775 'scons_variable_settings': {
776 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26777 # Linking of large files uses lots of RAM, so serialize links
778 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01779 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31780 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
781 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26782
783 # We have several cases where archives depend on each other in
784 # a cyclic fashion. Since the GNU linker does only a single
785 # pass over the archives we surround the libraries with
786 # --start-group and --end-group (aka -( and -) ). That causes
787 # ld to loop over the group until no more undefined symbols
788 # are found. In an ideal world we would only make groups from
789 # those libraries which we knew to be in cycles. However,
790 # that's tough with SCons, so we bodge it by making all the
791 # archives a group by redefining the linking command here.
792 #
793 # TODO: investigate whether we still have cycles that
794 # require --{start,end}-group. There has been a lot of
795 # refactoring since this was first coded, which might have
796 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41797 #
798 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
799 # so that we prefer our own built libraries (e.g. -lpng) to
800 # system versions of libraries that pkg-config might turn up.
801 # TODO(sgk): investigate handling this not by re-ordering the
802 # flags this way, but by adding a hook to use the SCons
803 # ParseFlags() option on the output from pkg-config.
[email protected]610d8cc2009-09-19 00:47:04804 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
805 '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
806 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
807 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
808 '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
809 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
810 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
811 '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
812 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26813 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29814 # -rpath is only used when building with shared libraries.
815 'conditions': [
816 [ 'library=="shared_library"', {
817 'RPATH': '$LIB_DIR',
818 }],
819 ],
[email protected]9d384032009-03-20 23:13:26820 },
[email protected]b5e46b92009-03-26 18:58:10821 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49822 'AS',
[email protected]b5e46b92009-03-26 18:58:10823 'CC',
824 'CXX',
825 'LINK',
826 ],
827 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49828 'AS',
[email protected]b5e46b92009-03-26 18:58:10829 'CC',
830 'CCACHE_DIR',
831 'CXX',
832 'DISTCC_DIR',
833 'DISTCC_HOSTS',
834 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47835 'INCLUDE_SERVER_ARGS',
836 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10837 'LINK',
[email protected]fff920a2009-05-08 22:35:32838 'CHROME_BUILD_TYPE',
839 'CHROMIUM_BUILD',
840 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10841 ],
[email protected]3aacaf952009-04-02 15:34:09842 'configurations': {
[email protected]5153767c2009-12-22 01:52:50843 'Debug_Base': {
[email protected]c5bdc032009-04-20 19:11:31844 'variables': {
845 'debug_optimize%': '0',
846 },
[email protected]3aacaf952009-04-02 15:34:09847 'defines': [
848 '_DEBUG',
849 ],
850 'cflags': [
[email protected]22898f62009-10-26 22:14:01851 '-O>(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09852 '-g',
[email protected]9a5d2a52009-05-22 03:37:45853 # One can use '-gstabs' to enable building the debugging
854 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09855 ],
[email protected]96fd0032009-04-24 00:13:08856 'ldflags': [
857 '-rdynamic', # Allows backtrace to resolve symbols.
858 ],
[email protected]5315f2842009-04-28 00:43:27859 },
[email protected]5153767c2009-12-22 01:52:50860 'Release_Base': {
[email protected]740e2de2009-07-21 11:41:01861 'variables': {
862 'release_optimize%': '2',
863 },
[email protected]3aacaf952009-04-02 15:34:09864 'cflags': [
[email protected]22898f62009-10-26 22:14:01865 '-O>(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53866 # Don't emit the GCC version ident directives, they just end up
867 # in the .comment section taking up binary size.
868 '-fno-ident',
869 # Put data and code in their own sections, so that unused symbols
870 # can be removed at link time with --gc-sections.
871 '-fdata-sections',
872 '-ffunction-sections',
[email protected]3aacaf952009-04-02 15:34:09873 ],
[email protected]3a48e0542009-11-18 17:07:13874 'ldflags': [
875 '-Wl,--gc-sections',
876 ],
[email protected]3aacaf952009-04-02 15:34:09877 },
878 },
[email protected]601b540222009-04-03 21:32:04879 'variants': {
880 'coverage': {
881 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
882 'ldflags': ['-fprofile-arcs'],
883 },
884 'profile': {
885 'cflags': ['-pg', '-g'],
886 'ldflags': ['-pg'],
887 },
888 'symbols': {
889 'cflags': ['-g'],
890 },
891 },
[email protected]606116d22009-05-06 22:38:23892 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00893 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23894 'asflags': [
895 # Needed so that libs with .s files (e.g. libicudata.a)
896 # are compatible with the general 32-bit-ness.
897 '-32',
898 ],
899 # All floating-point computations on x87 happens in 80-bit
900 # precision. Because the C and C++ language standards allow
901 # the compiler to keep the floating-point values in higher
902 # precision than what's specified in the source and doing so
903 # is more efficient than constantly rounding up to 64-bit or
904 # 32-bit precision as specified in the source, the compiler,
905 # especially in the optimized mode, tries very hard to keep
906 # values in x87 floating-point stack (in 80-bit precision)
907 # as long as possible. This has important side effects, that
908 # the real value used in computation may change depending on
909 # how the compiler did the optimization - that is, the value
910 # kept in 80-bit is different than the value rounded down to
911 # 64-bit or 32-bit. There are possible compiler options to make
912 # this behavior consistent (e.g. -ffloat-store would keep all
913 # floating-values in the memory, thus force them to be rounded
914 # to its original precision) but they have significant runtime
915 # performance penalty.
916 #
917 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
918 # which keep floating-point values in SSE registers in its
919 # native precision (32-bit for single precision, and 64-bit for
920 # double precision values). This means the floating-point value
921 # used during computation does not change depending on how the
922 # compiler optimized the code, since the value is always kept
923 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06924 'conditions': [
[email protected]ac120ff2010-04-28 02:14:22925 ['branding=="Chromium" and disable_sse2==0', {
[email protected]ffde7932009-05-29 00:39:06926 'cflags': [
927 '-march=pentium4',
928 '-msse2',
929 '-mfpmath=sse',
930 ],
931 }],
[email protected]06c756182010-04-27 18:31:31932 # ChromeOS targets Pinetrail, which is sse3, but most of the
[email protected]0183dbb2010-04-16 02:00:44933 # benefit comes from sse2 so this setting allows ChromeOS
934 # to build on other CPUs. In the future -march=atom would help
935 # but requires a newer compiler.
[email protected]ac120ff2010-04-28 02:14:22936 ['chromeos==1 and disable_sse2==0', {
[email protected]0183dbb2010-04-16 02:00:44937 'cflags': [
938 '-msse2',
939 ],
940 }],
[email protected]ffde7932009-05-29 00:39:06941 ],
[email protected]dc259ce52010-04-13 04:03:10942 # -mmmx allows mmintrin.h to be used for mmx intrinsics.
943 # video playback is mmx and sse2 optimized.
[email protected]606116d22009-05-06 22:38:23944 'cflags': [
945 '-m32',
[email protected]dc259ce52010-04-13 04:03:10946 '-mmmx',
[email protected]1c6560af2009-07-14 11:02:16947 ],
[email protected]606116d22009-05-06 22:38:23948 'ldflags': [
949 '-m32',
950 ],
951 }],
[email protected]3dda8a962009-08-10 18:58:07952 ['target_arch=="arm"', {
[email protected]77c1b29392009-12-04 06:21:29953 'target_conditions': [
954 ['_toolset=="target"', {
955 'cflags_cc': [
956 # The codesourcery arm-2009q3 toolchain warns at that the ABI
957 # has changed whenever it encounters a varargs function. This
958 # silences those warnings, as they are not helpful and
959 # clutter legitimate warnings.
960 '-Wno-abi',
961 ],
962 'conditions': [
963 ['arm_thumb == 1', {
964 'cflags': [
965 '-mthumb',
966 # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
967 # inline assembly that uses condition codes but it's
968 # suboptimal. Better would be to #ifdef __thumb__ at the
969 # right place and have a separate thumb path.
970 '-Wa,-mimplicit-it=thumb',
971 ]
972 }],
973 ['armv7==1', {
[email protected]dc9711f2009-11-13 19:30:25974 'cflags': [
975 '-march=armv7-a',
976 '-mtune=cortex-a8',
[email protected]dc9711f2009-11-13 19:30:25977 '-mfloat-abi=softfp',
978 ],
[email protected]eafc0b452010-02-26 21:53:43979 'conditions': [
980 ['arm_neon==1', {
981 'cflags': [ '-mfpu=neon', ],
982 }, {
[email protected]53e0f642010-03-05 01:41:56983 'cflags': [ '-mfpu=<(arm_fpu)', ],
[email protected]eafc0b452010-02-26 21:53:43984 }]
985 ],
[email protected]dc9711f2009-11-13 19:30:25986 }],
[email protected]3dda8a962009-08-10 18:58:07987 ],
988 }],
989 ],
990 }],
[email protected]c76723a2010-01-25 23:10:58991 ['linux_fpic==1', {
992 'cflags': [
993 '-fPIC',
994 ],
995 }],
[email protected]ee28c9f2009-09-04 01:53:01996 ['sysroot!=""', {
[email protected]fd36ce822009-10-28 20:13:57997 'target_conditions': [
998 ['_toolset=="target"', {
999 'cflags': [
1000 '--sysroot=<(sysroot)',
1001 ],
1002 'ldflags': [
1003 '--sysroot=<(sysroot)',
1004 ],
1005 }]]
[email protected]ee28c9f2009-09-04 01:53:011006 }],
[email protected]cc4219a2009-08-14 05:30:521007 ['no_strict_aliasing==1', {
1008 'cflags': [
1009 '-fno-strict-aliasing',
1010 ],
1011 }],
[email protected]cbd5fd52009-08-26 00:14:271012 ['linux_breakpad==1', {
1013 'cflags': [ '-gstabs' ],
1014 'defines': ['USE_LINUX_BREAKPAD'],
1015 }],
[email protected]39c4e1a82010-03-30 19:47:411016 ['linux_use_seccomp_sandbox==1 and buildtype!="Official"', {
1017 'defines': ['USE_SECCOMP_SANDBOX'],
1018 }],
[email protected]7cd2afd2009-10-27 21:40:261019 ['library=="shared_library"', {
1020 # When building with shared libraries, remove the visiblity-hiding
1021 # flag.
1022 'cflags!': [ '-fvisibility=hidden' ],
[email protected]4907ac42009-11-02 20:32:511023 'conditions': [
[email protected]08be8a72009-11-18 20:35:541024 ['target_arch=="x64" or target_arch=="arm"', {
1025 # Shared libraries need -fPIC on x86-64 and arm
[email protected]4907ac42009-11-02 20:32:511026 'cflags': ['-fPIC']
1027 }]
1028 ],
[email protected]7cd2afd2009-10-27 21:40:261029 }],
[email protected]d8b60602010-03-26 09:41:221030 ['linux_use_heapchecker==1', {
1031 'variables': {'linux_use_tcmalloc%': 1},
1032 }],
[email protected]61a9b2d82010-02-26 00:31:081033 ['linux_use_tcmalloc==0', {
1034 'defines': ['NO_TCMALLOC'],
[email protected]01699e22009-11-11 19:24:241035 }],
[email protected]d8b60602010-03-26 09:41:221036 ['linux_use_heapchecker==0', {
1037 'defines': ['NO_HEAPCHECKER'],
1038 }],
[email protected]606116d22009-05-06 22:38:231039 ],
[email protected]9d384032009-03-20 23:13:261040 },
1041 }],
[email protected]c51e8d52009-12-11 20:04:061042 # FreeBSD-specific options; note that most FreeBSD options are set above,
1043 # with Linux.
1044 ['OS=="freebsd"', {
1045 'target_defaults': {
1046 'ldflags': [
1047 '-Wl,--no-keep-memory',
1048 ],
1049 },
1050 }],
[email protected]93f21e42010-04-01 00:35:151051 ['OS=="solaris"', {
1052 'cflags!': ['-fvisibility=hidden'],
1053 'cflags_cc!': ['-fvisibility-inlines-hidden'],
1054 }],
[email protected]2f80c312009-02-25 21:26:551055 ['OS=="mac"', {
1056 'target_defaults': {
[email protected]24700642009-06-01 16:01:201057 'variables': {
1058 # This should be 'mac_real_dsym%', but there seems to be a bug
1059 # with % in variables that are intended to be set to different
1060 # values in different targets, like this one.
1061 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
1062 },
[email protected]d92c7c012009-03-19 19:26:421063 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:551064 'xcode_settings': {
1065 'ALWAYS_SEARCH_USER_PATHS': 'NO',
[email protected]ab2956372009-08-13 18:11:041066 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
1067 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
1068 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
1069 # (Equivalent to -fPIC)
1070 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
1071 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
1072 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
[email protected]3224dcd2009-09-16 17:31:251073 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
1074 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
[email protected]ab2956372009-08-13 18:11:041075 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
1076 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
1077 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
1078 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
[email protected]2f80c312009-02-25 21:26:551079 'GCC_VERSION': '4.2',
[email protected]ab2956372009-08-13 18:11:041080 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
[email protected]3224dcd2009-09-16 17:31:251081 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
1082 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
[email protected]ab2956372009-08-13 18:11:041083 'PREBINDING': 'NO', # No -Wl,-prebind
[email protected]2f80c312009-02-25 21:26:551084 'USE_HEADERMAP': 'NO',
1085 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:241086 'conditions': [
1087 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
[email protected]9543af052009-09-15 22:42:591088 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
1089 ],
[email protected]b3fb8092009-03-12 19:09:241090 ],
[email protected]2f80c312009-02-25 21:26:551091 },
1092 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:551093 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:461094 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
1095 }],
1096 ['_mac_bundle', {
1097 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:081098 }],
[email protected]e14a9f92009-08-05 19:26:071099 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:201100 'target_conditions': [
1101 ['mac_real_dsym == 1', {
1102 # To get a real .dSYM bundle produced by dsymutil, set the
1103 # debug information format to dwarf-with-dsym. Since
1104 # strip_from_xcode will not be used, set Xcode to do the
1105 # stripping as well.
1106 'configurations': {
[email protected]5153767c2009-12-22 01:52:501107 'Release_Base': {
[email protected]24700642009-06-01 16:01:201108 'xcode_settings': {
1109 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
1110 'DEPLOYMENT_POSTPROCESSING': 'YES',
1111 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:071112 'target_conditions': [
1113 ['_type=="shared_library"', {
1114 # The Xcode default is to strip debugging symbols
1115 # only (-S). Local symbols should be stripped as
1116 # well, which will be handled by -x. Xcode will
1117 # continue to insert -S when stripping even when
1118 # additional flags are added with STRIPFLAGS.
1119 'STRIPFLAGS': '-x',
1120 }], # _type=="shared_library"
1121 ], # target_conditions
1122 }, # xcode_settings
1123 }, # configuration "Release"
1124 }, # configurations
[email protected]24700642009-06-01 16:01:201125 }, { # mac_real_dsym != 1
1126 # To get a fast fake .dSYM bundle, use a post-build step to
1127 # produce the .dSYM and strip the executable. strip_from_xcode
1128 # only operates in the Release configuration.
1129 'postbuilds': [
1130 {
1131 'variables': {
1132 # Define strip_from_xcode in a variable ending in _path
1133 # so that gyp understands it's a path and performs proper
1134 # relativization during dict merging.
1135 'strip_from_xcode_path': 'mac/strip_from_xcode',
1136 },
1137 'postbuild_name': 'Strip If Needed',
1138 'action': ['<(strip_from_xcode_path)'],
1139 },
[email protected]e14a9f92009-08-05 19:26:071140 ], # postbuilds
1141 }], # mac_real_dsym
1142 ], # target_conditions
1143 }], # _type=="executable" or _type=="shared_library"
1144 ], # target_conditions
1145 }, # target_defaults
1146 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:551147 ['OS=="win"', {
1148 'target_defaults': {
1149 'defines': [
1150 '_WIN32_WINNT=0x0600',
1151 'WINVER=0x0600',
1152 'WIN32',
1153 '_WINDOWS',
1154 '_HAS_EXCEPTIONS=0',
1155 'NOMINMAX',
1156 '_CRT_RAND_S',
1157 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
1158 'WIN32_LEAN_AND_MEAN',
1159 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:451160 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:551161 ],
[email protected]5b5ca7cb2009-07-20 23:00:201162 'msvs_system_include_dirs': [
[email protected]998b5152009-12-12 22:19:521163 '<(DEPTH)/third_party/platformsdk_win7/files/Include',
[email protected]2f80c312009-02-25 21:26:551164 '$(VSInstallDir)/VC/atlmfc/include',
1165 ],
[email protected]a8d99cef2009-08-26 20:47:491166 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:551167 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:551168 'msvs_settings': {
1169 'VCCLCompilerTool': {
1170 'MinimalRebuild': 'false',
1171 'ExceptionHandling': '0',
1172 'BufferSecurityCheck': 'true',
1173 'EnableFunctionLevelLinking': 'true',
1174 'RuntimeTypeInfo': 'false',
1175 'WarningLevel': '3',
1176 'WarnAsError': 'true',
1177 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:581178 'conditions': [
[email protected]912c55c2009-07-31 23:33:551179 [ 'msvs_multi_core_compile', {
[email protected]1f9471a2010-01-04 06:40:161180 'AdditionalOptions': ['/MP'],
[email protected]912c55c2009-07-31 23:33:551181 }],
[email protected]3fef6e62009-07-31 19:58:581182 ],
[email protected]2f80c312009-02-25 21:26:551183 },
1184 'VCLibrarianTool': {
[email protected]1f9471a2010-01-04 06:40:161185 'AdditionalOptions': ['/ignore:4221'],
[email protected]2f80c312009-02-25 21:26:551186 'AdditionalLibraryDirectories':
[email protected]998b5152009-12-12 22:19:521187 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
[email protected]2f80c312009-02-25 21:26:551188 },
1189 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:551190 'AdditionalDependencies': [
1191 'wininet.lib',
1192 'version.lib',
1193 'msimg32.lib',
1194 'ws2_32.lib',
1195 'usp10.lib',
1196 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:081197 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:551198 ],
1199 'AdditionalLibraryDirectories':
[email protected]998b5152009-12-12 22:19:521200 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
[email protected]2f80c312009-02-25 21:26:551201 'GenerateDebugInformation': 'true',
1202 'MapFileName': '$(OutDir)\\$(TargetName).map',
1203 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
[email protected]2f80c312009-02-25 21:26:551204 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:481205 # SubSystem values:
1206 # 0 == not set
1207 # 1 == /SUBSYSTEM:CONSOLE
1208 # 2 == /SUBSYSTEM:WINDOWS
1209 # Most of the executables we'll ever create are tests
1210 # and utilities with console output.
1211 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:551212 },
1213 'VCMIDLTool': {
1214 'GenerateStublessProxies': 'true',
1215 'TypeLibraryName': '$(InputName).tlb',
1216 'OutputDirectory': '$(IntDir)',
1217 'HeaderFileName': '$(InputName).h',
1218 'DLLDataFileName': 'dlldata.c',
1219 'InterfaceIdentifierFileName': '$(InputName)_i.c',
1220 'ProxyFileName': '$(InputName)_p.c',
1221 },
1222 'VCResourceCompilerTool': {
1223 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:141224 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:551225 },
1226 },
1227 },
1228 }],
[email protected]93f21e42010-04-01 00:35:151229 ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
[email protected]d8c7cbcc2009-10-02 19:00:311230 'target_defaults': {
1231 'defines': [
1232 'DISABLE_NACL',
1233 ],
1234 },
1235 }],
[email protected]cfbf9bc2009-12-07 22:07:561236 ['OS=="win" and msvs_use_common_linker_extras', {
[email protected]48c7af72009-07-03 22:00:191237 'target_defaults': {
1238 'msvs_settings': {
1239 'VCLinkerTool': {
[email protected]48c7af72009-07-03 22:00:191240 'DelayLoadDLLs': [
1241 'dbghelp.dll',
1242 'dwmapi.dll',
1243 'uxtheme.dll',
1244 ],
1245 },
1246 },
[email protected]ef4fa4072009-12-04 22:46:501247 'configurations': {
[email protected]5153767c2009-12-22 01:52:501248 'x86_Base': {
[email protected]ef4fa4072009-12-04 22:46:501249 'msvs_settings': {
1250 'VCLinkerTool': {
[email protected]1f9471a2010-01-04 06:40:161251 'AdditionalOptions': [
1252 '/safeseh',
1253 '/dynamicbase',
1254 '/ignore:4199',
1255 '/ignore:4221',
1256 '/nxcompat',
1257 ],
[email protected]ef4fa4072009-12-04 22:46:501258 },
1259 },
1260 },
[email protected]5153767c2009-12-22 01:52:501261 'x64_Base': {
[email protected]ef4fa4072009-12-04 22:46:501262 'msvs_settings': {
1263 'VCLinkerTool': {
[email protected]1f9471a2010-01-04 06:40:161264 'AdditionalOptions': [
[email protected]ef4fa4072009-12-04 22:46:501265 # safeseh is not compatible with x64
[email protected]1f9471a2010-01-04 06:40:161266 '/dynamicbase',
1267 '/ignore:4199',
1268 '/ignore:4221',
1269 '/nxcompat',
1270 ],
[email protected]ef4fa4072009-12-04 22:46:501271 },
1272 },
1273 },
1274 },
[email protected]48c7af72009-07-03 22:00:191275 },
1276 }],
[email protected]9821d0d2010-04-16 22:40:371277 ['enable_new_npdevice_api==1', {
1278 'target_defaults': {
1279 'defines': [
1280 'ENABLE_NEW_NPDEVICE_API',
1281 ],
1282 },
1283 }],
[email protected]2f80c312009-02-25 21:26:551284 ],
[email protected]c13fcbd2009-03-27 04:27:011285 'scons_settings': {
1286 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:071287 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:011288 },
[email protected]2f80c312009-02-25 21:26:551289 'xcode_settings': {
[email protected]0c8ab452009-11-06 21:57:501290 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
1291 # This block adds *project-wide* configuration settings to each project
1292 # file. It's almost always wrong to put things here. Specify your
1293 # custom xcode_settings in target_defaults to add them to targets instead.
1294
1295 # In an Xcode Project Info window, the "Base SDK for All Configurations"
1296 # setting sets the SDK on a project-wide basis. In order to get the
1297 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
1298 # here at the project level.
1299 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
1300
[email protected]2f80c312009-02-25 21:26:551301 # The Xcode generator will look for an xcode_settings section at the root
1302 # of each dict and use it to apply settings on a file-wide basis. Most
1303 # settings should not be here, they should be in target-specific
1304 # xcode_settings sections, or better yet, should use non-Xcode-specific
1305 # settings in target dicts. SYMROOT is a special case, because many other
1306 # Xcode variables depend on it, including variables such as
1307 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
1308 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
1309 # files to appear (when present) in the UI as actual files and not red
1310 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
1311 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:161312 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:551313 },
[email protected]ee28c9f2009-09-04 01:53:011314}
[email protected]f5c990c2009-10-06 03:02:381315
1316# Local Variables:
1317# tab-width:2
1318# indent-tabs-mode:nil
1319# End:
1320# vim: set expandtab tabstop=2 shiftwidth=2: