blob: 9d734fa34ec6b727664cc680399e562dbe1aef1c [file] [log] [blame]
[email protected]2f80c312009-02-25 21:26:551# Copyright (c) 2009 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5{
6 'variables': {
[email protected]b3fb8092009-03-12 19:09:247 # .gyp files should set chromium_code to 1 if they build Chromium-specific
8 # code, as opposed to external code. This variable is used to control
9 # such things as the set of warnings to enable, and whether warnings are
10 # treated as errors.
[email protected]2f80c312009-02-25 21:26:5511 'chromium_code%': 0,
[email protected]b3fb8092009-03-12 19:09:2412
13 # Variables expected to be overriden on the GYP command line (-D) or by
14 # ~/.gyp/include.gypi.
15
[email protected]e14a9f92009-08-05 19:26:0716 # Putting a variables dict inside another variables dict looks kind of
17 # weird. This is done so that "branding" and "buildtype" are defined as
18 # variables within the outer variables dict here. This is necessary
19 # to get these variables defined for the conditions within this variables
20 # dict that operate on these variables.
21 'variables': {
22 # Override branding to select the desired branding flavor.
23 'branding%': 'Chromium',
24
25 # Override buildtype to select the desired build flavor.
26 # Dev - everyday build for development/testing
27 # Official - release build (generally implies additional processing)
28 # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
29 # conversion is done), some of the things which are now controlled by
30 # 'branding', such as symbol generation, will need to be refactored based
31 # on 'buildtype' (i.e. we don't care about saving symbols for non-Official
32 # builds).
33 'buildtype%': 'Dev',
34 },
35
36 # Define branding and buildtype on the basis of their settings within the
37 # variables sub-dict above, unless overridden.
38 'branding%': '<(branding)',
39 'buildtype%': '<(buildtype)',
40
[email protected]b3fb8092009-03-12 19:09:2441 # Override chromium_mac_pch and set it to 0 to suppress the use of
42 # precompiled headers on the Mac. Prefix header injection may still be
43 # used, but prefix headers will not be precompiled. This is useful when
44 # using distcc to distribute a build to compile slaves that don't
45 # share the same compiler executable as the system driving the compilation,
46 # because precompiled headers rely on pointers into a specific compiler
47 # executable's image. Setting this to 0 is needed to use an experimental
48 # Linux-Mac cross compiler distcc farm.
49 'chromium_mac_pch%': 1,
50
[email protected]f5ecbba12009-04-03 04:35:1851 # Set to 1 to enable code coverage. In addition to build changes
52 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
53 # project file called "coverage".
54 # Currently ignored on Windows.
55 'coverage%': 0,
[email protected]653bd5f032009-04-08 12:55:4956
[email protected]c61f6432009-04-22 01:16:4257 # Overridable specification for potential use of alternative
58 # JavaScript engines.
59 'javascript_engine%': 'v8',
60
[email protected]653bd5f032009-04-08 12:55:4961 # To do a shared build on linux we need to be able to choose between type
62 # static_library and shared_library. We default to doing a static build
63 # but you can override this with "gyp -Dlibrary=shared_library" or you
64 # can add the following line (without the #) to ~/.gyp/include.gypi
65 # {'variables': {'library': 'shared_library'}}
66 # to compile as shared by default
67 'library%': 'static_library',
[email protected]e5b2eaa2009-04-14 01:39:1268
69 # TODO(bradnelson): eliminate this when possible.
70 # To allow local gyp files to prevent release.vsprops from being included.
71 # Yes(1) means include release.vsprops.
72 # Once all vsprops settings are migrated into gyp, this can go away.
73 'msvs_use_common_release%': 1,
[email protected]606116d22009-05-06 22:38:2374
[email protected]48c7af72009-07-03 22:00:1975 # TODO(bradnelson): eliminate this when possible.
76 # To allow local gyp files to override additional linker options for msvs.
77 # Yes(1) means set use the common linker options.
78 'msvs_use_common_linker_extras%': 1,
79
[email protected]1ffb6502009-06-02 07:46:2480 # TODO(sgk): eliminate this if possible.
81 # It would be nicer to support this via a setting in 'target_defaults'
82 # in chrome/app/locales/locales.gypi overriding the setting in the
83 # 'Debug' configuration in the 'target_defaults' dict below,
84 # but that doesn't work as we'd like.
85 'msvs_debug_link_incremental%': '2',
86
[email protected]606116d22009-05-06 22:38:2387 # The architecture that we're building on.
88 'target_arch%': 'ia32',
[email protected]e6970232009-05-12 23:51:1789
90 # By default linux does not use views. To turn on views in Linux
91 # set the variable GYP_DEFINES to "toolkit_views=1", or modify
92 # ~/.gyp/include.gypi .
93 'toolkit_views%': 0,
[email protected]2b883b92009-06-02 22:57:5094
[email protected]16779842009-07-08 23:45:2995 'chromeos%': 0,
[email protected]397fe9d2009-06-30 00:02:2796
[email protected]b66b7bd2009-06-11 20:16:1097 'chrome_personalization%': 0,
[email protected]214d0fd2009-07-15 01:41:5098
99 # Set the restrictions on the SUID sandbox binary.
100 # Path: only exec the hard coded chrome binary path
101 # User: only exec binaries owned by the running user.
102 #
103 # Developers should read
104 # http://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment
[email protected]573136142009-07-15 22:48:37105 'linux_suid_sandbox_restrictions%': 'Path',
106
107 # This is the location of the sandbox binary. Chrome looks for this before
108 # running the zygote process. If found, and SUID, it will be used to
109 # sandbox the zygote process and, thus, all renderer processes.
110 'linux_sandbox_path%': '',
111
112 # If |linux_suid_sandbox_restrictions|, above, is 'Path' then only a single
113 # path is allowed to be exec'ed by the sandbox for security reasons. That
114 # path is set here. It should be the final location of the Chromium binary
115 # on the system.
116 'linux_sandbox_chrome_path%': '/opt/google/chrome/chrome',
[email protected]912c55c2009-07-31 23:33:55117
118 'conditions': [
[email protected]e14a9f92009-08-05 19:26:07119 ['OS=="mac"', {
120 'conditions': [
121 # mac_product_name is set to the name of the .app bundle as it should
122 # appear on disk. This duplicates data from
123 # chrome/app/theme/chromium/BRANDING and
124 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
125 # these names into the build system.
126 ['branding=="Chrome"', {
127 'mac_product_name%': 'Google Chrome',
128 }, { # else: branding!="Chrome"
129 'mac_product_name%': 'Chromium',
130 }],
131
132 # Feature variables for enabling Mac Breakpad and Keystone auto-update
133 # support. Both features are on by default in official builds with
134 # Chrome branding.
135 ['branding=="Chrome" and buildtype=="Official"', {
136 'mac_breakpad%': 1,
137 'mac_keystone%': 1,
138 }, { # else: branding!="Chrome" or buildtype!="Official"
139 'mac_breakpad%': 0,
140 'mac_keystone%': 0,
141 }],
142 ],
143 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55144 # Whether to use multiple cores to compile with visual studio. This is
145 # optional because it sometimes causes corruption on VS 2005.
146 # It is on by default on VS 2008 and off on VS 2005.
147 ['OS=="win"', {
148 'conditions': [
149 ['MSVS_VERSION=="2005"', {
150 'msvs_multi_core_compile%': 0,
151 },{
152 'msvs_multi_core_compile%': 1,
153 }],
[email protected]10bb8c92009-08-07 21:16:03154 # Don't do incremental linking for large modules on 32-bit.
155 ['MSVS_OS_BITS==32', {
156 'msvs_large_module_debug_link_mode%': '1', # No
157 },{
158 'msvs_large_module_debug_link_mode%': '2', # Yes
159 }],
[email protected]912c55c2009-07-31 23:33:55160 ],
161 }],
162 ],
[email protected]2f80c312009-02-25 21:26:55163 },
164 'target_defaults': {
[email protected]32aa8cc2009-03-04 21:36:39165 'conditions': [
166 ['branding=="Chrome"', {
167 'defines': ['GOOGLE_CHROME_BUILD'],
[email protected]f70085e42009-05-28 20:31:48168 'conditions': [
169 ['OS=="linux"', {
170 'cflags': [ '-gstabs' ],
171 }],
172 ],
[email protected]32aa8cc2009-03-04 21:36:39173 }, { # else: branding!="Chrome"
174 'defines': ['CHROMIUM_BUILD'],
175 }],
[email protected]6cb1cec2009-05-15 03:05:20176 ['toolkit_views==1', {
[email protected]e6970232009-05-12 23:51:17177 'defines': ['TOOLKIT_VIEWS=1'],
178 }],
[email protected]16779842009-07-08 23:45:29179 ['chromeos==1', {
180 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50181 }],
[email protected]b66b7bd2009-06-11 20:16:10182 ['chrome_personalization==1', {
183 'defines': ['CHROME_PERSONALIZATION=1'],
184 }],
[email protected]f5ecbba12009-04-03 04:35:18185 ['coverage!=0', {
186 'conditions': [
187 ['OS=="mac"', {
188 'xcode_settings': {
189 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',
190 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
[email protected]5ae4f55e2009-04-13 23:19:47191 },
[email protected]f5ecbba12009-04-03 04:35:18192 # Add -lgcov for executables, not for static_libraries.
193 # This is a delayed conditional.
194 'target_conditions': [
195 ['_type=="executable"', {
196 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47197 }],
198 ],
199 }],
[email protected]7122ffd52009-04-30 23:19:00200 # Linux gyp (into scons) doesn't like target_conditions?
201 # TODO(???): track down why 'target_conditions' doesn't work
202 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18203 ['OS=="linux"', {
204 'cflags': [ '-ftest-coverage',
205 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00206 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18207 }],
[email protected]e8f6ff42009-07-07 18:20:53208 # Finally, for Windows, we simply turn on profiling.
209 ['OS=="win"', {
210 'msvs_settings': {
211 'VCLinkerTool': {
212 'Profile': 'true',
213 },
[email protected]10bb8c92009-08-07 21:16:03214 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53215 # /Z7, not /Zi, so coverage is happyb
216 'DebugInformationFormat': '1',
217 'AdditionalOptions': '/Yd',
218 }
219 }
220 }], # OS==win
221 ], # conditions for coverage
222 }], # coverage!=0
223 ], # conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55224 'default_configuration': 'Debug',
225 'configurations': {
[email protected]825ff8d2009-05-22 01:40:48226 # VCLinkerTool LinkIncremental values below:
227 # 0 == default
228 # 1 == /INCREMENTAL:NO
229 # 2 == /INCREMENTAL
230 # Debug links incremental, Release does not.
[email protected]2f80c312009-02-25 21:26:55231 'Debug': {
232 'conditions': [
233 [ 'OS=="mac"', {
234 'xcode_settings': {
235 'COPY_PHASE_STRIP': 'NO',
236 'GCC_OPTIMIZATION_LEVEL': '0',
237 }
238 }],
239 [ 'OS=="win"', {
240 'configuration_platform': 'Win32',
241 'msvs_configuration_attributes': {
242 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
243 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
244 'CharacterSet': '1',
245 },
246 'msvs_settings': {
247 'VCCLCompilerTool': {
248 'Optimization': '0',
249 'PreprocessorDefinitions': ['_DEBUG'],
250 'BasicRuntimeChecks': '3',
251 'RuntimeLibrary': '1',
252 },
253 'VCLinkerTool': {
[email protected]1ffb6502009-06-02 07:46:24254 'LinkIncremental': '<(msvs_debug_link_incremental)',
[email protected]2f80c312009-02-25 21:26:55255 },
256 'VCResourceCompilerTool': {
257 'PreprocessorDefinitions': ['_DEBUG'],
258 },
259 },
260 }],
261 ],
262 },
263 'Release': {
264 'defines': [
265 'NDEBUG',
266 ],
267 'conditions': [
268 [ 'OS=="mac"', {
269 'xcode_settings': {
270 'DEAD_CODE_STRIPPING': 'YES',
[email protected]64eba222009-07-14 18:43:42271 'conditions': [
272 ['mac_release_optimization != "UNSET"',
273 {'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)'}],
274 ],
[email protected]2f80c312009-02-25 21:26:55275 }
276 }],
[email protected]e5b2eaa2009-04-14 01:39:12277 [ 'OS=="win" and msvs_use_common_release', {
[email protected]2f80c312009-02-25 21:26:55278 'configuration_platform': 'Win32',
279 'msvs_props': ['release.vsprops'],
280 }],
[email protected]825ff8d2009-05-22 01:40:48281 [ 'OS=="win"', {
282 'msvs_settings': {
283 'VCLinkerTool': {
284 'LinkIncremental': '1',
285 },
286 },
287 }],
[email protected]2f80c312009-02-25 21:26:55288 ],
289 },
[email protected]f926fa0a2009-08-04 22:50:13290 'conditions': [
291 [ 'OS=="win"', {
292 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
293 'Purify': {
294 'defines': [
295 'NDEBUG',
296 'PURIFY',
297 'NO_TCMALLOC',
298 ],
299 'msvs_settings': {
300 'VCCLCompilerTool': {
301 'Optimization': '0',
302 'RuntimeLibrary': '0',
303 'BufferSecurityCheck': 'false',
304 },
305 'VCLinkerTool': {
306 'EnableCOMDATFolding': '1',
307 'LinkIncremental': '1',
308 },
309 },
310 'conditions': [
311 [ 'msvs_use_common_release', {
312 'configuration_platform': 'Win32',
313 'msvs_props': ['release.vsprops'],
314 }],
315 ],
316 },
317 'Release - no tcmalloc': {
318 'defines': [
319 'NDEBUG',
320 'NO_TCMALLOC',
321 ],
322 'conditions': [
323 [ 'msvs_use_common_release', {
324 'configuration_platform': 'Win32',
325 'msvs_props': ['release.vsprops'],
326 }],
327 ],
328 'msvs_settings': {
329 'VCLinkerTool': {
330 'LinkIncremental': '1',
331 },
332 },
333 },
334 }],
335 ],
[email protected]2f80c312009-02-25 21:26:55336 },
337 },
338 'conditions': [
[email protected]606116d22009-05-06 22:38:23339 ['OS=="linux"', {
[email protected]9d384032009-03-20 23:13:26340 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27341 # Enable -Werror by default, but put it in a variable so it can
342 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
343 'variables': {
344 'werror%': '-Werror',
345 },
[email protected]9d384032009-03-20 23:13:26346 'cflags': [
[email protected]606116d22009-05-06 22:38:23347 '<(werror)', # See note above about the werror variable.
348 '-pthread',
[email protected]8a2fcba2009-07-29 00:52:24349 '-fno-exceptions',
350 '-Wall',
[email protected]49930c3a2009-08-06 21:23:07351 '-D_FILE_OFFSET_BITS=64',
[email protected]8a2fcba2009-07-29 00:52:24352 ],
353 'cflags_cc': [
354 '-fno-threadsafe-statics',
[email protected]9d384032009-03-20 23:13:26355 ],
[email protected]a6cf87e2009-04-03 04:07:38356 'ldflags': [
[email protected]9d384032009-03-20 23:13:26357 '-pthread',
358 ],
[email protected]b5e46b92009-03-26 18:58:10359 'scons_variable_settings': {
360 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26361 # Linking of large files uses lots of RAM, so serialize links
362 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01363 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31364 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
365 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26366
367 # We have several cases where archives depend on each other in
368 # a cyclic fashion. Since the GNU linker does only a single
369 # pass over the archives we surround the libraries with
370 # --start-group and --end-group (aka -( and -) ). That causes
371 # ld to loop over the group until no more undefined symbols
372 # are found. In an ideal world we would only make groups from
373 # those libraries which we knew to be in cycles. However,
374 # that's tough with SCons, so we bodge it by making all the
375 # archives a group by redefining the linking command here.
376 #
377 # TODO: investigate whether we still have cycles that
378 # require --{start,end}-group. There has been a lot of
379 # refactoring since this was first coded, which might have
380 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41381 #
382 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
383 # so that we prefer our own built libraries (e.g. -lpng) to
384 # system versions of libraries that pkg-config might turn up.
385 # TODO(sgk): investigate handling this not by re-ordering the
386 # flags this way, but by adding a hook to use the SCons
387 # ParseFlags() option on the output from pkg-config.
388 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
389 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
390 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26391 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29392 # -rpath is only used when building with shared libraries.
393 'conditions': [
394 [ 'library=="shared_library"', {
395 'RPATH': '$LIB_DIR',
396 }],
397 ],
[email protected]9d384032009-03-20 23:13:26398 },
[email protected]b5e46b92009-03-26 18:58:10399 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49400 'AS',
[email protected]b5e46b92009-03-26 18:58:10401 'CC',
402 'CXX',
403 'LINK',
404 ],
405 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49406 'AS',
[email protected]b5e46b92009-03-26 18:58:10407 'CC',
408 'CCACHE_DIR',
409 'CXX',
410 'DISTCC_DIR',
411 'DISTCC_HOSTS',
412 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47413 'INCLUDE_SERVER_ARGS',
414 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10415 'LINK',
[email protected]fff920a2009-05-08 22:35:32416 'CHROME_BUILD_TYPE',
417 'CHROMIUM_BUILD',
418 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10419 ],
[email protected]3aacaf952009-04-02 15:34:09420 'configurations': {
421 'Debug': {
[email protected]c5bdc032009-04-20 19:11:31422 'variables': {
423 'debug_optimize%': '0',
424 },
[email protected]3aacaf952009-04-02 15:34:09425 'defines': [
426 '_DEBUG',
427 ],
428 'cflags': [
[email protected]c5bdc032009-04-20 19:11:31429 '-O<(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09430 '-g',
[email protected]9a5d2a52009-05-22 03:37:45431 # One can use '-gstabs' to enable building the debugging
432 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09433 ],
[email protected]96fd0032009-04-24 00:13:08434 'ldflags': [
435 '-rdynamic', # Allows backtrace to resolve symbols.
436 ],
[email protected]5315f2842009-04-28 00:43:27437 },
[email protected]3aacaf952009-04-02 15:34:09438 'Release': {
[email protected]740e2de2009-07-21 11:41:01439 'variables': {
440 'release_optimize%': '2',
[email protected]1e819852009-07-30 17:47:51441 'release_extra_cflags%': '',
[email protected]740e2de2009-07-21 11:41:01442 },
[email protected]3aacaf952009-04-02 15:34:09443 'cflags': [
[email protected]740e2de2009-07-21 11:41:01444 '-O<(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53445 # Don't emit the GCC version ident directives, they just end up
446 # in the .comment section taking up binary size.
447 '-fno-ident',
448 # Put data and code in their own sections, so that unused symbols
449 # can be removed at link time with --gc-sections.
450 '-fdata-sections',
451 '-ffunction-sections',
[email protected]1e819852009-07-30 17:47:51452 '<(release_extra_cflags)',
[email protected]3aacaf952009-04-02 15:34:09453 ],
454 },
455 },
[email protected]601b540222009-04-03 21:32:04456 'variants': {
457 'coverage': {
458 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
459 'ldflags': ['-fprofile-arcs'],
460 },
461 'profile': {
462 'cflags': ['-pg', '-g'],
463 'ldflags': ['-pg'],
464 },
465 'symbols': {
466 'cflags': ['-g'],
467 },
468 },
[email protected]606116d22009-05-06 22:38:23469 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00470 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23471 'asflags': [
472 # Needed so that libs with .s files (e.g. libicudata.a)
473 # are compatible with the general 32-bit-ness.
474 '-32',
475 ],
476 # All floating-point computations on x87 happens in 80-bit
477 # precision. Because the C and C++ language standards allow
478 # the compiler to keep the floating-point values in higher
479 # precision than what's specified in the source and doing so
480 # is more efficient than constantly rounding up to 64-bit or
481 # 32-bit precision as specified in the source, the compiler,
482 # especially in the optimized mode, tries very hard to keep
483 # values in x87 floating-point stack (in 80-bit precision)
484 # as long as possible. This has important side effects, that
485 # the real value used in computation may change depending on
486 # how the compiler did the optimization - that is, the value
487 # kept in 80-bit is different than the value rounded down to
488 # 64-bit or 32-bit. There are possible compiler options to make
489 # this behavior consistent (e.g. -ffloat-store would keep all
490 # floating-values in the memory, thus force them to be rounded
491 # to its original precision) but they have significant runtime
492 # performance penalty.
493 #
494 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
495 # which keep floating-point values in SSE registers in its
496 # native precision (32-bit for single precision, and 64-bit for
497 # double precision values). This means the floating-point value
498 # used during computation does not change depending on how the
499 # compiler optimized the code, since the value is always kept
500 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06501 'conditions': [
502 ['branding=="Chromium"', {
503 'cflags': [
504 '-march=pentium4',
505 '-msse2',
506 '-mfpmath=sse',
507 ],
508 }],
509 ],
[email protected]606116d22009-05-06 22:38:23510 'cflags': [
511 '-m32',
[email protected]1c6560af2009-07-14 11:02:16512 ],
[email protected]606116d22009-05-06 22:38:23513 'ldflags': [
514 '-m32',
515 ],
516 }],
[email protected]3dda8a962009-08-10 18:58:07517 ['target_arch=="arm"', {
518 'conditions': [
519 ['chromeos==1', {
520 'cflags': [
521 '-march=armv7-a',
522 '-mtune=cortex-a8',
523 '-mfpu=vfp',
524 '-mfloat-abi=softfp',
525 ],
526 }],
527 ],
528 }],
[email protected]606116d22009-05-06 22:38:23529 ],
[email protected]9d384032009-03-20 23:13:26530 },
531 }],
[email protected]2f80c312009-02-25 21:26:55532 ['OS=="mac"', {
533 'target_defaults': {
[email protected]24700642009-06-01 16:01:20534 'variables': {
535 # This should be 'mac_real_dsym%', but there seems to be a bug
536 # with % in variables that are intended to be set to different
537 # values in different targets, like this one.
538 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
[email protected]64eba222009-07-14 18:43:42539 # Release defaults to the Xcode optimization default, this var
540 # lets you force the value.
541 'mac_release_optimization%': 'UNSET'
[email protected]24700642009-06-01 16:01:20542 },
[email protected]d92c7c012009-03-19 19:26:42543 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:55544 'xcode_settings': {
545 'ALWAYS_SEARCH_USER_PATHS': 'NO',
546 'GCC_C_LANGUAGE_STANDARD': 'c99',
547 'GCC_CW_ASM_SYNTAX': 'NO',
[email protected]7cf57d172009-06-03 18:15:22548 'GCC_DYNAMIC_NO_PIC': 'NO',
[email protected]2f80c312009-02-25 21:26:55549 'GCC_ENABLE_PASCAL_STRINGS': 'NO',
550 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
[email protected]793c3d72009-04-10 15:46:34551 'GCC_OBJC_CALL_CXX_CDTORS': 'YES',
[email protected]2f80c312009-02-25 21:26:55552 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
553 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',
554 'GCC_VERSION': '4.2',
555 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
556 'MACOSX_DEPLOYMENT_TARGET': '10.5',
557 'PREBINDING': 'NO',
558 'SDKROOT': 'macosx10.5',
559 'USE_HEADERMAP': 'NO',
560 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:24561 'conditions': [
562 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
563 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}],
564 ],
[email protected]2f80c312009-02-25 21:26:55565 },
566 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:55567 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:46568 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
569 }],
570 ['_mac_bundle', {
571 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:08572 }],
[email protected]e14a9f92009-08-05 19:26:07573 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:20574 'target_conditions': [
575 ['mac_real_dsym == 1', {
576 # To get a real .dSYM bundle produced by dsymutil, set the
577 # debug information format to dwarf-with-dsym. Since
578 # strip_from_xcode will not be used, set Xcode to do the
579 # stripping as well.
580 'configurations': {
581 'Release': {
582 'xcode_settings': {
583 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
584 'DEPLOYMENT_POSTPROCESSING': 'YES',
585 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:07586 'target_conditions': [
587 ['_type=="shared_library"', {
588 # The Xcode default is to strip debugging symbols
589 # only (-S). Local symbols should be stripped as
590 # well, which will be handled by -x. Xcode will
591 # continue to insert -S when stripping even when
592 # additional flags are added with STRIPFLAGS.
593 'STRIPFLAGS': '-x',
594 }], # _type=="shared_library"
595 ], # target_conditions
596 }, # xcode_settings
597 }, # configuration "Release"
598 }, # configurations
[email protected]24700642009-06-01 16:01:20599 }, { # mac_real_dsym != 1
600 # To get a fast fake .dSYM bundle, use a post-build step to
601 # produce the .dSYM and strip the executable. strip_from_xcode
602 # only operates in the Release configuration.
603 'postbuilds': [
604 {
605 'variables': {
606 # Define strip_from_xcode in a variable ending in _path
607 # so that gyp understands it's a path and performs proper
608 # relativization during dict merging.
609 'strip_from_xcode_path': 'mac/strip_from_xcode',
610 },
611 'postbuild_name': 'Strip If Needed',
612 'action': ['<(strip_from_xcode_path)'],
613 },
[email protected]e14a9f92009-08-05 19:26:07614 ], # postbuilds
615 }], # mac_real_dsym
616 ], # target_conditions
617 }], # _type=="executable" or _type=="shared_library"
618 ], # target_conditions
619 }, # target_defaults
620 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:55621 ['OS=="win"', {
622 'target_defaults': {
623 'defines': [
624 '_WIN32_WINNT=0x0600',
625 'WINVER=0x0600',
626 'WIN32',
627 '_WINDOWS',
628 '_HAS_EXCEPTIONS=0',
629 'NOMINMAX',
630 '_CRT_RAND_S',
631 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
632 'WIN32_LEAN_AND_MEAN',
633 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:45634 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:55635 ],
[email protected]5b5ca7cb2009-07-20 23:00:20636 'msvs_system_include_dirs': [
[email protected]2f80c312009-02-25 21:26:55637 '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Include',
638 '$(VSInstallDir)/VC/atlmfc/include',
639 ],
640 'msvs_cygwin_dirs': ['../third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:55641 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:55642 'msvs_settings': {
643 'VCCLCompilerTool': {
644 'MinimalRebuild': 'false',
645 'ExceptionHandling': '0',
646 'BufferSecurityCheck': 'true',
647 'EnableFunctionLevelLinking': 'true',
648 'RuntimeTypeInfo': 'false',
649 'WarningLevel': '3',
650 'WarnAsError': 'true',
651 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:58652 'conditions': [
[email protected]912c55c2009-07-31 23:33:55653 [ 'msvs_multi_core_compile', {
654 'AdditionalOptions': '/MP',
655 }],
[email protected]3fef6e62009-07-31 19:58:58656 ],
[email protected]2f80c312009-02-25 21:26:55657 },
658 'VCLibrarianTool': {
659 'AdditionalOptions': '/ignore:4221',
[email protected]2f80c312009-02-25 21:26:55660 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51661 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55662 },
663 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:55664 'AdditionalDependencies': [
665 'wininet.lib',
666 'version.lib',
667 'msimg32.lib',
668 'ws2_32.lib',
669 'usp10.lib',
670 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:08671 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:55672 ],
673 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51674 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55675 'GenerateDebugInformation': 'true',
676 'MapFileName': '$(OutDir)\\$(TargetName).map',
677 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
678 'TargetMachine': '1',
679 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:48680 # SubSystem values:
681 # 0 == not set
682 # 1 == /SUBSYSTEM:CONSOLE
683 # 2 == /SUBSYSTEM:WINDOWS
684 # Most of the executables we'll ever create are tests
685 # and utilities with console output.
686 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:55687 },
688 'VCMIDLTool': {
689 'GenerateStublessProxies': 'true',
690 'TypeLibraryName': '$(InputName).tlb',
691 'OutputDirectory': '$(IntDir)',
692 'HeaderFileName': '$(InputName).h',
693 'DLLDataFileName': 'dlldata.c',
694 'InterfaceIdentifierFileName': '$(InputName)_i.c',
695 'ProxyFileName': '$(InputName)_p.c',
696 },
697 'VCResourceCompilerTool': {
698 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:14699 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:55700 },
701 },
702 },
703 }],
704 ['chromium_code==0', {
705 # This section must follow the other conditon sections above because
706 # external_code.gypi expects to be merged into those settings.
707 'includes': [
708 'external_code.gypi',
709 ],
[email protected]dce5df52009-06-29 17:58:25710 }, {
711 'target_defaults': {
712 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
713 # C99 macros on Mac and Linux.
714 'defines': [
715 '__STDC_FORMAT_MACROS',
716 ],
717 },
[email protected]2f80c312009-02-25 21:26:55718 }],
[email protected]48c7af72009-07-03 22:00:19719 ['msvs_use_common_linker_extras', {
720 'target_defaults': {
721 'msvs_settings': {
722 'VCLinkerTool': {
723 'AdditionalOptions':
724 '/safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat',
725 'DelayLoadDLLs': [
726 'dbghelp.dll',
727 'dwmapi.dll',
728 'uxtheme.dll',
729 ],
730 },
731 },
732 },
733 }],
[email protected]2f80c312009-02-25 21:26:55734 ],
[email protected]c13fcbd2009-03-27 04:27:01735 'scons_settings': {
736 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:07737 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:01738 },
[email protected]2f80c312009-02-25 21:26:55739 'xcode_settings': {
740 # The Xcode generator will look for an xcode_settings section at the root
741 # of each dict and use it to apply settings on a file-wide basis. Most
742 # settings should not be here, they should be in target-specific
743 # xcode_settings sections, or better yet, should use non-Xcode-specific
744 # settings in target dicts. SYMROOT is a special case, because many other
745 # Xcode variables depend on it, including variables such as
746 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
747 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
748 # files to appear (when present) in the UI as actual files and not red
749 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
750 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:16751 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:55752 },
753}