blob: 5b7790d93cc2bfdefd5217e340c43311afc07359 [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]214d0fd2009-07-15 01:41:5097 # Set the restrictions on the SUID sandbox binary.
98 # Path: only exec the hard coded chrome binary path
99 # User: only exec binaries owned by the running user.
100 #
101 # Developers should read
102 # http://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment
[email protected]573136142009-07-15 22:48:37103 'linux_suid_sandbox_restrictions%': 'Path',
104
105 # This is the location of the sandbox binary. Chrome looks for this before
106 # running the zygote process. If found, and SUID, it will be used to
107 # sandbox the zygote process and, thus, all renderer processes.
108 'linux_sandbox_path%': '',
109
110 # If |linux_suid_sandbox_restrictions|, above, is 'Path' then only a single
111 # path is allowed to be exec'ed by the sandbox for security reasons. That
112 # path is set here. It should be the final location of the Chromium binary
113 # on the system.
114 'linux_sandbox_chrome_path%': '/opt/google/chrome/chrome',
[email protected]912c55c2009-07-31 23:33:55115
116 'conditions': [
[email protected]e14a9f92009-08-05 19:26:07117 ['OS=="mac"', {
118 'conditions': [
119 # mac_product_name is set to the name of the .app bundle as it should
120 # appear on disk. This duplicates data from
121 # chrome/app/theme/chromium/BRANDING and
122 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
123 # these names into the build system.
124 ['branding=="Chrome"', {
125 'mac_product_name%': 'Google Chrome',
126 }, { # else: branding!="Chrome"
127 'mac_product_name%': 'Chromium',
128 }],
129
130 # Feature variables for enabling Mac Breakpad and Keystone auto-update
131 # support. Both features are on by default in official builds with
132 # Chrome branding.
133 ['branding=="Chrome" and buildtype=="Official"', {
134 'mac_breakpad%': 1,
135 'mac_keystone%': 1,
136 }, { # else: branding!="Chrome" or buildtype!="Official"
137 'mac_breakpad%': 0,
138 'mac_keystone%': 0,
139 }],
140 ],
141 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55142 # Whether to use multiple cores to compile with visual studio. This is
143 # optional because it sometimes causes corruption on VS 2005.
144 # It is on by default on VS 2008 and off on VS 2005.
145 ['OS=="win"', {
146 'conditions': [
147 ['MSVS_VERSION=="2005"', {
[email protected]669795372009-08-14 17:51:13148 'msvs_multi_core_compile%': 0,
[email protected]912c55c2009-07-31 23:33:55149 },{
150 'msvs_multi_core_compile%': 1,
151 }],
[email protected]10bb8c92009-08-07 21:16:03152 # Don't do incremental linking for large modules on 32-bit.
153 ['MSVS_OS_BITS==32', {
154 'msvs_large_module_debug_link_mode%': '1', # No
155 },{
156 'msvs_large_module_debug_link_mode%': '2', # Yes
157 }],
[email protected]912c55c2009-07-31 23:33:55158 ],
159 }],
160 ],
[email protected]2f80c312009-02-25 21:26:55161 },
162 'target_defaults': {
[email protected]1c966092009-08-20 21:19:26163 'variables': {
164 'mac_release_optimization%': '2' # Use -O2 unless overridden
165 },
[email protected]32aa8cc2009-03-04 21:36:39166 'conditions': [
167 ['branding=="Chrome"', {
168 'defines': ['GOOGLE_CHROME_BUILD'],
[email protected]f70085e42009-05-28 20:31:48169 'conditions': [
170 ['OS=="linux"', {
171 'cflags': [ '-gstabs' ],
172 }],
173 ],
[email protected]32aa8cc2009-03-04 21:36:39174 }, { # else: branding!="Chrome"
175 'defines': ['CHROMIUM_BUILD'],
176 }],
[email protected]6cb1cec2009-05-15 03:05:20177 ['toolkit_views==1', {
[email protected]e6970232009-05-12 23:51:17178 'defines': ['TOOLKIT_VIEWS=1'],
179 }],
[email protected]16779842009-07-08 23:45:29180 ['chromeos==1', {
181 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50182 }],
[email protected]f5ecbba12009-04-03 04:35:18183 ['coverage!=0', {
184 'conditions': [
185 ['OS=="mac"', {
186 'xcode_settings': {
[email protected]ab2956372009-08-13 18:11:04187 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
188 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
[email protected]5ae4f55e2009-04-13 23:19:47189 },
[email protected]f5ecbba12009-04-03 04:35:18190 # Add -lgcov for executables, not for static_libraries.
191 # This is a delayed conditional.
192 'target_conditions': [
193 ['_type=="executable"', {
194 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47195 }],
196 ],
197 }],
[email protected]7122ffd52009-04-30 23:19:00198 # Linux gyp (into scons) doesn't like target_conditions?
199 # TODO(???): track down why 'target_conditions' doesn't work
200 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18201 ['OS=="linux"', {
202 'cflags': [ '-ftest-coverage',
203 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00204 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18205 }],
[email protected]e8f6ff42009-07-07 18:20:53206 # Finally, for Windows, we simply turn on profiling.
207 ['OS=="win"', {
208 'msvs_settings': {
209 'VCLinkerTool': {
210 'Profile': 'true',
211 },
[email protected]10bb8c92009-08-07 21:16:03212 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53213 # /Z7, not /Zi, so coverage is happyb
214 'DebugInformationFormat': '1',
215 'AdditionalOptions': '/Yd',
216 }
217 }
218 }], # OS==win
219 ], # conditions for coverage
220 }], # coverage!=0
221 ], # conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55222 'default_configuration': 'Debug',
223 'configurations': {
[email protected]825ff8d2009-05-22 01:40:48224 # VCLinkerTool LinkIncremental values below:
225 # 0 == default
226 # 1 == /INCREMENTAL:NO
227 # 2 == /INCREMENTAL
228 # Debug links incremental, Release does not.
[email protected]2f80c312009-02-25 21:26:55229 'Debug': {
[email protected]1c966092009-08-20 21:19:26230 'xcode_settings': {
231 'COPY_PHASE_STRIP': 'NO',
232 'GCC_OPTIMIZATION_LEVEL': '0', # -O0
233 },
[email protected]2f80c312009-02-25 21:26:55234 'conditions': [
[email protected]2f80c312009-02-25 21:26:55235 [ 'OS=="win"', {
236 'configuration_platform': 'Win32',
237 'msvs_configuration_attributes': {
238 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
239 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
240 'CharacterSet': '1',
241 },
242 'msvs_settings': {
243 'VCCLCompilerTool': {
244 'Optimization': '0',
245 'PreprocessorDefinitions': ['_DEBUG'],
246 'BasicRuntimeChecks': '3',
247 'RuntimeLibrary': '1',
248 },
249 'VCLinkerTool': {
[email protected]1ffb6502009-06-02 07:46:24250 'LinkIncremental': '<(msvs_debug_link_incremental)',
[email protected]2f80c312009-02-25 21:26:55251 },
252 'VCResourceCompilerTool': {
253 'PreprocessorDefinitions': ['_DEBUG'],
254 },
255 },
256 }],
257 ],
258 },
259 'Release': {
260 'defines': [
261 'NDEBUG',
262 ],
[email protected]1c966092009-08-20 21:19:26263 'xcode_settings': {
264 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
265 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
266 },
[email protected]2f80c312009-02-25 21:26:55267 'conditions': [
[email protected]e5b2eaa2009-04-14 01:39:12268 [ 'OS=="win" and msvs_use_common_release', {
[email protected]2f80c312009-02-25 21:26:55269 'configuration_platform': 'Win32',
270 'msvs_props': ['release.vsprops'],
271 }],
[email protected]825ff8d2009-05-22 01:40:48272 [ 'OS=="win"', {
[email protected]1232bb42009-08-19 06:07:01273 'msvs_configuration_attributes': {
274 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
275 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
276 'CharacterSet': '1',
277 },
[email protected]825ff8d2009-05-22 01:40:48278 'msvs_settings': {
279 'VCLinkerTool': {
280 'LinkIncremental': '1',
281 },
282 },
283 }],
[email protected]2f80c312009-02-25 21:26:55284 ],
285 },
[email protected]f926fa0a2009-08-04 22:50:13286 'conditions': [
287 [ 'OS=="win"', {
288 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
289 'Purify': {
290 'defines': [
291 'NDEBUG',
292 'PURIFY',
293 'NO_TCMALLOC',
294 ],
[email protected]1232bb42009-08-19 06:07:01295 'msvs_configuration_attributes': {
296 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
297 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
298 'CharacterSet': '1',
299 },
[email protected]f926fa0a2009-08-04 22:50:13300 'msvs_settings': {
301 'VCCLCompilerTool': {
302 'Optimization': '0',
303 'RuntimeLibrary': '0',
304 'BufferSecurityCheck': 'false',
305 },
306 'VCLinkerTool': {
307 'EnableCOMDATFolding': '1',
308 'LinkIncremental': '1',
309 },
310 },
311 'conditions': [
312 [ 'msvs_use_common_release', {
313 'configuration_platform': 'Win32',
314 'msvs_props': ['release.vsprops'],
315 }],
316 ],
317 },
318 'Release - no tcmalloc': {
319 'defines': [
320 'NDEBUG',
321 'NO_TCMALLOC',
322 ],
[email protected]1232bb42009-08-19 06:07:01323 'msvs_configuration_attributes': {
324 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
325 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
326 'CharacterSet': '1',
327 },
[email protected]f926fa0a2009-08-04 22:50:13328 'conditions': [
329 [ 'msvs_use_common_release', {
330 'configuration_platform': 'Win32',
331 'msvs_props': ['release.vsprops'],
332 }],
333 ],
334 'msvs_settings': {
335 'VCLinkerTool': {
336 'LinkIncremental': '1',
337 },
338 },
339 },
340 }],
341 ],
[email protected]2f80c312009-02-25 21:26:55342 },
343 },
344 'conditions': [
[email protected]606116d22009-05-06 22:38:23345 ['OS=="linux"', {
[email protected]9d384032009-03-20 23:13:26346 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27347 # Enable -Werror by default, but put it in a variable so it can
348 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
349 'variables': {
350 'werror%': '-Werror',
[email protected]cc4219a2009-08-14 05:30:52351 'no_strict_aliasing%': 0,
[email protected]5315f2842009-04-28 00:43:27352 },
[email protected]9d384032009-03-20 23:13:26353 'cflags': [
[email protected]1bba09c2009-08-13 12:53:16354 '<(werror)', # See note above about the werror variable.
355 '-pthread',
356 '-fno-exceptions',
357 '-Wall',
358 '-D_FILE_OFFSET_BITS=64',
[email protected]8a2fcba2009-07-29 00:52:24359 ],
360 'cflags_cc': [
[email protected]1bba09c2009-08-13 12:53:16361 '-fno-rtti',
[email protected]8a2fcba2009-07-29 00:52:24362 '-fno-threadsafe-statics',
[email protected]9d384032009-03-20 23:13:26363 ],
[email protected]a6cf87e2009-04-03 04:07:38364 'ldflags': [
[email protected]9d384032009-03-20 23:13:26365 '-pthread',
366 ],
[email protected]b5e46b92009-03-26 18:58:10367 'scons_variable_settings': {
368 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26369 # Linking of large files uses lots of RAM, so serialize links
370 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01371 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31372 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
373 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26374
375 # We have several cases where archives depend on each other in
376 # a cyclic fashion. Since the GNU linker does only a single
377 # pass over the archives we surround the libraries with
378 # --start-group and --end-group (aka -( and -) ). That causes
379 # ld to loop over the group until no more undefined symbols
380 # are found. In an ideal world we would only make groups from
381 # those libraries which we knew to be in cycles. However,
382 # that's tough with SCons, so we bodge it by making all the
383 # archives a group by redefining the linking command here.
384 #
385 # TODO: investigate whether we still have cycles that
386 # require --{start,end}-group. There has been a lot of
387 # refactoring since this was first coded, which might have
388 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41389 #
390 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
391 # so that we prefer our own built libraries (e.g. -lpng) to
392 # system versions of libraries that pkg-config might turn up.
393 # TODO(sgk): investigate handling this not by re-ordering the
394 # flags this way, but by adding a hook to use the SCons
395 # ParseFlags() option on the output from pkg-config.
396 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
397 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
398 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26399 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29400 # -rpath is only used when building with shared libraries.
401 'conditions': [
402 [ 'library=="shared_library"', {
403 'RPATH': '$LIB_DIR',
404 }],
405 ],
[email protected]9d384032009-03-20 23:13:26406 },
[email protected]b5e46b92009-03-26 18:58:10407 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49408 'AS',
[email protected]b5e46b92009-03-26 18:58:10409 'CC',
410 'CXX',
411 'LINK',
412 ],
413 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49414 'AS',
[email protected]b5e46b92009-03-26 18:58:10415 'CC',
416 'CCACHE_DIR',
417 'CXX',
418 'DISTCC_DIR',
419 'DISTCC_HOSTS',
420 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47421 'INCLUDE_SERVER_ARGS',
422 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10423 'LINK',
[email protected]fff920a2009-05-08 22:35:32424 'CHROME_BUILD_TYPE',
425 'CHROMIUM_BUILD',
426 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10427 ],
[email protected]3aacaf952009-04-02 15:34:09428 'configurations': {
429 'Debug': {
[email protected]c5bdc032009-04-20 19:11:31430 'variables': {
431 'debug_optimize%': '0',
432 },
[email protected]3aacaf952009-04-02 15:34:09433 'defines': [
434 '_DEBUG',
435 ],
436 'cflags': [
[email protected]c5bdc032009-04-20 19:11:31437 '-O<(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09438 '-g',
[email protected]9a5d2a52009-05-22 03:37:45439 # One can use '-gstabs' to enable building the debugging
440 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09441 ],
[email protected]96fd0032009-04-24 00:13:08442 'ldflags': [
443 '-rdynamic', # Allows backtrace to resolve symbols.
444 ],
[email protected]5315f2842009-04-28 00:43:27445 },
[email protected]3aacaf952009-04-02 15:34:09446 'Release': {
[email protected]740e2de2009-07-21 11:41:01447 'variables': {
448 'release_optimize%': '2',
[email protected]1e819852009-07-30 17:47:51449 'release_extra_cflags%': '',
[email protected]740e2de2009-07-21 11:41:01450 },
[email protected]3aacaf952009-04-02 15:34:09451 'cflags': [
[email protected]740e2de2009-07-21 11:41:01452 '-O<(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53453 # Don't emit the GCC version ident directives, they just end up
454 # in the .comment section taking up binary size.
455 '-fno-ident',
456 # Put data and code in their own sections, so that unused symbols
457 # can be removed at link time with --gc-sections.
458 '-fdata-sections',
459 '-ffunction-sections',
[email protected]1e819852009-07-30 17:47:51460 '<(release_extra_cflags)',
[email protected]3aacaf952009-04-02 15:34:09461 ],
462 },
463 },
[email protected]601b540222009-04-03 21:32:04464 'variants': {
465 'coverage': {
466 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
467 'ldflags': ['-fprofile-arcs'],
468 },
469 'profile': {
470 'cflags': ['-pg', '-g'],
471 'ldflags': ['-pg'],
472 },
473 'symbols': {
474 'cflags': ['-g'],
475 },
476 },
[email protected]606116d22009-05-06 22:38:23477 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00478 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23479 'asflags': [
480 # Needed so that libs with .s files (e.g. libicudata.a)
481 # are compatible with the general 32-bit-ness.
482 '-32',
483 ],
484 # All floating-point computations on x87 happens in 80-bit
485 # precision. Because the C and C++ language standards allow
486 # the compiler to keep the floating-point values in higher
487 # precision than what's specified in the source and doing so
488 # is more efficient than constantly rounding up to 64-bit or
489 # 32-bit precision as specified in the source, the compiler,
490 # especially in the optimized mode, tries very hard to keep
491 # values in x87 floating-point stack (in 80-bit precision)
492 # as long as possible. This has important side effects, that
493 # the real value used in computation may change depending on
494 # how the compiler did the optimization - that is, the value
495 # kept in 80-bit is different than the value rounded down to
496 # 64-bit or 32-bit. There are possible compiler options to make
497 # this behavior consistent (e.g. -ffloat-store would keep all
498 # floating-values in the memory, thus force them to be rounded
499 # to its original precision) but they have significant runtime
500 # performance penalty.
501 #
502 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
503 # which keep floating-point values in SSE registers in its
504 # native precision (32-bit for single precision, and 64-bit for
505 # double precision values). This means the floating-point value
506 # used during computation does not change depending on how the
507 # compiler optimized the code, since the value is always kept
508 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06509 'conditions': [
510 ['branding=="Chromium"', {
511 'cflags': [
512 '-march=pentium4',
513 '-msse2',
514 '-mfpmath=sse',
515 ],
516 }],
517 ],
[email protected]606116d22009-05-06 22:38:23518 'cflags': [
519 '-m32',
[email protected]1c6560af2009-07-14 11:02:16520 ],
[email protected]606116d22009-05-06 22:38:23521 'ldflags': [
522 '-m32',
523 ],
524 }],
[email protected]3dda8a962009-08-10 18:58:07525 ['target_arch=="arm"', {
526 'conditions': [
527 ['chromeos==1', {
528 'cflags': [
529 '-march=armv7-a',
530 '-mtune=cortex-a8',
531 '-mfpu=vfp',
532 '-mfloat-abi=softfp',
533 ],
534 }],
535 ],
536 }],
[email protected]cc4219a2009-08-14 05:30:52537 ['no_strict_aliasing==1', {
538 'cflags': [
539 '-fno-strict-aliasing',
540 ],
541 }],
[email protected]606116d22009-05-06 22:38:23542 ],
[email protected]9d384032009-03-20 23:13:26543 },
544 }],
[email protected]2f80c312009-02-25 21:26:55545 ['OS=="mac"', {
546 'target_defaults': {
[email protected]24700642009-06-01 16:01:20547 'variables': {
548 # This should be 'mac_real_dsym%', but there seems to be a bug
549 # with % in variables that are intended to be set to different
550 # values in different targets, like this one.
551 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
552 },
[email protected]d92c7c012009-03-19 19:26:42553 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:55554 'xcode_settings': {
555 'ALWAYS_SEARCH_USER_PATHS': 'NO',
[email protected]ab2956372009-08-13 18:11:04556 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
557 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
558 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
559 # (Equivalent to -fPIC)
560 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
561 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
562 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
563 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
564 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
565 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
566 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
567 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
[email protected]2f80c312009-02-25 21:26:55568 'GCC_VERSION': '4.2',
[email protected]ab2956372009-08-13 18:11:04569 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
570 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
571 'PREBINDING': 'NO', # No -Wl,-prebind
572 'SDKROOT': 'macosx10.5', # -isysroot
[email protected]2f80c312009-02-25 21:26:55573 'USE_HEADERMAP': 'NO',
574 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:24575 'conditions': [
576 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
577 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}],
578 ],
[email protected]2f80c312009-02-25 21:26:55579 },
580 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:55581 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:46582 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
583 }],
584 ['_mac_bundle', {
585 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:08586 }],
[email protected]e14a9f92009-08-05 19:26:07587 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:20588 'target_conditions': [
589 ['mac_real_dsym == 1', {
590 # To get a real .dSYM bundle produced by dsymutil, set the
591 # debug information format to dwarf-with-dsym. Since
592 # strip_from_xcode will not be used, set Xcode to do the
593 # stripping as well.
594 'configurations': {
595 'Release': {
596 'xcode_settings': {
597 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
598 'DEPLOYMENT_POSTPROCESSING': 'YES',
599 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:07600 'target_conditions': [
601 ['_type=="shared_library"', {
602 # The Xcode default is to strip debugging symbols
603 # only (-S). Local symbols should be stripped as
604 # well, which will be handled by -x. Xcode will
605 # continue to insert -S when stripping even when
606 # additional flags are added with STRIPFLAGS.
607 'STRIPFLAGS': '-x',
608 }], # _type=="shared_library"
609 ], # target_conditions
610 }, # xcode_settings
611 }, # configuration "Release"
612 }, # configurations
[email protected]24700642009-06-01 16:01:20613 }, { # mac_real_dsym != 1
614 # To get a fast fake .dSYM bundle, use a post-build step to
615 # produce the .dSYM and strip the executable. strip_from_xcode
616 # only operates in the Release configuration.
617 'postbuilds': [
618 {
619 'variables': {
620 # Define strip_from_xcode in a variable ending in _path
621 # so that gyp understands it's a path and performs proper
622 # relativization during dict merging.
623 'strip_from_xcode_path': 'mac/strip_from_xcode',
624 },
625 'postbuild_name': 'Strip If Needed',
626 'action': ['<(strip_from_xcode_path)'],
627 },
[email protected]e14a9f92009-08-05 19:26:07628 ], # postbuilds
629 }], # mac_real_dsym
630 ], # target_conditions
631 }], # _type=="executable" or _type=="shared_library"
632 ], # target_conditions
633 }, # target_defaults
634 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:55635 ['OS=="win"', {
636 'target_defaults': {
637 'defines': [
638 '_WIN32_WINNT=0x0600',
639 'WINVER=0x0600',
640 'WIN32',
641 '_WINDOWS',
642 '_HAS_EXCEPTIONS=0',
643 'NOMINMAX',
644 '_CRT_RAND_S',
645 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
646 'WIN32_LEAN_AND_MEAN',
647 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:45648 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:55649 ],
[email protected]5b5ca7cb2009-07-20 23:00:20650 'msvs_system_include_dirs': [
[email protected]2f80c312009-02-25 21:26:55651 '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Include',
652 '$(VSInstallDir)/VC/atlmfc/include',
653 ],
654 'msvs_cygwin_dirs': ['../third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:55655 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:55656 'msvs_settings': {
657 'VCCLCompilerTool': {
658 'MinimalRebuild': 'false',
659 'ExceptionHandling': '0',
660 'BufferSecurityCheck': 'true',
661 'EnableFunctionLevelLinking': 'true',
662 'RuntimeTypeInfo': 'false',
663 'WarningLevel': '3',
664 'WarnAsError': 'true',
665 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:58666 'conditions': [
[email protected]912c55c2009-07-31 23:33:55667 [ 'msvs_multi_core_compile', {
668 'AdditionalOptions': '/MP',
669 }],
[email protected]3fef6e62009-07-31 19:58:58670 ],
[email protected]2f80c312009-02-25 21:26:55671 },
672 'VCLibrarianTool': {
673 'AdditionalOptions': '/ignore:4221',
[email protected]2f80c312009-02-25 21:26:55674 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51675 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55676 },
677 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:55678 'AdditionalDependencies': [
679 'wininet.lib',
680 'version.lib',
681 'msimg32.lib',
682 'ws2_32.lib',
683 'usp10.lib',
684 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:08685 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:55686 ],
687 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51688 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55689 'GenerateDebugInformation': 'true',
690 'MapFileName': '$(OutDir)\\$(TargetName).map',
691 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
692 'TargetMachine': '1',
693 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:48694 # SubSystem values:
695 # 0 == not set
696 # 1 == /SUBSYSTEM:CONSOLE
697 # 2 == /SUBSYSTEM:WINDOWS
698 # Most of the executables we'll ever create are tests
699 # and utilities with console output.
700 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:55701 },
702 'VCMIDLTool': {
703 'GenerateStublessProxies': 'true',
704 'TypeLibraryName': '$(InputName).tlb',
705 'OutputDirectory': '$(IntDir)',
706 'HeaderFileName': '$(InputName).h',
707 'DLLDataFileName': 'dlldata.c',
708 'InterfaceIdentifierFileName': '$(InputName)_i.c',
709 'ProxyFileName': '$(InputName)_p.c',
710 },
711 'VCResourceCompilerTool': {
712 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:14713 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:55714 },
715 },
716 },
717 }],
718 ['chromium_code==0', {
719 # This section must follow the other conditon sections above because
720 # external_code.gypi expects to be merged into those settings.
721 'includes': [
722 'external_code.gypi',
723 ],
[email protected]dce5df52009-06-29 17:58:25724 }, {
725 'target_defaults': {
726 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
727 # C99 macros on Mac and Linux.
728 'defines': [
729 '__STDC_FORMAT_MACROS',
730 ],
731 },
[email protected]2f80c312009-02-25 21:26:55732 }],
[email protected]48c7af72009-07-03 22:00:19733 ['msvs_use_common_linker_extras', {
734 'target_defaults': {
735 'msvs_settings': {
736 'VCLinkerTool': {
737 'AdditionalOptions':
738 '/safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat',
739 'DelayLoadDLLs': [
740 'dbghelp.dll',
741 'dwmapi.dll',
742 'uxtheme.dll',
743 ],
744 },
745 },
746 },
747 }],
[email protected]2f80c312009-02-25 21:26:55748 ],
[email protected]c13fcbd2009-03-27 04:27:01749 'scons_settings': {
750 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:07751 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:01752 },
[email protected]2f80c312009-02-25 21:26:55753 'xcode_settings': {
754 # The Xcode generator will look for an xcode_settings section at the root
755 # of each dict and use it to apply settings on a file-wide basis. Most
756 # settings should not be here, they should be in target-specific
757 # xcode_settings sections, or better yet, should use non-Xcode-specific
758 # settings in target dicts. SYMROOT is a special case, because many other
759 # Xcode variables depend on it, including variables such as
760 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
761 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
762 # files to appear (when present) in the UI as actual files and not red
763 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
764 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:16765 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:55766 },
767}