blob: 6c702ef0658c87d3f2a190e14c65f6bf186a8210 [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]e14a9f92009-08-05 19:26:0794 },
95
96 # Define branding and buildtype on the basis of their settings within the
97 # variables sub-dict above, unless overridden.
98 'branding%': '<(branding)',
99 'buildtype%': '<(buildtype)',
[email protected]e0d00142009-09-18 22:10:27100 'target_arch%': '<(target_arch)',
[email protected]cf185b32010-01-12 04:29:59101 'host_arch%': '<(host_arch)',
[email protected]c153e5352009-09-22 12:37:44102 'toolkit_views%': '<(toolkit_views)',
103 'chromeos%': '<(chromeos)',
[email protected]b2f030c2009-09-24 20:36:21104 'inside_chromium_build%': '<(inside_chromium_build)',
[email protected]9c1949e2009-10-02 19:59:54105 'fastbuild%': '<(fastbuild)',
[email protected]84352455e72010-02-03 17:02:27106 'linux_fpic%': '<(linux_fpic)',
[email protected]a76fe1a2010-03-01 23:39:36107 'python_ver%': '<(python_ver)',
[email protected]eafc0b452010-02-26 21:53:43108 'armv7%': '<(armv7)',
109 'arm_neon%': '<(arm_neon)',
[email protected]e14a9f92009-08-05 19:26:07110
[email protected]caa95c82009-11-23 22:39:32111 # The release channel that this build targets. This is used to restrict
112 # channel-specific build options, like which installer packages to create.
113 # The default is 'all', which does no channel-specific filtering.
114 'channel%': 'all',
115
[email protected]b3fb8092009-03-12 19:09:24116 # Override chromium_mac_pch and set it to 0 to suppress the use of
117 # precompiled headers on the Mac. Prefix header injection may still be
118 # used, but prefix headers will not be precompiled. This is useful when
119 # using distcc to distribute a build to compile slaves that don't
120 # share the same compiler executable as the system driving the compilation,
121 # because precompiled headers rely on pointers into a specific compiler
122 # executable's image. Setting this to 0 is needed to use an experimental
123 # Linux-Mac cross compiler distcc farm.
124 'chromium_mac_pch%': 1,
125
[email protected]3224dcd2009-09-16 17:31:25126 # Mac OS X SDK and deployment target support.
127 # The SDK identifies the version of the system headers that will be used,
128 # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
129 # "Maximum allowed" refers to the operating system version whose APIs are
130 # available in the headers.
131 # The deployment target identifies the minimum system version that the
132 # built products are expected to function on. It corresponds to the
133 # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
134 # To ensure these macros are available, #include <AvailabilityMacros.h>.
135 # Additional documentation on these macros is available at
136 # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
137 # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
138 # deployment target to 10.5. Other projects, such as O3D, may override
139 # these defaults.
140 'mac_sdk%': '10.5',
141 'mac_deployment_target%': '10.5',
[email protected]9543af052009-09-15 22:42:59142
[email protected]f5ecbba12009-04-03 04:35:18143 # Set to 1 to enable code coverage. In addition to build changes
144 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
145 # project file called "coverage".
146 # Currently ignored on Windows.
147 'coverage%': 0,
[email protected]653bd5f032009-04-08 12:55:49148
[email protected]c61f6432009-04-22 01:16:42149 # Overridable specification for potential use of alternative
150 # JavaScript engines.
151 'javascript_engine%': 'v8',
152
[email protected]7477ea6f2009-12-22 23:28:15153 # Although base/allocator lets you select a heap library via an
[email protected]7e0d664a2009-12-03 21:07:47154 # environment variable, the libcmt shim it uses sometimes gets in
155 # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
156 # 'win_use_allocator_shim': 0,
157 # 'win_release_RuntimeLibrary': 2
158 # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
159 'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
160
[email protected]653bd5f032009-04-08 12:55:49161 # To do a shared build on linux we need to be able to choose between type
162 # static_library and shared_library. We default to doing a static build
163 # but you can override this with "gyp -Dlibrary=shared_library" or you
164 # can add the following line (without the #) to ~/.gyp/include.gypi
165 # {'variables': {'library': 'shared_library'}}
166 # to compile as shared by default
167 'library%': 'static_library',
[email protected]279cd4212009-09-11 22:32:11168
[email protected]95ff8082009-11-13 22:21:01169 # Whether usage of OpenMAX is enabled.
170 'enable_openmax%': 0,
171
[email protected]e5b2eaa2009-04-14 01:39:12172 # TODO(bradnelson): eliminate this when possible.
173 # To allow local gyp files to prevent release.vsprops from being included.
174 # Yes(1) means include release.vsprops.
175 # Once all vsprops settings are migrated into gyp, this can go away.
176 'msvs_use_common_release%': 1,
[email protected]606116d22009-05-06 22:38:23177
[email protected]cbd5fd52009-08-26 00:14:27178 # TODO(bradnelson): eliminate this when possible.
179 # To allow local gyp files to override additional linker options for msvs.
180 # Yes(1) means set use the common linker options.
[email protected]48c7af72009-07-03 22:00:19181 'msvs_use_common_linker_extras%': 1,
182
[email protected]1ffb6502009-06-02 07:46:24183 # TODO(sgk): eliminate this if possible.
184 # It would be nicer to support this via a setting in 'target_defaults'
185 # in chrome/app/locales/locales.gypi overriding the setting in the
186 # 'Debug' configuration in the 'target_defaults' dict below,
187 # but that doesn't work as we'd like.
188 'msvs_debug_link_incremental%': '2',
189
[email protected]ee28c9f2009-09-04 01:53:01190 # The system root for cross-compiles. Default: none.
191 'sysroot%': '',
192
[email protected]573136142009-07-15 22:48:37193 # This is the location of the sandbox binary. Chrome looks for this before
194 # running the zygote process. If found, and SUID, it will be used to
195 # sandbox the zygote process and, thus, all renderer processes.
196 'linux_sandbox_path%': '',
197
[email protected]ad6d2c42009-09-15 20:13:38198 # Set this to true to enable SELinux support.
199 'selinux%': 0,
[email protected]4c9cc6c2009-10-01 18:54:57200
[email protected]05cb6962009-10-01 23:29:03201 # Strip the binary after dumping symbols.
202 'linux_strip_binary%': 0,
203
[email protected]01699e22009-11-11 19:24:24204 # Enable TCMalloc.
[email protected]6cf24362010-01-21 02:46:50205 'linux_use_tcmalloc%': 0,
[email protected]01699e22009-11-11 19:24:24206
[email protected]c153e5352009-09-22 12:37:44207 # Set to select the Title Case versions of strings in GRD files.
208 'use_titlecase_in_grd_files%': 0,
[email protected]ad6d2c42009-09-15 20:13:38209
[email protected]d8c7cbcc2009-10-02 19:00:31210 # Used to disable Native Client at compile time, for platforms where it
211 # isn't supported
212 'disable_nacl%': 0,
213
[email protected]77c1b29392009-12-04 06:21:29214 # Set Thumb compilation flags.
215 'arm_thumb%': 0,
216
[email protected]912c55c2009-07-31 23:33:55217 'conditions': [
[email protected]47deeb62009-12-17 14:49:39218 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
[email protected]242a9e62009-11-03 17:32:10219 # This will set gcc_version to XY if you are running gcc X.Y.*.
220 # This is used to tweak build flags for gcc 4.4.
221 'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
[email protected]cbd5fd52009-08-26 00:14:27222 'conditions': [
223 ['branding=="Chrome" or linux_chromium_breakpad==1', {
224 'linux_breakpad%': 1,
225 }, {
226 'linux_breakpad%': 0,
227 }],
[email protected]4c9cc6c2009-10-01 18:54:57228 # All Chrome builds have breakpad symbols, but only process the
229 # symbols from official builds.
230 # TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and
231 # crash server handle 64-bit symbols.
232 ['linux_chromium_dump_symbols==1 or '
233 '(branding=="Chrome" and buildtype=="Official" and '
234 'target_arch=="ia32")', {
235 'linux_dump_symbols%': 1,
236 }, {
237 'linux_dump_symbols%': 0,
238 }],
[email protected]d3a2cef2009-12-22 23:30:18239 ['toolkit_views==0 and chromeos==0', {
[email protected]c153e5352009-09-22 12:37:44240 # GTK wants Title Case strings
241 'use_titlecase_in_grd_files%': 1,
242 }],
[email protected]cbd5fd52009-08-26 00:14:27243 ],
[email protected]47deeb62009-12-17 14:49:39244 }], # OS=="linux" or OS=="freebsd" or OS=="openbsd"
[email protected]e14a9f92009-08-05 19:26:07245 ['OS=="mac"', {
[email protected]c153e5352009-09-22 12:37:44246 # Mac wants Title Case strings
247 'use_titlecase_in_grd_files%': 1,
[email protected]e14a9f92009-08-05 19:26:07248 'conditions': [
249 # mac_product_name is set to the name of the .app bundle as it should
250 # appear on disk. This duplicates data from
251 # chrome/app/theme/chromium/BRANDING and
252 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
253 # these names into the build system.
254 ['branding=="Chrome"', {
255 'mac_product_name%': 'Google Chrome',
256 }, { # else: branding!="Chrome"
257 'mac_product_name%': 'Chromium',
258 }],
259
260 # Feature variables for enabling Mac Breakpad and Keystone auto-update
261 # support. Both features are on by default in official builds with
262 # Chrome branding.
263 ['branding=="Chrome" and buildtype=="Official"', {
264 'mac_breakpad%': 1,
265 'mac_keystone%': 1,
266 }, { # else: branding!="Chrome" or buildtype!="Official"
267 'mac_breakpad%': 0,
268 'mac_keystone%': 0,
269 }],
270 ],
271 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55272 # Whether to use multiple cores to compile with visual studio. This is
273 # optional because it sometimes causes corruption on VS 2005.
274 # It is on by default on VS 2008 and off on VS 2005.
275 ['OS=="win"', {
276 'conditions': [
277 ['MSVS_VERSION=="2005"', {
[email protected]669795372009-08-14 17:51:13278 'msvs_multi_core_compile%': 0,
[email protected]912c55c2009-07-31 23:33:55279 },{
280 'msvs_multi_core_compile%': 1,
281 }],
[email protected]10bb8c92009-08-07 21:16:03282 # Don't do incremental linking for large modules on 32-bit.
283 ['MSVS_OS_BITS==32', {
284 'msvs_large_module_debug_link_mode%': '1', # No
285 },{
286 'msvs_large_module_debug_link_mode%': '2', # Yes
287 }],
[email protected]912c55c2009-07-31 23:33:55288 ],
[email protected]ef4fa4072009-12-04 22:46:50289 'nacl_win64_defines': [
290 # This flag is used to minimize dependencies when building
291 # Native Client loader for 64-bit Windows.
292 'NACL_WIN64',
293 ],
[email protected]912c55c2009-07-31 23:33:55294 }],
[email protected]43f28f832010-02-03 02:28:48295 # Compute based on OS and target architecture whether the GPU
296 # plugin / process is supported.
297 [ 'OS=="win" or (OS=="linux" and target_arch!="arm") or OS=="mac"', {
298 # Enable a variable used elsewhere throughout the GYP files to determine
299 # whether to compile in the sources for the GPU plugin / process.
300 'enable_gpu%': 1,
301 }, { # GPU plugin not supported
302 'enable_gpu%': 0,
303 }],
[email protected]912c55c2009-07-31 23:33:55304 ],
[email protected]f703c4e2009-09-17 21:54:28305
306 # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
307 # so Cocoa is happy (http://crbug.com/20441).
308 'locales': [
[email protected]af27c8c2009-11-04 20:36:50309 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
[email protected]f703c4e2009-09-17 21:54:28310 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
311 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
312 'ml', 'mr', 'nb', 'nl', 'or', 'pl', 'pt-BR', 'pt-PT', 'ro',
[email protected]af27c8c2009-11-04 20:36:50313 'ru', 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr',
[email protected]f703c4e2009-09-17 21:54:28314 'uk', 'vi', 'zh-CN', 'zh-TW',
315 ],
[email protected]2f80c312009-02-25 21:26:55316 },
317 'target_defaults': {
[email protected]1c966092009-08-20 21:19:26318 'variables': {
[email protected]a6e22132010-02-10 20:43:18319 # The condition that operates on chromium_code is in a target_conditions
320 # section, and will not have access to the default fallback value of
321 # chromium_code at the top of this file, or to the chromium_code
322 # variable placed at the root variables scope of .gyp files, because
323 # those variables are not set at target scope. As a workaround,
324 # if chromium_code is not set at target scope, define it in target scope
325 # to contain whatever value it has during early variable expansion.
326 # That's enough to make it available during target conditional
327 # processing.
328 'chromium_code%': '<(chromium_code)',
329
[email protected]7e0d664a2009-12-03 21:07:47330 # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
[email protected]d5d593a2009-08-28 23:23:29331 'mac_release_optimization%': '3', # Use -O3 unless overridden
[email protected]ffd984b12009-09-11 19:37:00332 'mac_debug_optimization%': '0', # Use -O0 unless overridden
[email protected]7e0d664a2009-12-03 21:07:47333 # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
334 'win_release_Optimization%': '2', # 2 = /Os
335 'win_debug_Optimization%': '0', # 0 = /Od
336 # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
337 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
338 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
339
[email protected]ffd984b12009-09-11 19:37:00340 'release_extra_cflags%': '',
341 'debug_extra_cflags%': '',
[email protected]92822e82009-09-18 14:26:56342 'release_valgrind_build%': 0,
[email protected]1c966092009-08-20 21:19:26343 },
[email protected]32aa8cc2009-03-04 21:36:39344 'conditions': [
345 ['branding=="Chrome"', {
346 'defines': ['GOOGLE_CHROME_BUILD'],
347 }, { # else: branding!="Chrome"
348 'defines': ['CHROMIUM_BUILD'],
349 }],
[email protected]d3a2cef2009-12-22 23:30:18350 ['toolkit_views==1 or chromeos==1', {
[email protected]e6970232009-05-12 23:51:17351 'defines': ['TOOLKIT_VIEWS=1'],
352 }],
[email protected]fdc5bed2010-01-09 01:16:57353 ['chromeos==1', {
[email protected]16779842009-07-08 23:45:29354 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50355 }],
[email protected]9c1949e2009-10-02 19:59:54356 ['fastbuild!=0', {
357 'conditions': [
358 # Finally, for Windows, we simply turn on profiling.
359 ['OS=="win"', {
360 'msvs_settings': {
361 'VCLinkerTool': {
362 'GenerateDebugInformation': 'false',
363 },
364 'VCCLCompilerTool': {
365 'DebugInformationFormat': '0',
366 }
367 }
368 }], # OS==win
369 ], # conditions for fastbuild.
370 }], # fastbuild!=0
[email protected]ad6d2c42009-09-15 20:13:38371 ['selinux==1', {
372 'defines': ['CHROMIUM_SELINUX=1'],
373 }],
[email protected]7e0d664a2009-12-03 21:07:47374 ['win_use_allocator_shim==0', {
375 'conditions': [
376 ['OS=="win"', {
377 'defines': ['NO_TCMALLOC'],
378 }],
379 ],
380 }],
[email protected]43f28f832010-02-03 02:28:48381 ['enable_gpu==1', {
[email protected]7477ea6f2009-12-22 23:28:15382 'defines': [
383 'ENABLE_GPU=1',
384 ],
385 }],
[email protected]f5ecbba12009-04-03 04:35:18386 ['coverage!=0', {
387 'conditions': [
388 ['OS=="mac"', {
389 'xcode_settings': {
[email protected]ab2956372009-08-13 18:11:04390 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
391 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
[email protected]5ae4f55e2009-04-13 23:19:47392 },
[email protected]e4fb84c2009-12-28 20:45:43393 # Add -lgcov for types executable, shared_library, and
394 # loadable_module; not for static_library.
395 # This is a delayed conditional.
[email protected]f5ecbba12009-04-03 04:35:18396 'target_conditions': [
[email protected]e4fb84c2009-12-28 20:45:43397 ['_type!="static_library"', {
[email protected]f5ecbba12009-04-03 04:35:18398 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47399 }],
400 ],
401 }],
[email protected]7122ffd52009-04-30 23:19:00402 # Linux gyp (into scons) doesn't like target_conditions?
403 # TODO(???): track down why 'target_conditions' doesn't work
404 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18405 ['OS=="linux"', {
406 'cflags': [ '-ftest-coverage',
407 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00408 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18409 }],
[email protected]e8f6ff42009-07-07 18:20:53410 # Finally, for Windows, we simply turn on profiling.
411 ['OS=="win"', {
412 'msvs_settings': {
413 'VCLinkerTool': {
414 'Profile': 'true',
415 },
[email protected]10bb8c92009-08-07 21:16:03416 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53417 # /Z7, not /Zi, so coverage is happyb
418 'DebugInformationFormat': '1',
[email protected]1f9471a2010-01-04 06:40:16419 'AdditionalOptions': ['/Yd'],
[email protected]e8f6ff42009-07-07 18:20:53420 }
421 }
422 }], # OS==win
423 ], # conditions for coverage
424 }], # coverage!=0
[email protected]a6e22132010-02-10 20:43:18425 ], # conditions for 'target_defaults'
426 'target_conditions': [
[email protected]c14d8e772010-02-09 22:06:15427 ['chromium_code==0', {
[email protected]d8543312010-02-10 17:43:28428 'conditions': [
429 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
430 'cflags!': [
431 '-Wall',
432 '-Wextra',
433 '-Werror',
434 ],
435 }],
436 [ 'OS=="win"', {
437 'defines': [
438 '_CRT_SECURE_NO_DEPRECATE',
439 '_CRT_NONSTDC_NO_WARNINGS',
440 '_CRT_NONSTDC_NO_DEPRECATE',
441 '_SCL_SECURE_NO_DEPRECATE',
442 ],
443 'msvs_disabled_warnings': [4800],
444 'msvs_settings': {
445 'VCCLCompilerTool': {
446 'WarnAsError': 'false',
447 'Detect64BitPortabilityProblems': 'false',
448 },
449 },
450 }],
451 [ 'OS=="mac"', {
452 'xcode_settings': {
453 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
454 'WARNING_CFLAGS!': ['-Wall'],
455 },
456 }],
[email protected]c14d8e772010-02-09 22:06:15457 ],
458 }, {
459 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
460 # C99 macros on Mac and Linux.
461 'defines': [
462 '__STDC_FORMAT_MACROS',
463 ],
464 'conditions': [
465 ['OS!="win"', {
466 'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'],
467 ['exclude', '/win/'],
468 ['exclude', '/win_[^/]*\\.cc$'] ],
469 }],
470 ['OS!="mac"', {
471 'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
472 ['exclude', '/(cocoa|mac)/'],
[email protected]e603d952010-02-10 22:36:26473 ['exclude', '\.mm?$' ] ],
[email protected]c14d8e772010-02-09 22:06:15474 }],
475 ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
476 'sources/': [
[email protected]18cff3d2010-02-17 18:03:13477 ['exclude', '_(chromeos|gtk|x|x11)(_unittest)?\\.cc$'],
[email protected]c14d8e772010-02-09 22:06:15478 ['exclude', '/gtk/'],
[email protected]18cff3d2010-02-17 18:03:13479 ['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
480 ],
481 }],
482 ['OS!="linux"', {
483 'sources/': [
484 ['exclude', '_linux(_unittest)?\\.cc$'],
485 ['exclude', '/linux/'],
486 ],
[email protected]c14d8e772010-02-09 22:06:15487 }],
488 # We use "POSIX" to refer to all non-Windows operating systems.
489 ['OS=="win"', {
490 'sources/': [ ['exclude', '_posix\\.cc$'] ],
491 }],
492 # Though Skia is conceptually shared by Linux and Windows,
493 # the only _skia files in our tree are Linux-specific.
494 ['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
495 'sources/': [ ['exclude', '_skia\\.cc$'] ],
496 }],
497 ['chromeos!=1', {
498 'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
499 }],
500 ['OS!="win" and (toolkit_views==0 and chromeos==0)', {
501 'sources/': [ ['exclude', '_views\\.cc$'] ]
502 }],
503 ],
504 }],
[email protected]a6e22132010-02-10 20:43:18505 ], # target_conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55506 'default_configuration': 'Debug',
507 'configurations': {
[email protected]5153767c2009-12-22 01:52:50508 # VCLinkerTool LinkIncremental values below:
509 # 0 == default
510 # 1 == /INCREMENTAL:NO
511 # 2 == /INCREMENTAL
512 # Debug links incremental, Release does not.
513 #
514 # Abstract base configurations to cover common
515 # attributes.
516 #
517 'Common_Base': {
[email protected]bb05e452009-10-29 21:24:56518 'abstract': 1,
519 'msvs_configuration_attributes': {
520 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
521 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
522 'CharacterSet': '1',
523 },
[email protected]5153767c2009-12-22 01:52:50524 },
525 'x86_Base': {
526 'abstract': 1,
[email protected]ef4fa4072009-12-04 22:46:50527 'msvs_settings': {
528 'VCLinkerTool': {
529 'TargetMachine': '1',
530 },
531 },
[email protected]2fa40782009-11-01 21:17:34532 'msvs_configuration_platform': 'Win32',
[email protected]bb05e452009-10-29 21:24:56533 },
[email protected]5153767c2009-12-22 01:52:50534 'x64_Base': {
535 'abstract': 1,
536 'msvs_configuration_platform': 'x64',
537 'msvs_settings': {
538 'VCLinkerTool': {
539 'TargetMachine': '17', # x86 - 64
540 },
541 },
542 'msvs_settings': {
543 'VCLibrarianTool': {
544 'AdditionalLibraryDirectories!':
545 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
546 'AdditionalLibraryDirectories':
547 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
548 },
549 'VCLinkerTool': {
550 'TargetMachine': '17',
551 'AdditionalLibraryDirectories!':
552 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
553 'AdditionalLibraryDirectories':
554 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
555 },
556 },
557 'defines': [
558 # Not sure if tcmalloc works on 64-bit Windows.
559 'NO_TCMALLOC',
560 ],
561 },
562 'Debug_Base': {
563 'abstract': 1,
[email protected]1c966092009-08-20 21:19:26564 'xcode_settings': {
565 'COPY_PHASE_STRIP': 'NO',
[email protected]d5d593a2009-08-28 23:23:29566 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
[email protected]bd232ac2009-10-21 02:23:53567 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26568 },
[email protected]bb05e452009-10-29 21:24:56569 'msvs_settings': {
570 'VCCLCompilerTool': {
[email protected]7e0d664a2009-12-03 21:07:47571 'Optimization': '<(win_debug_Optimization)',
[email protected]bb05e452009-10-29 21:24:56572 'PreprocessorDefinitions': ['_DEBUG'],
573 'BasicRuntimeChecks': '3',
[email protected]7e0d664a2009-12-03 21:07:47574 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
[email protected]bb05e452009-10-29 21:24:56575 },
576 'VCLinkerTool': {
577 'LinkIncremental': '<(msvs_debug_link_incremental)',
578 },
579 'VCResourceCompilerTool': {
580 'PreprocessorDefinitions': ['_DEBUG'],
581 },
582 },
[email protected]2f80c312009-02-25 21:26:55583 'conditions': [
[email protected]bb05e452009-10-29 21:24:56584 ['OS=="linux"', {
585 'cflags': [
586 '<@(debug_extra_cflags)',
587 ],
[email protected]2f80c312009-02-25 21:26:55588 }],
589 ],
590 },
[email protected]5153767c2009-12-22 01:52:50591 'Release_Base': {
592 'abstract': 1,
[email protected]2f80c312009-02-25 21:26:55593 'defines': [
594 'NDEBUG',
595 ],
[email protected]1c966092009-08-20 21:19:26596 'xcode_settings': {
597 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
598 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
[email protected]ffd984b12009-09-11 19:37:00599 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26600 },
[email protected]bb05e452009-10-29 21:24:56601 'msvs_settings': {
[email protected]7e0d664a2009-12-03 21:07:47602 'VCCLCompilerTool': {
603 'Optimization': '<(win_release_Optimization)',
604 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
605 },
[email protected]bb05e452009-10-29 21:24:56606 'VCLinkerTool': {
607 'LinkIncremental': '1',
608 },
609 },
[email protected]2f80c312009-02-25 21:26:55610 'conditions': [
[email protected]92822e82009-09-18 14:26:56611 ['release_valgrind_build==0', {
612 'defines': ['NVALGRIND'],
613 }],
[email protected]7e0d664a2009-12-03 21:07:47614 ['win_use_allocator_shim==0', {
615 'defines': ['NO_TCMALLOC'],
616 }],
617 ['win_release_RuntimeLibrary==2', {
618 # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
[email protected]7477ea6f2009-12-22 23:28:15619 # VC\include\typeinfo(139) : warning C4275: non dll-interface
620 # class 'stdext::exception' used as base for dll-interface
[email protected]7e0d664a2009-12-03 21:07:47621 # class 'std::bad_cast'
622 'msvs_disabled_warnings': [4275],
623 }],
[email protected]bb05e452009-10-29 21:24:56624 ['OS=="linux"', {
625 'cflags': [
[email protected]ffd984b12009-09-11 19:37:00626 '<@(release_extra_cflags)',
[email protected]bb05e452009-10-29 21:24:56627 ],
628 }],
[email protected]2f80c312009-02-25 21:26:55629 ],
630 },
[email protected]5153767c2009-12-22 01:52:50631 'Purify_Base': {
632 'abstract': 1,
633 'defines': [
634 'PURIFY',
635 'NO_TCMALLOC',
636 ],
637 'msvs_settings': {
638 'VCCLCompilerTool': {
639 'Optimization': '0',
640 'RuntimeLibrary': '0',
641 'BufferSecurityCheck': 'false',
642 },
643 'VCLinkerTool': {
644 'EnableCOMDATFolding': '1',
645 'LinkIncremental': '1',
646 },
647 },
648 },
649 #
650 # Concrete configurations
651 #
652 'Debug': {
653 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
654 },
655 'Release': {
656 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
657 'conditions': [
658 ['msvs_use_common_release', {
[email protected]1f9471a2010-01-04 06:40:16659 'includes': ['release.gypi'],
[email protected]5153767c2009-12-22 01:52:50660 }],
661 ]
662 },
[email protected]f926fa0a2009-08-04 22:50:13663 'conditions': [
664 [ 'OS=="win"', {
665 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
666 'Purify': {
[email protected]5153767c2009-12-22 01:52:50667 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
[email protected]ef4fa4072009-12-04 22:46:50668 },
669 'Debug_x64': {
[email protected]5153767c2009-12-22 01:52:50670 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
[email protected]78263c12009-11-01 23:45:30671 },
672 'Release_x64': {
[email protected]5153767c2009-12-22 01:52:50673 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
[email protected]78263c12009-11-01 23:45:30674 },
675 'Purify_x64': {
[email protected]1f9471a2010-01-04 06:40:16676 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
[email protected]78263c12009-11-01 23:45:30677 },
[email protected]f926fa0a2009-08-04 22:50:13678 }],
679 ],
[email protected]2f80c312009-02-25 21:26:55680 },
681 },
682 'conditions': [
[email protected]47deeb62009-12-17 14:49:39683 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
[email protected]9d384032009-03-20 23:13:26684 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27685 # Enable -Werror by default, but put it in a variable so it can
686 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
687 'variables': {
[email protected]ecf52cb82010-01-13 19:25:42688 # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
689 # issues that slip through the cracks. We could do this just for
690 # gcc 4.4 but it makes more sense to be consistent on all
691 # compilers in use. TODO(Craig): turn this off again when
692 # there is some 4.4 test infrastructure in place and existing
693 # aliasing issues have been fixed.
694 'no_strict_aliasing%': 1,
[email protected]47deeb62009-12-17 14:49:39695 'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
696 ['OS=="freebsd"', {'werror%': '',}],
697 ['OS=="openbsd"', {'werror%': '',}],
698 ],
[email protected]5315f2842009-04-28 00:43:27699 },
[email protected]9d384032009-03-20 23:13:26700 'cflags': [
[email protected]1bba09c2009-08-13 12:53:16701 '<(werror)', # See note above about the werror variable.
702 '-pthread',
703 '-fno-exceptions',
704 '-Wall',
[email protected]225c8f52010-02-05 22:23:20705 # TODO(evan): turn this back on once the v8 change lands.
706 #'-Wextra',
707 # Don't warn about unused function params. We use those everywhere.
708 '-Wno-unused-parameter',
709 # Don't warn about the "struct foo f = {0};" initialization pattern.
710 '-Wno-missing-field-initializers',
[email protected]1bba09c2009-08-13 12:53:16711 '-D_FILE_OFFSET_BITS=64',
[email protected]3df6e3a2010-01-21 20:23:12712 # Don't export any symbols (for example, to plugins we dlopen()).
713 # Note: this is *required* to make some plugins work.
714 '-fvisibility=hidden',
[email protected]8a2fcba2009-07-29 00:52:24715 ],
716 'cflags_cc': [
[email protected]832d0212009-10-28 19:12:22717 '-fno-rtti',
[email protected]8a2fcba2009-07-29 00:52:24718 '-fno-threadsafe-statics',
[email protected]f5986c42009-11-17 18:39:36719 # Make inline functions have hidden visiblity by default.
720 # Surprisingly, not covered by -fvisibility=hidden.
721 '-fvisibility-inlines-hidden',
[email protected]9d384032009-03-20 23:13:26722 ],
[email protected]a6cf87e2009-04-03 04:07:38723 'ldflags': [
[email protected]9d384032009-03-20 23:13:26724 '-pthread',
725 ],
[email protected]b5e46b92009-03-26 18:58:10726 'scons_variable_settings': {
727 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26728 # Linking of large files uses lots of RAM, so serialize links
729 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01730 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31731 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
732 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26733
734 # We have several cases where archives depend on each other in
735 # a cyclic fashion. Since the GNU linker does only a single
736 # pass over the archives we surround the libraries with
737 # --start-group and --end-group (aka -( and -) ). That causes
738 # ld to loop over the group until no more undefined symbols
739 # are found. In an ideal world we would only make groups from
740 # those libraries which we knew to be in cycles. However,
741 # that's tough with SCons, so we bodge it by making all the
742 # archives a group by redefining the linking command here.
743 #
744 # TODO: investigate whether we still have cycles that
745 # require --{start,end}-group. There has been a lot of
746 # refactoring since this was first coded, which might have
747 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41748 #
749 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
750 # so that we prefer our own built libraries (e.g. -lpng) to
751 # system versions of libraries that pkg-config might turn up.
752 # TODO(sgk): investigate handling this not by re-ordering the
753 # flags this way, but by adding a hook to use the SCons
754 # ParseFlags() option on the output from pkg-config.
[email protected]610d8cc2009-09-19 00:47:04755 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
756 '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
757 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
758 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
759 '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
760 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
761 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
762 '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
763 '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26764 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29765 # -rpath is only used when building with shared libraries.
766 'conditions': [
767 [ 'library=="shared_library"', {
768 'RPATH': '$LIB_DIR',
769 }],
770 ],
[email protected]9d384032009-03-20 23:13:26771 },
[email protected]b5e46b92009-03-26 18:58:10772 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49773 'AS',
[email protected]b5e46b92009-03-26 18:58:10774 'CC',
775 'CXX',
776 'LINK',
777 ],
778 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49779 'AS',
[email protected]b5e46b92009-03-26 18:58:10780 'CC',
781 'CCACHE_DIR',
782 'CXX',
783 'DISTCC_DIR',
784 'DISTCC_HOSTS',
785 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47786 'INCLUDE_SERVER_ARGS',
787 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10788 'LINK',
[email protected]fff920a2009-05-08 22:35:32789 'CHROME_BUILD_TYPE',
790 'CHROMIUM_BUILD',
791 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10792 ],
[email protected]3aacaf952009-04-02 15:34:09793 'configurations': {
[email protected]5153767c2009-12-22 01:52:50794 'Debug_Base': {
[email protected]c5bdc032009-04-20 19:11:31795 'variables': {
796 'debug_optimize%': '0',
797 },
[email protected]3aacaf952009-04-02 15:34:09798 'defines': [
799 '_DEBUG',
800 ],
801 'cflags': [
[email protected]22898f62009-10-26 22:14:01802 '-O>(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09803 '-g',
[email protected]9a5d2a52009-05-22 03:37:45804 # One can use '-gstabs' to enable building the debugging
805 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09806 ],
[email protected]96fd0032009-04-24 00:13:08807 'ldflags': [
808 '-rdynamic', # Allows backtrace to resolve symbols.
809 ],
[email protected]5315f2842009-04-28 00:43:27810 },
[email protected]5153767c2009-12-22 01:52:50811 'Release_Base': {
[email protected]740e2de2009-07-21 11:41:01812 'variables': {
813 'release_optimize%': '2',
814 },
[email protected]3aacaf952009-04-02 15:34:09815 'cflags': [
[email protected]22898f62009-10-26 22:14:01816 '-O>(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53817 # Don't emit the GCC version ident directives, they just end up
818 # in the .comment section taking up binary size.
819 '-fno-ident',
820 # Put data and code in their own sections, so that unused symbols
821 # can be removed at link time with --gc-sections.
822 '-fdata-sections',
823 '-ffunction-sections',
[email protected]3aacaf952009-04-02 15:34:09824 ],
[email protected]3a48e0542009-11-18 17:07:13825 'ldflags': [
826 '-Wl,--gc-sections',
827 ],
[email protected]3aacaf952009-04-02 15:34:09828 },
829 },
[email protected]601b540222009-04-03 21:32:04830 'variants': {
831 'coverage': {
832 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
833 'ldflags': ['-fprofile-arcs'],
834 },
835 'profile': {
836 'cflags': ['-pg', '-g'],
837 'ldflags': ['-pg'],
838 },
839 'symbols': {
840 'cflags': ['-g'],
841 },
842 },
[email protected]606116d22009-05-06 22:38:23843 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00844 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23845 'asflags': [
846 # Needed so that libs with .s files (e.g. libicudata.a)
847 # are compatible with the general 32-bit-ness.
848 '-32',
849 ],
850 # All floating-point computations on x87 happens in 80-bit
851 # precision. Because the C and C++ language standards allow
852 # the compiler to keep the floating-point values in higher
853 # precision than what's specified in the source and doing so
854 # is more efficient than constantly rounding up to 64-bit or
855 # 32-bit precision as specified in the source, the compiler,
856 # especially in the optimized mode, tries very hard to keep
857 # values in x87 floating-point stack (in 80-bit precision)
858 # as long as possible. This has important side effects, that
859 # the real value used in computation may change depending on
860 # how the compiler did the optimization - that is, the value
861 # kept in 80-bit is different than the value rounded down to
862 # 64-bit or 32-bit. There are possible compiler options to make
863 # this behavior consistent (e.g. -ffloat-store would keep all
864 # floating-values in the memory, thus force them to be rounded
865 # to its original precision) but they have significant runtime
866 # performance penalty.
867 #
868 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
869 # which keep floating-point values in SSE registers in its
870 # native precision (32-bit for single precision, and 64-bit for
871 # double precision values). This means the floating-point value
872 # used during computation does not change depending on how the
873 # compiler optimized the code, since the value is always kept
874 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06875 'conditions': [
876 ['branding=="Chromium"', {
877 'cflags': [
878 '-march=pentium4',
879 '-msse2',
880 '-mfpmath=sse',
881 ],
882 }],
883 ],
[email protected]606116d22009-05-06 22:38:23884 'cflags': [
885 '-m32',
[email protected]1c6560af2009-07-14 11:02:16886 ],
[email protected]606116d22009-05-06 22:38:23887 'ldflags': [
888 '-m32',
889 ],
890 }],
[email protected]3dda8a962009-08-10 18:58:07891 ['target_arch=="arm"', {
[email protected]77c1b29392009-12-04 06:21:29892 'target_conditions': [
893 ['_toolset=="target"', {
894 'cflags_cc': [
895 # The codesourcery arm-2009q3 toolchain warns at that the ABI
896 # has changed whenever it encounters a varargs function. This
897 # silences those warnings, as they are not helpful and
898 # clutter legitimate warnings.
899 '-Wno-abi',
900 ],
901 'conditions': [
902 ['arm_thumb == 1', {
903 'cflags': [
904 '-mthumb',
905 # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
906 # inline assembly that uses condition codes but it's
907 # suboptimal. Better would be to #ifdef __thumb__ at the
908 # right place and have a separate thumb path.
909 '-Wa,-mimplicit-it=thumb',
910 ]
911 }],
912 ['armv7==1', {
[email protected]dc9711f2009-11-13 19:30:25913 'cflags': [
914 '-march=armv7-a',
915 '-mtune=cortex-a8',
[email protected]dc9711f2009-11-13 19:30:25916 '-mfloat-abi=softfp',
917 ],
[email protected]eafc0b452010-02-26 21:53:43918 'conditions': [
919 ['arm_neon==1', {
920 'cflags': [ '-mfpu=neon', ],
921 }, {
922 'cflags': [ '-mfpu=vfpv3', ],
923 }]
924 ],
[email protected]dc9711f2009-11-13 19:30:25925 }],
[email protected]3dda8a962009-08-10 18:58:07926 ],
927 }],
928 ],
929 }],
[email protected]c76723a2010-01-25 23:10:58930 ['linux_fpic==1', {
931 'cflags': [
932 '-fPIC',
933 ],
934 }],
[email protected]ee28c9f2009-09-04 01:53:01935 ['sysroot!=""', {
[email protected]fd36ce822009-10-28 20:13:57936 'target_conditions': [
937 ['_toolset=="target"', {
938 'cflags': [
939 '--sysroot=<(sysroot)',
940 ],
941 'ldflags': [
942 '--sysroot=<(sysroot)',
943 ],
944 }]]
[email protected]ee28c9f2009-09-04 01:53:01945 }],
[email protected]cc4219a2009-08-14 05:30:52946 ['no_strict_aliasing==1', {
947 'cflags': [
948 '-fno-strict-aliasing',
949 ],
950 }],
[email protected]cbd5fd52009-08-26 00:14:27951 ['linux_breakpad==1', {
952 'cflags': [ '-gstabs' ],
953 'defines': ['USE_LINUX_BREAKPAD'],
954 }],
[email protected]7cd2afd2009-10-27 21:40:26955 ['library=="shared_library"', {
956 # When building with shared libraries, remove the visiblity-hiding
957 # flag.
958 'cflags!': [ '-fvisibility=hidden' ],
[email protected]4907ac42009-11-02 20:32:51959 'conditions': [
[email protected]08be8a72009-11-18 20:35:54960 ['target_arch=="x64" or target_arch=="arm"', {
961 # Shared libraries need -fPIC on x86-64 and arm
[email protected]4907ac42009-11-02 20:32:51962 'cflags': ['-fPIC']
963 }]
964 ],
[email protected]7cd2afd2009-10-27 21:40:26965 }],
[email protected]61a9b2d82010-02-26 00:31:08966 ['linux_use_tcmalloc==0', {
967 'defines': ['NO_TCMALLOC'],
[email protected]01699e22009-11-11 19:24:24968 }],
[email protected]606116d22009-05-06 22:38:23969 ],
[email protected]9d384032009-03-20 23:13:26970 },
971 }],
[email protected]c51e8d52009-12-11 20:04:06972 # FreeBSD-specific options; note that most FreeBSD options are set above,
973 # with Linux.
974 ['OS=="freebsd"', {
975 'target_defaults': {
976 'ldflags': [
977 '-Wl,--no-keep-memory',
978 ],
979 },
980 }],
[email protected]2f80c312009-02-25 21:26:55981 ['OS=="mac"', {
982 'target_defaults': {
[email protected]24700642009-06-01 16:01:20983 'variables': {
984 # This should be 'mac_real_dsym%', but there seems to be a bug
985 # with % in variables that are intended to be set to different
986 # values in different targets, like this one.
987 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
988 },
[email protected]d92c7c012009-03-19 19:26:42989 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:55990 'xcode_settings': {
991 'ALWAYS_SEARCH_USER_PATHS': 'NO',
[email protected]ab2956372009-08-13 18:11:04992 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
993 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
994 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
995 # (Equivalent to -fPIC)
996 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
997 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
998 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
[email protected]3224dcd2009-09-16 17:31:25999 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
1000 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
[email protected]ab2956372009-08-13 18:11:041001 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
1002 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
1003 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
1004 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
[email protected]2f80c312009-02-25 21:26:551005 'GCC_VERSION': '4.2',
[email protected]ab2956372009-08-13 18:11:041006 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
[email protected]3224dcd2009-09-16 17:31:251007 # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
1008 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
[email protected]ab2956372009-08-13 18:11:041009 'PREBINDING': 'NO', # No -Wl,-prebind
[email protected]2f80c312009-02-25 21:26:551010 'USE_HEADERMAP': 'NO',
1011 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:241012 'conditions': [
1013 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
[email protected]9543af052009-09-15 22:42:591014 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
1015 ],
[email protected]b3fb8092009-03-12 19:09:241016 ],
[email protected]2f80c312009-02-25 21:26:551017 },
1018 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:551019 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:461020 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
1021 }],
1022 ['_mac_bundle', {
1023 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:081024 }],
[email protected]e14a9f92009-08-05 19:26:071025 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:201026 'target_conditions': [
1027 ['mac_real_dsym == 1', {
1028 # To get a real .dSYM bundle produced by dsymutil, set the
1029 # debug information format to dwarf-with-dsym. Since
1030 # strip_from_xcode will not be used, set Xcode to do the
1031 # stripping as well.
1032 'configurations': {
[email protected]5153767c2009-12-22 01:52:501033 'Release_Base': {
[email protected]24700642009-06-01 16:01:201034 'xcode_settings': {
1035 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
1036 'DEPLOYMENT_POSTPROCESSING': 'YES',
1037 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:071038 'target_conditions': [
1039 ['_type=="shared_library"', {
1040 # The Xcode default is to strip debugging symbols
1041 # only (-S). Local symbols should be stripped as
1042 # well, which will be handled by -x. Xcode will
1043 # continue to insert -S when stripping even when
1044 # additional flags are added with STRIPFLAGS.
1045 'STRIPFLAGS': '-x',
1046 }], # _type=="shared_library"
1047 ], # target_conditions
1048 }, # xcode_settings
1049 }, # configuration "Release"
1050 }, # configurations
[email protected]24700642009-06-01 16:01:201051 }, { # mac_real_dsym != 1
1052 # To get a fast fake .dSYM bundle, use a post-build step to
1053 # produce the .dSYM and strip the executable. strip_from_xcode
1054 # only operates in the Release configuration.
1055 'postbuilds': [
1056 {
1057 'variables': {
1058 # Define strip_from_xcode in a variable ending in _path
1059 # so that gyp understands it's a path and performs proper
1060 # relativization during dict merging.
1061 'strip_from_xcode_path': 'mac/strip_from_xcode',
1062 },
1063 'postbuild_name': 'Strip If Needed',
1064 'action': ['<(strip_from_xcode_path)'],
1065 },
[email protected]e14a9f92009-08-05 19:26:071066 ], # postbuilds
1067 }], # mac_real_dsym
1068 ], # target_conditions
1069 }], # _type=="executable" or _type=="shared_library"
1070 ], # target_conditions
1071 }, # target_defaults
1072 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:551073 ['OS=="win"', {
1074 'target_defaults': {
1075 'defines': [
1076 '_WIN32_WINNT=0x0600',
1077 'WINVER=0x0600',
1078 'WIN32',
1079 '_WINDOWS',
1080 '_HAS_EXCEPTIONS=0',
1081 'NOMINMAX',
1082 '_CRT_RAND_S',
1083 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
1084 'WIN32_LEAN_AND_MEAN',
1085 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:451086 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:551087 ],
[email protected]5b5ca7cb2009-07-20 23:00:201088 'msvs_system_include_dirs': [
[email protected]998b5152009-12-12 22:19:521089 '<(DEPTH)/third_party/platformsdk_win7/files/Include',
[email protected]2f80c312009-02-25 21:26:551090 '$(VSInstallDir)/VC/atlmfc/include',
1091 ],
[email protected]a8d99cef2009-08-26 20:47:491092 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:551093 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:551094 'msvs_settings': {
1095 'VCCLCompilerTool': {
1096 'MinimalRebuild': 'false',
1097 'ExceptionHandling': '0',
1098 'BufferSecurityCheck': 'true',
1099 'EnableFunctionLevelLinking': 'true',
1100 'RuntimeTypeInfo': 'false',
1101 'WarningLevel': '3',
1102 'WarnAsError': 'true',
1103 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:581104 'conditions': [
[email protected]912c55c2009-07-31 23:33:551105 [ 'msvs_multi_core_compile', {
[email protected]1f9471a2010-01-04 06:40:161106 'AdditionalOptions': ['/MP'],
[email protected]912c55c2009-07-31 23:33:551107 }],
[email protected]3fef6e62009-07-31 19:58:581108 ],
[email protected]2f80c312009-02-25 21:26:551109 },
1110 'VCLibrarianTool': {
[email protected]1f9471a2010-01-04 06:40:161111 'AdditionalOptions': ['/ignore:4221'],
[email protected]2f80c312009-02-25 21:26:551112 'AdditionalLibraryDirectories':
[email protected]998b5152009-12-12 22:19:521113 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
[email protected]2f80c312009-02-25 21:26:551114 },
1115 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:551116 'AdditionalDependencies': [
1117 'wininet.lib',
1118 'version.lib',
1119 'msimg32.lib',
1120 'ws2_32.lib',
1121 'usp10.lib',
1122 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:081123 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:551124 ],
1125 'AdditionalLibraryDirectories':
[email protected]998b5152009-12-12 22:19:521126 ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
[email protected]2f80c312009-02-25 21:26:551127 'GenerateDebugInformation': 'true',
1128 'MapFileName': '$(OutDir)\\$(TargetName).map',
1129 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
[email protected]2f80c312009-02-25 21:26:551130 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:481131 # SubSystem values:
1132 # 0 == not set
1133 # 1 == /SUBSYSTEM:CONSOLE
1134 # 2 == /SUBSYSTEM:WINDOWS
1135 # Most of the executables we'll ever create are tests
1136 # and utilities with console output.
1137 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:551138 },
1139 'VCMIDLTool': {
1140 'GenerateStublessProxies': 'true',
1141 'TypeLibraryName': '$(InputName).tlb',
1142 'OutputDirectory': '$(IntDir)',
1143 'HeaderFileName': '$(InputName).h',
1144 'DLLDataFileName': 'dlldata.c',
1145 'InterfaceIdentifierFileName': '$(InputName)_i.c',
1146 'ProxyFileName': '$(InputName)_p.c',
1147 },
1148 'VCResourceCompilerTool': {
1149 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:141150 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:551151 },
1152 },
1153 },
1154 }],
[email protected]47deeb62009-12-17 14:49:391155 # Disable native client on FreeBSD/OpenBSD for now
1156 ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd"', {
[email protected]d8c7cbcc2009-10-02 19:00:311157 'target_defaults': {
1158 'defines': [
1159 'DISABLE_NACL',
1160 ],
1161 },
1162 }],
[email protected]cfbf9bc2009-12-07 22:07:561163 ['OS=="win" and msvs_use_common_linker_extras', {
[email protected]48c7af72009-07-03 22:00:191164 'target_defaults': {
1165 'msvs_settings': {
1166 'VCLinkerTool': {
[email protected]48c7af72009-07-03 22:00:191167 'DelayLoadDLLs': [
1168 'dbghelp.dll',
1169 'dwmapi.dll',
1170 'uxtheme.dll',
1171 ],
1172 },
1173 },
[email protected]ef4fa4072009-12-04 22:46:501174 'configurations': {
[email protected]5153767c2009-12-22 01:52:501175 'x86_Base': {
[email protected]ef4fa4072009-12-04 22:46:501176 'msvs_settings': {
1177 'VCLinkerTool': {
[email protected]1f9471a2010-01-04 06:40:161178 'AdditionalOptions': [
1179 '/safeseh',
1180 '/dynamicbase',
1181 '/ignore:4199',
1182 '/ignore:4221',
1183 '/nxcompat',
1184 ],
[email protected]ef4fa4072009-12-04 22:46:501185 },
1186 },
1187 },
[email protected]5153767c2009-12-22 01:52:501188 'x64_Base': {
[email protected]ef4fa4072009-12-04 22:46:501189 'msvs_settings': {
1190 'VCLinkerTool': {
[email protected]1f9471a2010-01-04 06:40:161191 'AdditionalOptions': [
[email protected]ef4fa4072009-12-04 22:46:501192 # safeseh is not compatible with x64
[email protected]1f9471a2010-01-04 06:40:161193 '/dynamicbase',
1194 '/ignore:4199',
1195 '/ignore:4221',
1196 '/nxcompat',
1197 ],
[email protected]ef4fa4072009-12-04 22:46:501198 },
1199 },
1200 },
1201 },
[email protected]48c7af72009-07-03 22:00:191202 },
1203 }],
[email protected]2f80c312009-02-25 21:26:551204 ],
[email protected]c13fcbd2009-03-27 04:27:011205 'scons_settings': {
1206 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:071207 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:011208 },
[email protected]2f80c312009-02-25 21:26:551209 'xcode_settings': {
[email protected]0c8ab452009-11-06 21:57:501210 # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
1211 # This block adds *project-wide* configuration settings to each project
1212 # file. It's almost always wrong to put things here. Specify your
1213 # custom xcode_settings in target_defaults to add them to targets instead.
1214
1215 # In an Xcode Project Info window, the "Base SDK for All Configurations"
1216 # setting sets the SDK on a project-wide basis. In order to get the
1217 # configured SDK to show properly in the Xcode UI, SDKROOT must be set
1218 # here at the project level.
1219 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
1220
[email protected]2f80c312009-02-25 21:26:551221 # The Xcode generator will look for an xcode_settings section at the root
1222 # of each dict and use it to apply settings on a file-wide basis. Most
1223 # settings should not be here, they should be in target-specific
1224 # xcode_settings sections, or better yet, should use non-Xcode-specific
1225 # settings in target dicts. SYMROOT is a special case, because many other
1226 # Xcode variables depend on it, including variables such as
1227 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
1228 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
1229 # files to appear (when present) in the UI as actual files and not red
1230 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
1231 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:161232 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:551233 },
[email protected]ee28c9f2009-09-04 01:53:011234}
[email protected]f5c990c2009-10-06 03:02:381235
1236# Local Variables:
1237# tab-width:2
1238# indent-tabs-mode:nil
1239# End:
1240# vim: set expandtab tabstop=2 shiftwidth=2: