blob: 5f3223c2e0e3c2edb2f0ed50054d4fe700e4f2f1 [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 ],
51 },
52 'host_arch%': '<(host_arch)',
53
54 # Default architecture we're building for is the architecture we're
55 # building on.
56 'target_arch%': '<(host_arch)',
[email protected]e0d00142009-09-18 22:10:2757
[email protected]cbd5fd52009-08-26 00:14:2758 # We do want to build Chromium with Breakpad support in certain
59 # situations. I.e. for Chrome bot.
60 'linux_chromium_breakpad%': 0,
[email protected]4c9cc6c2009-10-01 18:54:5761 # And if we want to dump symbols.
[email protected]05cb6962009-10-01 23:29:0362 'linux_chromium_dump_symbols%': 0,
63 # Also see linux_strip_binary below.
[email protected]c153e5352009-09-22 12:37:4464
65 # By default, Linux does not use views. To turn on views in Linux,
66 # set the variable GYP_DEFINES to "toolkit_views=1", or modify
67 # ~/.gyp/include.gypi .
68 'toolkit_views%': 0,
69
70 # Defaults to a desktop build, overridden via command line/env.
71 'chromeos%': 0,
[email protected]b2f030c2009-09-24 20:36:2172
73 # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
74 # are built under a chromium full build (1) or a webkit.org chromium
75 # build (0).
76 'inside_chromium_build%': 1,
[email protected]9c1949e2009-10-02 19:59:5477
78 # Set to 1 to enable fast builds. It disables debug info for fastest
79 # compilation.
80 'fastbuild%': 0,
[email protected]84352455e72010-02-03 17:02:2781
82 # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
83 # libraries on linux x86-64 and arm.
84 'linux_fpic%': 0,
[email protected]eafc0b452010-02-26 21:53:4385
[email protected]a76fe1a2010-03-01 23:39:3686 # Python version.
87 'python_ver%': '2.5',
88
[email protected]eafc0b452010-02-26 21:53:4389 # Set ARM-v7 compilation flags
90 'armv7%': 0,
91
92 # Set Neon compilation flags (only meaningful if armv7==1).
93 'arm_neon%': 1,
[email protected]4d83eb72010-03-04 16:42:2394
95 # The system root for cross-compiles. Default: none.
96 'sysroot%': '',
[email protected]e14a9f92009-08-05 19:26:0797 },
98
99 # Define branding and buildtype on the basis of their settings within the
100 # variables sub-dict above, unless overridden.
101 'branding%': '<(branding)',
102 'buildtype%': '<(buildtype)',
[email protected]e0d00142009-09-18 22:10:27103 'target_arch%': '<(target_arch)',
[email protected]cf185b32010-01-12 04:29:59104 'host_arch%': '<(host_arch)',
[email protected]c153e5352009-09-22 12:37:44105 'toolkit_views%': '<(toolkit_views)',
106 'chromeos%': '<(chromeos)',
[email protected]b2f030c2009-09-24 20:36:21107 'inside_chromium_build%': '<(inside_chromium_build)',
[email protected]9c1949e2009-10-02 19:59:54108 'fastbuild%': '<(fastbuild)',
[email protected]84352455e72010-02-03 17:02:27109 'linux_fpic%': '<(linux_fpic)',
[email protected]a76fe1a2010-03-01 23:39:36110 'python_ver%': '<(python_ver)',
[email protected]eafc0b452010-02-26 21:53:43111 'armv7%': '<(armv7)',
112 'arm_neon%': '<(arm_neon)',
[email protected]4d83eb72010-03-04 16:42:23113 'sysroot%': '<(sysroot)',
[email protected]e14a9f92009-08-05 19:26:07114
[email protected]caa95c82009-11-23 22:39:32115 # The release channel that this build targets. This is used to restrict
116 # channel-specific build options, like which installer packages to create.
117 # The default is 'all', which does no channel-specific filtering.
118 'channel%': 'all',
119
[email protected]b3fb8092009-03-12 19:09:24120 # Override chromium_mac_pch and set it to 0 to suppress the use of
121 # precompiled headers on the Mac. Prefix header injection may still be
122 # used, but prefix headers will not be precompiled. This is useful when
123 # using distcc to distribute a build to compile slaves that don't
124 # share the same compiler executable as the system driving the compilation,
125 # because precompiled headers rely on pointers into a specific compiler
126 # executable's image. Setting this to 0 is needed to use an experimental
127 # Linux-Mac cross compiler distcc farm.
128 'chromium_mac_pch%': 1,
129
[email protected]3224dcd2009-09-16 17:31:25130 # Mac OS X SDK and deployment target support.
131 # The SDK identifies the version of the system headers that will be used,
132 # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
133 # "Maximum allowed" refers to the operating system version whose APIs are
134 # available in the headers.
135 # The deployment target identifies the minimum system version that the
136 # built products are expected to function on. It corresponds to the
137 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
138 # To ensure these macros are available, #include <AvailabilityMacros.h>.
139 # Additional documentation on these macros is available at
140 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
141 # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
142 # deployment target to 10.5. Other projects, such as O3D, may override
143 # these defaults.
144 'mac_sdk%': '10.5',
145 'mac_deployment_target%': '10.5',
[email protected]9543af052009-09-15 22:42:59146
[email protected]f5ecbba12009-04-03 04:35:18147 # Set to 1 to enable code coverage. In addition to build changes
148 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
149 # project file called "coverage".
150 # Currently ignored on Windows.
151 'coverage%': 0,
[email protected]653bd5f032009-04-08 12:55:49152
[email protected]c61f6432009-04-22 01:16:42153 # Overridable specification for potential use of alternative
154 # JavaScript engines.
155 'javascript_engine%': 'v8',
156
[email protected]7477ea6f2009-12-22 23:28:15157 # Although base/allocator lets you select a heap library via an
[email protected]7e0d664a2009-12-03 21:07:47158 # environment variable, the libcmt shim it uses sometimes gets in
159 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
160 # 'win_use_allocator_shim': 0,
161 # 'win_release_RuntimeLibrary': 2
162 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
163 'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
164
[email protected]653bd5f032009-04-08 12:55:49165 # To do a shared build on linux we need to be able to choose between type
166 # static_library and shared_library. We default to doing a static build
167 # but you can override this with "gyp -Dlibrary=shared_library" or you
168 # can add the following line (without the #) to ~/.gyp/include.gypi
169 # {'variables': {'library': 'shared_library'}}
170 # to compile as shared by default
171 'library%': 'static_library',
[email protected]279cd4212009-09-11 22:32:11172
[email protected]95ff8082009-11-13 22:21:01173 # Whether usage of OpenMAX is enabled.
174 'enable_openmax%': 0,
175
[email protected]e5b2eaa2009-04-14 01:39:12176 # TODO(bradnelson): eliminate this when possible.
177 # To allow local gyp files to prevent release.vsprops from being included.
178 # Yes(1) means include release.vsprops.
179 # Once all vsprops settings are migrated into gyp, this can go away.
180 'msvs_use_common_release%': 1,
[email protected]606116d22009-05-06 22:38:23181
[email protected]cbd5fd52009-08-26 00:14:27182 # TODO(bradnelson): eliminate this when possible.
183 # To allow local gyp files to override additional linker options for msvs.
184 # Yes(1) means set use the common linker options.
[email protected]48c7af72009-07-03 22:00:19185 'msvs_use_common_linker_extras%': 1,
186
[email protected]1ffb6502009-06-02 07:46:24187 # TODO(sgk): eliminate this if possible.
188 # It would be nicer to support this via a setting in 'target_defaults'
189 # in chrome/app/locales/locales.gypi overriding the setting in the
190 # 'Debug' configuration in the 'target_defaults' dict below,
191 # but that doesn't work as we'd like.
192 'msvs_debug_link_incremental%': '2',
193
[email protected]573136142009-07-15 22:48:37194 # This is the location of the sandbox binary. Chrome looks for this before
195 # running the zygote process. If found, and SUID, it will be used to
196 # sandbox the zygote process and, thus, all renderer processes.
197 'linux_sandbox_path%': '',
198
[email protected]ad6d2c42009-09-15 20:13:38199 # Set this to true to enable SELinux support.
200 'selinux%': 0,
[email protected]4c9cc6c2009-10-01 18:54:57201
[email protected]05cb6962009-10-01 23:29:03202 # Strip the binary after dumping symbols.
203 'linux_strip_binary%': 0,
204
[email protected]01699e22009-11-11 19:24:24205 # Enable TCMalloc.
[email protected]6cf24362010-01-21 02:46:50206 'linux_use_tcmalloc%': 0,
[email protected]01699e22009-11-11 19:24:24207
[email protected]c153e5352009-09-22 12:37:44208 # Set to select the Title Case versions of strings in GRD files.
209 'use_titlecase_in_grd_files%': 0,
[email protected]ad6d2c42009-09-15 20:13:38210
[email protected]d8c7cbcc2009-10-02 19:00:31211 # Used to disable Native Client at compile time, for platforms where it
212 # isn't supported
213 'disable_nacl%': 0,
214
[email protected]77c1b29392009-12-04 06:21:29215 # Set Thumb compilation flags.
216 'arm_thumb%': 0,
217
[email protected]912c55c2009-07-31 23:33:55218 'conditions': [
[email protected]47deeb62009-12-17 14:49:39219 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
[email protected]242a9e62009-11-03 17:32:10220 # This will set gcc_version to XY if you are running gcc X.Y.*.
221 # This is used to tweak build flags for gcc 4.4.
222 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
[email protected]4d83eb72010-03-04 16:42:23223 # Figure out the python architecture to decide if we build pyauto.
224 'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/bin/python<(python_ver))',
[email protected]cbd5fd52009-08-26 00:14:27225 'conditions': [
226 ['branding=="Chrome" or linux_chromium_breakpad==1', {
227 'linux_breakpad%': 1,
228 }, {
229 'linux_breakpad%': 0,
230 }],
[email protected]4c9cc6c2009-10-01 18:54:57231 # All Chrome builds have breakpad symbols, but only process the
232 # symbols from official builds.
233 # TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and
234 # crash server handle 64-bit symbols.
235 ['linux_chromium_dump_symbols==1 or '
236 '(branding=="Chrome" and buildtype=="Official" and '
237 'target_arch=="ia32")', {
238 'linux_dump_symbols%': 1,
239 }, {
240 'linux_dump_symbols%': 0,
241 }],
[email protected]d3a2cef2009-12-22 23:30:18242 ['toolkit_views==0 and chromeos==0', {
[email protected]c153e5352009-09-22 12:37:44243 # GTK wants Title Case strings
244 'use_titlecase_in_grd_files%': 1,
245 }],
[email protected]cbd5fd52009-08-26 00:14:27246 ],
[email protected]47deeb62009-12-17 14:49:39247 }], # OS=="linux" or OS=="freebsd" or OS=="openbsd"
[email protected]e14a9f92009-08-05 19:26:07248 ['OS=="mac"', {
[email protected]c153e5352009-09-22 12:37:44249 # Mac wants Title Case strings
250 'use_titlecase_in_grd_files%': 1,
[email protected]e14a9f92009-08-05 19:26:07251 'conditions': [
252 # mac_product_name is set to the name of the .app bundle as it should
253 # appear on disk. This duplicates data from
254 # chrome/app/theme/chromium/BRANDING and
255 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
256 # these names into the build system.
257 ['branding=="Chrome"', {
258 'mac_product_name%': 'Google Chrome',
259 }, { # else: branding!="Chrome"
260 'mac_product_name%': 'Chromium',
261 }],
262
263 # Feature variables for enabling Mac Breakpad and Keystone auto-update
264 # support. Both features are on by default in official builds with
265 # Chrome branding.
266 ['branding=="Chrome" and buildtype=="Official"', {
267 'mac_breakpad%': 1,
268 'mac_keystone%': 1,
269 }, { # else: branding!="Chrome" or buildtype!="Official"
270 'mac_breakpad%': 0,
271 'mac_keystone%': 0,
272 }],
273 ],
274 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55275 # Whether to use multiple cores to compile with visual studio. This is
276 # optional because it sometimes causes corruption on VS 2005.
277 # It is on by default on VS 2008 and off on VS 2005.
278 ['OS=="win"', {
279 'conditions': [
280 ['MSVS_VERSION=="2005"', {
[email protected]669795372009-08-14 17:51:13281 'msvs_multi_core_compile%': 0,
[email protected]912c55c2009-07-31 23:33:55282 },{
283 'msvs_multi_core_compile%': 1,
284 }],
[email protected]10bb8c92009-08-07 21:16:03285 # Don't do incremental linking for large modules on 32-bit.
286 ['MSVS_OS_BITS==32', {
287 'msvs_large_module_debug_link_mode%': '1', # No
288 },{
289 'msvs_large_module_debug_link_mode%': '2', # Yes
290 }],
[email protected]912c55c2009-07-31 23:33:55291 ],
[email protected]ef4fa4072009-12-04 22:46:50292 'nacl_win64_defines': [
293 # This flag is used to minimize dependencies when building
294 # Native Client loader for 64-bit Windows.
295 'NACL_WIN64',
296 ],
[email protected]912c55c2009-07-31 23:33:55297 }],
[email protected]43f28f832010-02-03 02:28:48298 # Compute based on OS and target architecture whether the GPU
299 # plugin / process is supported.
300 [ 'OS=="win" or (OS=="linux" and target_arch!="arm") or OS=="mac"', {
301 # Enable a variable used elsewhere throughout the GYP files to determine
302 # whether to compile in the sources for the GPU plugin / process.
303 'enable_gpu%': 1,
304 }, { # GPU plugin not supported
305 'enable_gpu%': 0,
306 }],
[email protected]912c55c2009-07-31 23:33:55307 ],
[email protected]f703c4e2009-09-17 21:54:28308
309 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
310 # so Cocoa is happy (http://crbug.com/20441).
311 'locales': [
[email protected]af27c8c2009-11-04 20:36:50312 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
[email protected]f703c4e2009-09-17 21:54:28313 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
314 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
315 'ml', 'mr', 'nb', 'nl', 'or', 'pl', 'pt-BR', 'pt-PT', 'ro',
[email protected]af27c8c2009-11-04 20:36:50316 'ru', 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr',
[email protected]f703c4e2009-09-17 21:54:28317 'uk', 'vi', 'zh-CN', 'zh-TW',
318 ],
[email protected]2f80c312009-02-25 21:26:55319 },
320 'target_defaults': {
[email protected]1c966092009-08-20 21:19:26321 'variables': {
[email protected]a6e22132010-02-10 20:43:18322 # The condition that operates on chromium_code is in a target_conditions
323 # section, and will not have access to the default fallback value of
324 # chromium_code at the top of this file, or to the chromium_code
325 # variable placed at the root variables scope of .gyp files, because
326 # those variables are not set at target scope. As a workaround,
327 # if chromium_code is not set at target scope, define it in target scope
328 # to contain whatever value it has during early variable expansion.
329 # That's enough to make it available during target conditional
330 # processing.
331 'chromium_code%': '<(chromium_code)',
332
[email protected]7e0d664a2009-12-03 21:07:47333 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
[email protected]d5d593a2009-08-28 23:23:29334 'mac_release_optimization%': '3', # Use -O3 unless overridden
[email protected]ffd984b12009-09-11 19:37:00335 'mac_debug_optimization%': '0', # Use -O0 unless overridden
[email protected]7e0d664a2009-12-03 21:07:47336 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
337 'win_release_Optimization%': '2', # 2 = /Os
338 'win_debug_Optimization%': '0', # 0 = /Od
339 # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
340 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
341 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
342
[email protected]ffd984b12009-09-11 19:37:00343 'release_extra_cflags%': '',
344 'debug_extra_cflags%': '',
[email protected]92822e82009-09-18 14:26:56345 'release_valgrind_build%': 0,
[email protected]1c966092009-08-20 21:19:26346 },
[email protected]32aa8cc2009-03-04 21:36:39347 'conditions': [
348 ['branding=="Chrome"', {
349 'defines': ['GOOGLE_CHROME_BUILD'],
350 }, { # else: branding!="Chrome"
351 'defines': ['CHROMIUM_BUILD'],
352 }],
[email protected]d3a2cef2009-12-22 23:30:18353 ['toolkit_views==1 or chromeos==1', {
[email protected]e6970232009-05-12 23:51:17354 'defines': ['TOOLKIT_VIEWS=1'],
355 }],
[email protected]fdc5bed2010-01-09 01:16:57356 ['chromeos==1', {
[email protected]16779842009-07-08 23:45:29357 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50358 }],
[email protected]9c1949e2009-10-02 19:59:54359 ['fastbuild!=0', {
360 'conditions': [
361 # Finally, for Windows, we simply turn on profiling.
362 ['OS=="win"', {
363 'msvs_settings': {
364 'VCLinkerTool': {
365 'GenerateDebugInformation': 'false',
366 },
367 'VCCLCompilerTool': {
368 'DebugInformationFormat': '0',
369 }
370 }
371 }], # OS==win
372 ], # conditions for fastbuild.
373 }], # fastbuild!=0
[email protected]ad6d2c42009-09-15 20:13:38374 ['selinux==1', {
375 'defines': ['CHROMIUM_SELINUX=1'],
376 }],
[email protected]7e0d664a2009-12-03 21:07:47377 ['win_use_allocator_shim==0', {
378 'conditions': [
379 ['OS=="win"', {
380 'defines': ['NO_TCMALLOC'],
381 }],
382 ],
383 }],
[email protected]43f28f832010-02-03 02:28:48384 ['enable_gpu==1', {
[email protected]7477ea6f2009-12-22 23:28:15385 'defines': [
386 'ENABLE_GPU=1',
387 ],
388 }],
[email protected]f5ecbba12009-04-03 04:35:18389 ['coverage!=0', {
390 'conditions': [
391 ['OS=="mac"', {
392 'xcode_settings': {
[email protected]ab2956372009-08-13 18:11:04393 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
394 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
[email protected]5ae4f55e2009-04-13 23:19:47395 },
[email protected]e4fb84c2009-12-28 20:45:43396 # Add -lgcov for types executable, shared_library, and
397 # loadable_module; not for static_library.
398 # This is a delayed conditional.
[email protected]f5ecbba12009-04-03 04:35:18399 'target_conditions': [
[email protected]e4fb84c2009-12-28 20:45:43400 ['_type!="static_library"', {
[email protected]f5ecbba12009-04-03 04:35:18401 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47402 }],
403 ],
404 }],
[email protected]7122ffd52009-04-30 23:19:00405 # Linux gyp (into scons) doesn't like target_conditions?
406 # TODO(???): track down why 'target_conditions' doesn't work
407 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18408 ['OS=="linux"', {
409 'cflags': [ '-ftest-coverage',
410 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00411 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18412 }],
[email protected]e8f6ff42009-07-07 18:20:53413 # Finally, for Windows, we simply turn on profiling.
414 ['OS=="win"', {
415 'msvs_settings': {
416 'VCLinkerTool': {
417 'Profile': 'true',
418 },
[email protected]10bb8c92009-08-07 21:16:03419 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53420 # /Z7, not /Zi, so coverage is happyb
421 'DebugInformationFormat': '1',
[email protected]1f9471a2010-01-04 06:40:16422 'AdditionalOptions': ['/Yd'],
[email protected]e8f6ff42009-07-07 18:20:53423 }
424 }
425 }], # OS==win
426 ], # conditions for coverage
427 }], # coverage!=0
[email protected]a6e22132010-02-10 20:43:18428 ], # conditions for 'target_defaults'
429 'target_conditions': [
[email protected]c14d8e772010-02-09 22:06:15430 ['chromium_code==0', {
[email protected]d8543312010-02-10 17:43:28431 'conditions': [
432 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
433 'cflags!': [
434 '-Wall',
435 '-Wextra',
436 '-Werror',
437 ],
438 }],
439 [ 'OS=="win"', {
440 'defines': [
441 '_CRT_SECURE_NO_DEPRECATE',
442 '_CRT_NONSTDC_NO_WARNINGS',
443 '_CRT_NONSTDC_NO_DEPRECATE',
444 '_SCL_SECURE_NO_DEPRECATE',
445 ],
446 'msvs_disabled_warnings': [4800],
447 'msvs_settings': {
448 'VCCLCompilerTool': {
449 'WarnAsError': 'false',
450 'Detect64BitPortabilityProblems': 'false',
451 },
452 },
453 }],
454 [ 'OS=="mac"', {
455 'xcode_settings': {
456 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
457 'WARNING_CFLAGS!': ['-Wall'],
458 },
459 }],
[email protected]c14d8e772010-02-09 22:06:15460 ],
461 }, {
462 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
463 # C99 macros on Mac and Linux.
464 'defines': [
465 '__STDC_FORMAT_MACROS',
466 ],
467 'conditions': [
468 ['OS!="win"', {
469 'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'],
470 ['exclude', '/win/'],
471 ['exclude', '/win_[^/]*\\.cc$'] ],
472 }],
473 ['OS!="mac"', {
474 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
475 ['exclude', '/(cocoa|mac)/'],
[email protected]e603d952010-02-10 22:36:26476 ['exclude', '\.mm?$' ] ],
[email protected]c14d8e772010-02-09 22:06:15477 }],
478 ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
479 'sources/': [
[email protected]18cff3d2010-02-17 18:03:13480 ['exclude', '_(chromeos|gtk|x|x11)(_unittest)?\\.cc$'],
[email protected]c14d8e772010-02-09 22:06:15481 ['exclude', '/gtk/'],
[email protected]18cff3d2010-02-17 18:03:13482 ['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
483 ],
484 }],
485 ['OS!="linux"', {
486 'sources/': [
487 ['exclude', '_linux(_unittest)?\\.cc$'],
488 ['exclude', '/linux/'],
489 ],
[email protected]c14d8e772010-02-09 22:06:15490 }],
491 # We use "POSIX" to refer to all non-Windows operating systems.
492 ['OS=="win"', {
493 'sources/': [ ['exclude', '_posix\\.cc$'] ],
494 }],
495 # Though Skia is conceptually shared by Linux and Windows,
496 # the only _skia files in our tree are Linux-specific.
497 ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
498 'sources/': [ ['exclude', '_skia\\.cc$'] ],
499 }],
500 ['chromeos!=1', {
501 'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
502 }],
503 ['OS!="win" and (toolkit_views==0 and chromeos==0)', {
504 'sources/': [ ['exclude', '_views\\.cc$'] ]
505 }],
506 ],
507 }],
[email protected]a6e22132010-02-10 20:43:18508 ], # target_conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55509 'default_configuration': 'Debug',
510 'configurations': {
[email protected]5153767c2009-12-22 01:52:50511 # VCLinkerTool LinkIncremental values below:
512 # 0 == default
513 # 1 == /INCREMENTAL:NO
514 # 2 == /INCREMENTAL
515 # Debug links incremental, Release does not.
516 #
517 # Abstract base configurations to cover common
518 # attributes.
519 #
520 'Common_Base': {
[email protected]bb05e452009-10-29 21:24:56521 'abstract': 1,
522 'msvs_configuration_attributes': {
523 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
524 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
525 'CharacterSet': '1',
526 },
[email protected]5153767c2009-12-22 01:52:50527 },
528 'x86_Base': {
529 'abstract': 1,
[email protected]ef4fa4072009-12-04 22:46:50530 'msvs_settings': {
531 'VCLinkerTool': {
532 'TargetMachine': '1',
533 },
534 },
[email protected]2fa40782009-11-01 21:17:34535 'msvs_configuration_platform': 'Win32',
[email protected]bb05e452009-10-29 21:24:56536 },
[email protected]5153767c2009-12-22 01:52:50537 'x64_Base': {
538 'abstract': 1,
539 'msvs_configuration_platform': 'x64',
540 'msvs_settings': {
541 'VCLinkerTool': {
542 'TargetMachine': '17', # x86 - 64
543 },
544 },
545 'msvs_settings': {
546 'VCLibrarianTool': {
547 'AdditionalLibraryDirectories!':
548 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
549 'AdditionalLibraryDirectories':
550 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
551 },
552 'VCLinkerTool': {
553 'TargetMachine': '17',
554 'AdditionalLibraryDirectories!':
555 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
556 'AdditionalLibraryDirectories':
557 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
558 },
559 },
560 'defines': [
561 # Not sure if tcmalloc works on 64-bit Windows.
562 'NO_TCMALLOC',
563 ],
564 },
565 'Debug_Base': {
566 'abstract': 1,
[email protected]1c966092009-08-20 21:19:26567 'xcode_settings': {
568 'COPY_PHASE_STRIP': 'NO',
[email protected]d5d593a2009-08-28 23:23:29569 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
[email protected]bd232ac2009-10-21 02:23:53570 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26571 },
[email protected]bb05e452009-10-29 21:24:56572 'msvs_settings': {
573 'VCCLCompilerTool': {
[email protected]7e0d664a2009-12-03 21:07:47574 'Optimization': '<(win_debug_Optimization)',
[email protected]bb05e452009-10-29 21:24:56575 'PreprocessorDefinitions': ['_DEBUG'],
576 'BasicRuntimeChecks': '3',
[email protected]7e0d664a2009-12-03 21:07:47577 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
[email protected]bb05e452009-10-29 21:24:56578 },
579 'VCLinkerTool': {
580 'LinkIncremental': '<(msvs_debug_link_incremental)',
581 },
582 'VCResourceCompilerTool': {
583 'PreprocessorDefinitions': ['_DEBUG'],
584 },
585 },
[email protected]2f80c312009-02-25 21:26:55586 'conditions': [
[email protected]bb05e452009-10-29 21:24:56587 ['OS=="linux"', {
588 'cflags': [
589 '<@(debug_extra_cflags)',
590 ],
[email protected]2f80c312009-02-25 21:26:55591 }],
592 ],
593 },
[email protected]5153767c2009-12-22 01:52:50594 'Release_Base': {
595 'abstract': 1,
[email protected]2f80c312009-02-25 21:26:55596 'defines': [
597 'NDEBUG',
598 ],
[email protected]1c966092009-08-20 21:19:26599 'xcode_settings': {
600 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
601 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
[email protected]ffd984b12009-09-11 19:37:00602 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26603 },
[email protected]bb05e452009-10-29 21:24:56604 'msvs_settings': {
[email protected]7e0d664a2009-12-03 21:07:47605 'VCCLCompilerTool': {
606 'Optimization': '<(win_release_Optimization)',
607 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
608 },
[email protected]bb05e452009-10-29 21:24:56609 'VCLinkerTool': {
610 'LinkIncremental': '1',
611 },
612 },
[email protected]2f80c312009-02-25 21:26:55613 'conditions': [
[email protected]92822e82009-09-18 14:26:56614 ['release_valgrind_build==0', {
615 'defines': ['NVALGRIND'],
616 }],
[email protected]7e0d664a2009-12-03 21:07:47617 ['win_use_allocator_shim==0', {
618 'defines': ['NO_TCMALLOC'],
619 }],
620 ['win_release_RuntimeLibrary==2', {
621 # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
[email protected]7477ea6f2009-12-22 23:28:15622 # VC\include\typeinfo(139) : warning C4275: non dll-interface
623 # class 'stdext::exception' used as base for dll-interface
[email protected]7e0d664a2009-12-03 21:07:47624 # class 'std::bad_cast'
625 'msvs_disabled_warnings': [4275],
626 }],
[email protected]bb05e452009-10-29 21:24:56627 ['OS=="linux"', {
628 'cflags': [
[email protected]ffd984b12009-09-11 19:37:00629 '<@(release_extra_cflags)',
[email protected]bb05e452009-10-29 21:24:56630 ],
631 }],
[email protected]2f80c312009-02-25 21:26:55632 ],
633 },
[email protected]5153767c2009-12-22 01:52:50634 'Purify_Base': {
635 'abstract': 1,
636 'defines': [
637 'PURIFY',
638 'NO_TCMALLOC',
639 ],
640 'msvs_settings': {
641 'VCCLCompilerTool': {
642 'Optimization': '0',
643 'RuntimeLibrary': '0',
644 'BufferSecurityCheck': 'false',
645 },
646 'VCLinkerTool': {
647 'EnableCOMDATFolding': '1',
648 'LinkIncremental': '1',
649 },
650 },
651 },
652 #
653 # Concrete configurations
654 #
655 'Debug': {
656 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
657 },
658 'Release': {
659 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
660 'conditions': [
661 ['msvs_use_common_release', {
[email protected]1f9471a2010-01-04 06:40:16662 'includes': ['release.gypi'],
[email protected]5153767c2009-12-22 01:52:50663 }],
664 ]
665 },
[email protected]f926fa0a2009-08-04 22:50:13666 'conditions': [
667 [ 'OS=="win"', {
668 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
669 'Purify': {
[email protected]5153767c2009-12-22 01:52:50670 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
[email protected]ef4fa4072009-12-04 22:46:50671 },
672 'Debug_x64': {
[email protected]5153767c2009-12-22 01:52:50673 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
[email protected]78263c12009-11-01 23:45:30674 },
675 'Release_x64': {
[email protected]5153767c2009-12-22 01:52:50676 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
[email protected]78263c12009-11-01 23:45:30677 },
678 'Purify_x64': {
[email protected]1f9471a2010-01-04 06:40:16679 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
[email protected]78263c12009-11-01 23:45:30680 },
[email protected]f926fa0a2009-08-04 22:50:13681 }],
682 ],
[email protected]2f80c312009-02-25 21:26:55683 },
684 },
685 'conditions': [
[email protected]47deeb62009-12-17 14:49:39686 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
[email protected]9d384032009-03-20 23:13:26687 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27688 # Enable -Werror by default, but put it in a variable so it can
689 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
690 'variables': {
[email protected]ecf52cb82010-01-13 19:25:42691 # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
692 # issues that slip through the cracks. We could do this just for
693 # gcc 4.4 but it makes more sense to be consistent on all
694 # compilers in use. TODO(Craig): turn this off again when
695 # there is some 4.4 test infrastructure in place and existing
696 # aliasing issues have been fixed.
697 'no_strict_aliasing%': 1,
[email protected]47deeb62009-12-17 14:49:39698 'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
699 ['OS=="freebsd"', {'werror%': '',}],
700 ['OS=="openbsd"', {'werror%': '',}],
701 ],
[email protected]5315f2842009-04-28 00:43:27702 },
[email protected]9d384032009-03-20 23:13:26703 'cflags': [
[email protected]1bba09c2009-08-13 12:53:16704 '<(werror)', # See note above about the werror variable.
705 '-pthread',
706 '-fno-exceptions',
707 '-Wall',
[email protected]225c8f52010-02-05 22:23:20708 # TODO(evan): turn this back on once the v8 change lands.
709 #'-Wextra',
710 # Don't warn about unused function params. We use those everywhere.
711 '-Wno-unused-parameter',
712 # Don't warn about the "struct foo f = {0};" initialization pattern.
713 '-Wno-missing-field-initializers',
[email protected]1bba09c2009-08-13 12:53:16714 '-D_FILE_OFFSET_BITS=64',
[email protected]3df6e3a2010-01-21 20:23:12715 # Don't export any symbols (for example, to plugins we dlopen()).
716 # Note: this is *required* to make some plugins work.
717 '-fvisibility=hidden',
[email protected]8a2fcba2009-07-29 00:52:24718 ],
719 'cflags_cc': [
[email protected]832d0212009-10-28 19:12:22720 '-fno-rtti',
[email protected]8a2fcba2009-07-29 00:52:24721 '-fno-threadsafe-statics',
[email protected]f5986c42009-11-17 18:39:36722 # Make inline functions have hidden visiblity by default.
723 # Surprisingly, not covered by -fvisibility=hidden.
724 '-fvisibility-inlines-hidden',
[email protected]9d384032009-03-20 23:13:26725 ],
[email protected]a6cf87e2009-04-03 04:07:38726 'ldflags': [
[email protected]9d384032009-03-20 23:13:26727 '-pthread',
728 ],
[email protected]b5e46b92009-03-26 18:58:10729 'scons_variable_settings': {
730 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26731 # Linking of large files uses lots of RAM, so serialize links
732 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01733 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31734 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
735 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26736
737 # We have several cases where archives depend on each other in
738 # a cyclic fashion. Since the GNU linker does only a single
739 # pass over the archives we surround the libraries with
740 # --start-group and --end-group (aka -( and -) ). That causes
741 # ld to loop over the group until no more undefined symbols
742 # are found. In an ideal world we would only make groups from
743 # those libraries which we knew to be in cycles. However,
744 # that's tough with SCons, so we bodge it by making all the
745 # archives a group by redefining the linking command here.
746 #
747 # TODO: investigate whether we still have cycles that
748 # require --{start,end}-group. There has been a lot of
749 # refactoring since this was first coded, which might have
750 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41751 #
752 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
753 # so that we prefer our own built libraries (e.g. -lpng) to
754 # system versions of libraries that pkg-config might turn up.
755 # TODO(sgk): investigate handling this not by re-ordering the
756 # flags this way, but by adding a hook to use the SCons
757 # ParseFlags() option on the output from pkg-config.
[email protected]610d8cc2009-09-19 00:47:04758 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
759 '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
760 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
761 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
762 '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
763 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
764 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
765 '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
766 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26767 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29768 # -rpath is only used when building with shared libraries.
769 'conditions': [
770 [ 'library=="shared_library"', {
771 'RPATH': '$LIB_DIR',
772 }],
773 ],
[email protected]9d384032009-03-20 23:13:26774 },
[email protected]b5e46b92009-03-26 18:58:10775 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49776 'AS',
[email protected]b5e46b92009-03-26 18:58:10777 'CC',
778 'CXX',
779 'LINK',
780 ],
781 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49782 'AS',
[email protected]b5e46b92009-03-26 18:58:10783 'CC',
784 'CCACHE_DIR',
785 'CXX',
786 'DISTCC_DIR',
787 'DISTCC_HOSTS',
788 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47789 'INCLUDE_SERVER_ARGS',
790 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10791 'LINK',
[email protected]fff920a2009-05-08 22:35:32792 'CHROME_BUILD_TYPE',
793 'CHROMIUM_BUILD',
794 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10795 ],
[email protected]3aacaf952009-04-02 15:34:09796 'configurations': {
[email protected]5153767c2009-12-22 01:52:50797 'Debug_Base': {
[email protected]c5bdc032009-04-20 19:11:31798 'variables': {
799 'debug_optimize%': '0',
800 },
[email protected]3aacaf952009-04-02 15:34:09801 'defines': [
802 '_DEBUG',
803 ],
804 'cflags': [
[email protected]22898f62009-10-26 22:14:01805 '-O>(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09806 '-g',
[email protected]9a5d2a52009-05-22 03:37:45807 # One can use '-gstabs' to enable building the debugging
808 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09809 ],
[email protected]96fd0032009-04-24 00:13:08810 'ldflags': [
811 '-rdynamic', # Allows backtrace to resolve symbols.
812 ],
[email protected]5315f2842009-04-28 00:43:27813 },
[email protected]5153767c2009-12-22 01:52:50814 'Release_Base': {
[email protected]740e2de2009-07-21 11:41:01815 'variables': {
816 'release_optimize%': '2',
817 },
[email protected]3aacaf952009-04-02 15:34:09818 'cflags': [
[email protected]22898f62009-10-26 22:14:01819 '-O>(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53820 # Don't emit the GCC version ident directives, they just end up
821 # in the .comment section taking up binary size.
822 '-fno-ident',
823 # Put data and code in their own sections, so that unused symbols
824 # can be removed at link time with --gc-sections.
825 '-fdata-sections',
826 '-ffunction-sections',
[email protected]3aacaf952009-04-02 15:34:09827 ],
[email protected]3a48e0542009-11-18 17:07:13828 'ldflags': [
829 '-Wl,--gc-sections',
830 ],
[email protected]3aacaf952009-04-02 15:34:09831 },
832 },
[email protected]601b540222009-04-03 21:32:04833 'variants': {
834 'coverage': {
835 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
836 'ldflags': ['-fprofile-arcs'],
837 },
838 'profile': {
839 'cflags': ['-pg', '-g'],
840 'ldflags': ['-pg'],
841 },
842 'symbols': {
843 'cflags': ['-g'],
844 },
845 },
[email protected]606116d22009-05-06 22:38:23846 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00847 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23848 'asflags': [
849 # Needed so that libs with .s files (e.g. libicudata.a)
850 # are compatible with the general 32-bit-ness.
851 '-32',
852 ],
853 # All floating-point computations on x87 happens in 80-bit
854 # precision. Because the C and C++ language standards allow
855 # the compiler to keep the floating-point values in higher
856 # precision than what's specified in the source and doing so
857 # is more efficient than constantly rounding up to 64-bit or
858 # 32-bit precision as specified in the source, the compiler,
859 # especially in the optimized mode, tries very hard to keep
860 # values in x87 floating-point stack (in 80-bit precision)
861 # as long as possible. This has important side effects, that
862 # the real value used in computation may change depending on
863 # how the compiler did the optimization - that is, the value
864 # kept in 80-bit is different than the value rounded down to
865 # 64-bit or 32-bit. There are possible compiler options to make
866 # this behavior consistent (e.g. -ffloat-store would keep all
867 # floating-values in the memory, thus force them to be rounded
868 # to its original precision) but they have significant runtime
869 # performance penalty.
870 #
871 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
872 # which keep floating-point values in SSE registers in its
873 # native precision (32-bit for single precision, and 64-bit for
874 # double precision values). This means the floating-point value
875 # used during computation does not change depending on how the
876 # compiler optimized the code, since the value is always kept
877 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06878 'conditions': [
879 ['branding=="Chromium"', {
880 'cflags': [
881 '-march=pentium4',
882 '-msse2',
883 '-mfpmath=sse',
884 ],
885 }],
886 ],
[email protected]606116d22009-05-06 22:38:23887 'cflags': [
888 '-m32',
[email protected]1c6560af2009-07-14 11:02:16889 ],
[email protected]606116d22009-05-06 22:38:23890 'ldflags': [
891 '-m32',
892 ],
893 }],
[email protected]3dda8a962009-08-10 18:58:07894 ['target_arch=="arm"', {
[email protected]77c1b29392009-12-04 06:21:29895 'target_conditions': [
896 ['_toolset=="target"', {
897 'cflags_cc': [
898 # The codesourcery arm-2009q3 toolchain warns at that the ABI
899 # has changed whenever it encounters a varargs function. This
900 # silences those warnings, as they are not helpful and
901 # clutter legitimate warnings.
902 '-Wno-abi',
903 ],
904 'conditions': [
905 ['arm_thumb == 1', {
906 'cflags': [
907 '-mthumb',
908 # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
909 # inline assembly that uses condition codes but it's
910 # suboptimal. Better would be to #ifdef __thumb__ at the
911 # right place and have a separate thumb path.
912 '-Wa,-mimplicit-it=thumb',
913 ]
914 }],
915 ['armv7==1', {
[email protected]dc9711f2009-11-13 19:30:25916 'cflags': [
917 '-march=armv7-a',
918 '-mtune=cortex-a8',
[email protected]dc9711f2009-11-13 19:30:25919 '-mfloat-abi=softfp',
920 ],
[email protected]eafc0b452010-02-26 21:53:43921 'conditions': [
922 ['arm_neon==1', {
923 'cflags': [ '-mfpu=neon', ],
924 }, {
925 'cflags': [ '-mfpu=vfpv3', ],
926 }]
927 ],
[email protected]dc9711f2009-11-13 19:30:25928 }],
[email protected]3dda8a962009-08-10 18:58:07929 ],
930 }],
931 ],
932 }],
[email protected]c76723a2010-01-25 23:10:58933 ['linux_fpic==1', {
934 'cflags': [
935 '-fPIC',
936 ],
937 }],
[email protected]ee28c9f2009-09-04 01:53:01938 ['sysroot!=""', {
[email protected]fd36ce822009-10-28 20:13:57939 'target_conditions': [
940 ['_toolset=="target"', {
941 'cflags': [
942 '--sysroot=<(sysroot)',
943 ],
944 'ldflags': [
945 '--sysroot=<(sysroot)',
946 ],
947 }]]
[email protected]ee28c9f2009-09-04 01:53:01948 }],
[email protected]cc4219a2009-08-14 05:30:52949 ['no_strict_aliasing==1', {
950 'cflags': [
951 '-fno-strict-aliasing',
952 ],
953 }],
[email protected]cbd5fd52009-08-26 00:14:27954 ['linux_breakpad==1', {
955 'cflags': [ '-gstabs' ],
956 'defines': ['USE_LINUX_BREAKPAD'],
957 }],
[email protected]7cd2afd2009-10-27 21:40:26958 ['library=="shared_library"', {
959 # When building with shared libraries, remove the visiblity-hiding
960 # flag.
961 'cflags!': [ '-fvisibility=hidden' ],
[email protected]4907ac42009-11-02 20:32:51962 'conditions': [
[email protected]08be8a72009-11-18 20:35:54963 ['target_arch=="x64" or target_arch=="arm"', {
964 # Shared libraries need -fPIC on x86-64 and arm
[email protected]4907ac42009-11-02 20:32:51965 'cflags': ['-fPIC']
966 }]
967 ],
[email protected]7cd2afd2009-10-27 21:40:26968 }],
[email protected]61a9b2d82010-02-26 00:31:08969 ['linux_use_tcmalloc==0', {
970 'defines': ['NO_TCMALLOC'],
[email protected]01699e22009-11-11 19:24:24971 }],
[email protected]606116d22009-05-06 22:38:23972 ],
[email protected]9d384032009-03-20 23:13:26973 },
974 }],
[email protected]c51e8d52009-12-11 20:04:06975 # FreeBSD-specific options; note that most FreeBSD options are set above,
976 # with Linux.
977 ['OS=="freebsd"', {
978 'target_defaults': {
979 'ldflags': [
980 '-Wl,--no-keep-memory',
981 ],
982 },
983 }],
[email protected]2f80c312009-02-25 21:26:55984 ['OS=="mac"', {
985 'target_defaults': {
[email protected]24700642009-06-01 16:01:20986 'variables': {
987 # This should be 'mac_real_dsym%', but there seems to be a bug
988 # with % in variables that are intended to be set to different
989 # values in different targets, like this one.
990 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
991 },
[email protected]d92c7c012009-03-19 19:26:42992 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:55993 'xcode_settings': {
994 'ALWAYS_SEARCH_USER_PATHS': 'NO',
[email protected]ab2956372009-08-13 18:11:04995 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
996 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
997 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
998 # (Equivalent to -fPIC)
999 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
1000 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
1001 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
[email protected]3224dcd2009-09-16 17:31:251002 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
1003 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
[email protected]ab2956372009-08-13 18:11:041004 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
1005 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
1006 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
1007 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
[email protected]2f80c312009-02-25 21:26:551008 'GCC_VERSION': '4.2',
[email protected]ab2956372009-08-13 18:11:041009 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
[email protected]3224dcd2009-09-16 17:31:251010 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
1011 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
[email protected]ab2956372009-08-13 18:11:041012 'PREBINDING': 'NO', # No -Wl,-prebind
[email protected]2f80c312009-02-25 21:26:551013 'USE_HEADERMAP': 'NO',
1014 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:241015 'conditions': [
1016 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
[email protected]9543af052009-09-15 22:42:591017 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
1018 ],
[email protected]b3fb8092009-03-12 19:09:241019 ],
[email protected]2f80c312009-02-25 21:26:551020 },
1021 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:551022 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:461023 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
1024 }],
1025 ['_mac_bundle', {
1026 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:081027 }],
[email protected]e14a9f92009-08-05 19:26:071028 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:201029 'target_conditions': [
1030 ['mac_real_dsym == 1', {
1031 # To get a real .dSYM bundle produced by dsymutil, set the
1032 # debug information format to dwarf-with-dsym. Since
1033 # strip_from_xcode will not be used, set Xcode to do the
1034 # stripping as well.
1035 'configurations': {
[email protected]5153767c2009-12-22 01:52:501036 'Release_Base': {
[email protected]24700642009-06-01 16:01:201037 'xcode_settings': {
1038 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
1039 'DEPLOYMENT_POSTPROCESSING': 'YES',
1040 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:071041 'target_conditions': [
1042 ['_type=="shared_library"', {
1043 # The Xcode default is to strip debugging symbols
1044 # only (-S). Local symbols should be stripped as
1045 # well, which will be handled by -x. Xcode will
1046 # continue to insert -S when stripping even when
1047 # additional flags are added with STRIPFLAGS.
1048 'STRIPFLAGS': '-x',
1049 }], # _type=="shared_library"
1050 ], # target_conditions
1051 }, # xcode_settings
1052 }, # configuration "Release"
1053 }, # configurations
[email protected]24700642009-06-01 16:01:201054 }, { # mac_real_dsym != 1
1055 # To get a fast fake .dSYM bundle, use a post-build step to
1056 # produce the .dSYM and strip the executable. strip_from_xcode
1057 # only operates in the Release configuration.
1058 'postbuilds': [
1059 {
1060 'variables': {
1061 # Define strip_from_xcode in a variable ending in _path
1062 # so that gyp understands it's a path and performs proper
1063 # relativization during dict merging.
1064 'strip_from_xcode_path': 'mac/strip_from_xcode',
1065 },
1066 'postbuild_name': 'Strip If Needed',
1067 'action': ['<(strip_from_xcode_path)'],
1068 },
[email protected]e14a9f92009-08-05 19:26:071069 ], # postbuilds
1070 }], # mac_real_dsym
1071 ], # target_conditions
1072 }], # _type=="executable" or _type=="shared_library"
1073 ], # target_conditions
1074 }, # target_defaults
1075 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:551076 ['OS=="win"', {
1077 'target_defaults': {
1078 'defines': [
1079 '_WIN32_WINNT=0x0600',
1080 'WINVER=0x0600',
1081 'WIN32',
1082 '_WINDOWS',
1083 '_HAS_EXCEPTIONS=0',
1084 'NOMINMAX',
1085 '_CRT_RAND_S',
1086 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
1087 'WIN32_LEAN_AND_MEAN',
1088 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:451089 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:551090 ],
[email protected]5b5ca7cb2009-07-20 23:00:201091 'msvs_system_include_dirs': [
[email protected]998b5152009-12-12 22:19:521092 '<(DEPTH)/third_party/platformsdk_win7/files/Include',
[email protected]2f80c312009-02-25 21:26:551093 '$(VSInstallDir)/VC/atlmfc/include',
1094 ],
[email protected]a8d99cef2009-08-26 20:47:491095 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:551096 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:551097 'msvs_settings': {
1098 'VCCLCompilerTool': {
1099 'MinimalRebuild': 'false',
1100 'ExceptionHandling': '0',
1101 'BufferSecurityCheck': 'true',
1102 'EnableFunctionLevelLinking': 'true',
1103 'RuntimeTypeInfo': 'false',
1104 'WarningLevel': '3',
1105 'WarnAsError': 'true',
1106 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:581107 'conditions': [
[email protected]912c55c2009-07-31 23:33:551108 [ 'msvs_multi_core_compile', {
[email protected]1f9471a2010-01-04 06:40:161109 'AdditionalOptions': ['/MP'],
[email protected]912c55c2009-07-31 23:33:551110 }],
[email protected]3fef6e62009-07-31 19:58:581111 ],
[email protected]2f80c312009-02-25 21:26:551112 },
1113 'VCLibrarianTool': {
[email protected]1f9471a2010-01-04 06:40:161114 'AdditionalOptions': ['/ignore:4221'],
[email protected]2f80c312009-02-25 21:26:551115 'AdditionalLibraryDirectories':
[email protected]998b5152009-12-12 22:19:521116 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
[email protected]2f80c312009-02-25 21:26:551117 },
1118 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:551119 'AdditionalDependencies': [
1120 'wininet.lib',
1121 'version.lib',
1122 'msimg32.lib',
1123 'ws2_32.lib',
1124 'usp10.lib',
1125 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:081126 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:551127 ],
1128 'AdditionalLibraryDirectories':
[email protected]998b5152009-12-12 22:19:521129 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
[email protected]2f80c312009-02-25 21:26:551130 'GenerateDebugInformation': 'true',
1131 'MapFileName': '$(OutDir)\\$(TargetName).map',
1132 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
[email protected]2f80c312009-02-25 21:26:551133 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:481134 # SubSystem values:
1135 # 0 == not set
1136 # 1 == /SUBSYSTEM:CONSOLE
1137 # 2 == /SUBSYSTEM:WINDOWS
1138 # Most of the executables we'll ever create are tests
1139 # and utilities with console output.
1140 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:551141 },
1142 'VCMIDLTool': {
1143 'GenerateStublessProxies': 'true',
1144 'TypeLibraryName': '$(InputName).tlb',
1145 'OutputDirectory': '$(IntDir)',
1146 'HeaderFileName': '$(InputName).h',
1147 'DLLDataFileName': 'dlldata.c',
1148 'InterfaceIdentifierFileName': '$(InputName)_i.c',
1149 'ProxyFileName': '$(InputName)_p.c',
1150 },
1151 'VCResourceCompilerTool': {
1152 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:141153 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:551154 },
1155 },
1156 },
1157 }],
[email protected]47deeb62009-12-17 14:49:391158 # Disable native client on FreeBSD/OpenBSD for now
1159 ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd"', {
[email protected]d8c7cbcc2009-10-02 19:00:311160 'target_defaults': {
1161 'defines': [
1162 'DISABLE_NACL',
1163 ],
1164 },
1165 }],
[email protected]cfbf9bc2009-12-07 22:07:561166 ['OS=="win" and msvs_use_common_linker_extras', {
[email protected]48c7af72009-07-03 22:00:191167 'target_defaults': {
1168 'msvs_settings': {
1169 'VCLinkerTool': {
[email protected]48c7af72009-07-03 22:00:191170 'DelayLoadDLLs': [
1171 'dbghelp.dll',
1172 'dwmapi.dll',
1173 'uxtheme.dll',
1174 ],
1175 },
1176 },
[email protected]ef4fa4072009-12-04 22:46:501177 'configurations': {
[email protected]5153767c2009-12-22 01:52:501178 'x86_Base': {
[email protected]ef4fa4072009-12-04 22:46:501179 'msvs_settings': {
1180 'VCLinkerTool': {
[email protected]1f9471a2010-01-04 06:40:161181 'AdditionalOptions': [
1182 '/safeseh',
1183 '/dynamicbase',
1184 '/ignore:4199',
1185 '/ignore:4221',
1186 '/nxcompat',
1187 ],
[email protected]ef4fa4072009-12-04 22:46:501188 },
1189 },
1190 },
[email protected]5153767c2009-12-22 01:52:501191 'x64_Base': {
[email protected]ef4fa4072009-12-04 22:46:501192 'msvs_settings': {
1193 'VCLinkerTool': {
[email protected]1f9471a2010-01-04 06:40:161194 'AdditionalOptions': [
[email protected]ef4fa4072009-12-04 22:46:501195 # safeseh is not compatible with x64
[email protected]1f9471a2010-01-04 06:40:161196 '/dynamicbase',
1197 '/ignore:4199',
1198 '/ignore:4221',
1199 '/nxcompat',
1200 ],
[email protected]ef4fa4072009-12-04 22:46:501201 },
1202 },
1203 },
1204 },
[email protected]48c7af72009-07-03 22:00:191205 },
1206 }],
[email protected]2f80c312009-02-25 21:26:551207 ],
[email protected]c13fcbd2009-03-27 04:27:011208 'scons_settings': {
1209 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:071210 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:011211 },
[email protected]2f80c312009-02-25 21:26:551212 'xcode_settings': {
[email protected]0c8ab452009-11-06 21:57:501213 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
1214 # This block adds *project-wide* configuration settings to each project
1215 # file. It's almost always wrong to put things here. Specify your
1216 # custom xcode_settings in target_defaults to add them to targets instead.
1217
1218 # In an Xcode Project Info window, the "Base SDK for All Configurations"
1219 # setting sets the SDK on a project-wide basis. In order to get the
1220 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
1221 # here at the project level.
1222 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
1223
[email protected]2f80c312009-02-25 21:26:551224 # The Xcode generator will look for an xcode_settings section at the root
1225 # of each dict and use it to apply settings on a file-wide basis. Most
1226 # settings should not be here, they should be in target-specific
1227 # xcode_settings sections, or better yet, should use non-Xcode-specific
1228 # settings in target dicts. SYMROOT is a special case, because many other
1229 # Xcode variables depend on it, including variables such as
1230 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
1231 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
1232 # files to appear (when present) in the UI as actual files and not red
1233 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
1234 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:161235 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:551236 },
[email protected]ee28c9f2009-09-04 01:53:011237}
[email protected]f5c990c2009-10-06 03:02:381238
1239# Local Variables:
1240# tab-width:2
1241# indent-tabs-mode:nil
1242# End:
1243# vim: set expandtab tabstop=2 shiftwidth=2: