blob: 2026ca6f836fbd1f061a8fc1cc2d1df6624618e6 [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',
[email protected]cbd5fd52009-08-26 00:14:2734
35 # We do want to build Chromium with Breakpad support in certain
36 # situations. I.e. for Chrome bot.
37 'linux_chromium_breakpad%': 0,
[email protected]e14a9f92009-08-05 19:26:0738 },
39
40 # Define branding and buildtype on the basis of their settings within the
41 # variables sub-dict above, unless overridden.
42 'branding%': '<(branding)',
43 'buildtype%': '<(buildtype)',
44
[email protected]b3fb8092009-03-12 19:09:2445 # Override chromium_mac_pch and set it to 0 to suppress the use of
46 # precompiled headers on the Mac. Prefix header injection may still be
47 # used, but prefix headers will not be precompiled. This is useful when
48 # using distcc to distribute a build to compile slaves that don't
49 # share the same compiler executable as the system driving the compilation,
50 # because precompiled headers rely on pointers into a specific compiler
51 # executable's image. Setting this to 0 is needed to use an experimental
52 # Linux-Mac cross compiler distcc farm.
53 'chromium_mac_pch%': 1,
54
[email protected]f5ecbba12009-04-03 04:35:1855 # Set to 1 to enable code coverage. In addition to build changes
56 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
57 # project file called "coverage".
58 # Currently ignored on Windows.
59 'coverage%': 0,
[email protected]653bd5f032009-04-08 12:55:4960
[email protected]c61f6432009-04-22 01:16:4261 # Overridable specification for potential use of alternative
62 # JavaScript engines.
63 'javascript_engine%': 'v8',
64
[email protected]653bd5f032009-04-08 12:55:4965 # To do a shared build on linux we need to be able to choose between type
66 # static_library and shared_library. We default to doing a static build
67 # but you can override this with "gyp -Dlibrary=shared_library" or you
68 # can add the following line (without the #) to ~/.gyp/include.gypi
69 # {'variables': {'library': 'shared_library'}}
70 # to compile as shared by default
71 'library%': 'static_library',
[email protected]06e6f872009-09-01 19:09:4172
73 # The Google Update appid.
74 'google_update_appid%': '{8A69D345-D564-463c-AFF1-A69D9E530F96}',
[email protected]bdd94652009-09-11 00:01:3975
76 # Extra defines to add to built targets
77 'extra_custom_defines%': [],
[email protected]e5b2eaa2009-04-14 01:39:1278
79 # TODO(bradnelson): eliminate this when possible.
80 # To allow local gyp files to prevent release.vsprops from being included.
81 # Yes(1) means include release.vsprops.
82 # Once all vsprops settings are migrated into gyp, this can go away.
83 'msvs_use_common_release%': 1,
[email protected]606116d22009-05-06 22:38:2384
[email protected]cbd5fd52009-08-26 00:14:2785 # TODO(bradnelson): eliminate this when possible.
86 # To allow local gyp files to override additional linker options for msvs.
87 # Yes(1) means set use the common linker options.
[email protected]48c7af72009-07-03 22:00:1988 'msvs_use_common_linker_extras%': 1,
89
[email protected]1ffb6502009-06-02 07:46:2490 # TODO(sgk): eliminate this if possible.
91 # It would be nicer to support this via a setting in 'target_defaults'
92 # in chrome/app/locales/locales.gypi overriding the setting in the
93 # 'Debug' configuration in the 'target_defaults' dict below,
94 # but that doesn't work as we'd like.
95 'msvs_debug_link_incremental%': '2',
96
[email protected]606116d22009-05-06 22:38:2397 # The architecture that we're building on.
98 'target_arch%': 'ia32',
[email protected]e6970232009-05-12 23:51:1799
100 # By default linux does not use views. To turn on views in Linux
101 # set the variable GYP_DEFINES to "toolkit_views=1", or modify
102 # ~/.gyp/include.gypi .
103 'toolkit_views%': 0,
[email protected]2b883b92009-06-02 22:57:50104
[email protected]16779842009-07-08 23:45:29105 'chromeos%': 0,
[email protected]397fe9d2009-06-30 00:02:27106
[email protected]ee28c9f2009-09-04 01:53:01107 # The system root for cross-compiles. Default: none.
108 'sysroot%': '',
109
[email protected]573136142009-07-15 22:48:37110 # This is the location of the sandbox binary. Chrome looks for this before
111 # running the zygote process. If found, and SUID, it will be used to
112 # sandbox the zygote process and, thus, all renderer processes.
113 'linux_sandbox_path%': '',
114
[email protected]912c55c2009-07-31 23:33:55115 'conditions': [
[email protected]cbd5fd52009-08-26 00:14:27116 ['OS=="linux"', {
117 'conditions': [
118 ['branding=="Chrome" or linux_chromium_breakpad==1', {
119 'linux_breakpad%': 1,
120 }, {
121 'linux_breakpad%': 0,
122 }],
123 ],
124 }], # OS=="linux"
[email protected]e14a9f92009-08-05 19:26:07125 ['OS=="mac"', {
126 'conditions': [
127 # mac_product_name is set to the name of the .app bundle as it should
128 # appear on disk. This duplicates data from
129 # chrome/app/theme/chromium/BRANDING and
130 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
131 # these names into the build system.
132 ['branding=="Chrome"', {
133 'mac_product_name%': 'Google Chrome',
134 }, { # else: branding!="Chrome"
135 'mac_product_name%': 'Chromium',
136 }],
137
138 # Feature variables for enabling Mac Breakpad and Keystone auto-update
139 # support. Both features are on by default in official builds with
140 # Chrome branding.
141 ['branding=="Chrome" and buildtype=="Official"', {
142 'mac_breakpad%': 1,
143 'mac_keystone%': 1,
144 }, { # else: branding!="Chrome" or buildtype!="Official"
145 'mac_breakpad%': 0,
146 'mac_keystone%': 0,
147 }],
148 ],
149 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55150 # Whether to use multiple cores to compile with visual studio. This is
151 # optional because it sometimes causes corruption on VS 2005.
152 # It is on by default on VS 2008 and off on VS 2005.
153 ['OS=="win"', {
154 'conditions': [
155 ['MSVS_VERSION=="2005"', {
[email protected]669795372009-08-14 17:51:13156 'msvs_multi_core_compile%': 0,
[email protected]912c55c2009-07-31 23:33:55157 },{
158 'msvs_multi_core_compile%': 1,
159 }],
[email protected]10bb8c92009-08-07 21:16:03160 # Don't do incremental linking for large modules on 32-bit.
161 ['MSVS_OS_BITS==32', {
162 'msvs_large_module_debug_link_mode%': '1', # No
163 },{
164 'msvs_large_module_debug_link_mode%': '2', # Yes
165 }],
[email protected]912c55c2009-07-31 23:33:55166 ],
167 }],
168 ],
[email protected]2f80c312009-02-25 21:26:55169 },
170 'target_defaults': {
[email protected]1c966092009-08-20 21:19:26171 'variables': {
[email protected]d5d593a2009-08-28 23:23:29172 'mac_release_optimization%': '3', # Use -O3 unless overridden
[email protected]ffd984b12009-09-11 19:37:00173 'mac_debug_optimization%': '0', # Use -O0 unless overridden
174 'release_extra_cflags%': '',
175 'debug_extra_cflags%': '',
[email protected]1c966092009-08-20 21:19:26176 },
[email protected]bdd94652009-09-11 00:01:39177 'defines': [
178 '<@(extra_custom_defines)',
179 ],
[email protected]32aa8cc2009-03-04 21:36:39180 'conditions': [
181 ['branding=="Chrome"', {
182 'defines': ['GOOGLE_CHROME_BUILD'],
183 }, { # else: branding!="Chrome"
184 'defines': ['CHROMIUM_BUILD'],
185 }],
[email protected]6cb1cec2009-05-15 03:05:20186 ['toolkit_views==1', {
[email protected]e6970232009-05-12 23:51:17187 'defines': ['TOOLKIT_VIEWS=1'],
188 }],
[email protected]16779842009-07-08 23:45:29189 ['chromeos==1', {
190 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50191 }],
[email protected]f5ecbba12009-04-03 04:35:18192 ['coverage!=0', {
193 'conditions': [
194 ['OS=="mac"', {
195 'xcode_settings': {
[email protected]ab2956372009-08-13 18:11:04196 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
197 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
[email protected]5ae4f55e2009-04-13 23:19:47198 },
[email protected]f5ecbba12009-04-03 04:35:18199 # Add -lgcov for executables, not for static_libraries.
200 # This is a delayed conditional.
201 'target_conditions': [
202 ['_type=="executable"', {
203 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47204 }],
205 ],
206 }],
[email protected]7122ffd52009-04-30 23:19:00207 # Linux gyp (into scons) doesn't like target_conditions?
208 # TODO(???): track down why 'target_conditions' doesn't work
209 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18210 ['OS=="linux"', {
211 'cflags': [ '-ftest-coverage',
212 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00213 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18214 }],
[email protected]e8f6ff42009-07-07 18:20:53215 # Finally, for Windows, we simply turn on profiling.
216 ['OS=="win"', {
217 'msvs_settings': {
218 'VCLinkerTool': {
219 'Profile': 'true',
220 },
[email protected]10bb8c92009-08-07 21:16:03221 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53222 # /Z7, not /Zi, so coverage is happyb
223 'DebugInformationFormat': '1',
224 'AdditionalOptions': '/Yd',
225 }
226 }
227 }], # OS==win
228 ], # conditions for coverage
229 }], # coverage!=0
230 ], # conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55231 'default_configuration': 'Debug',
232 'configurations': {
[email protected]825ff8d2009-05-22 01:40:48233 # VCLinkerTool LinkIncremental values below:
234 # 0 == default
235 # 1 == /INCREMENTAL:NO
236 # 2 == /INCREMENTAL
237 # Debug links incremental, Release does not.
[email protected]2f80c312009-02-25 21:26:55238 'Debug': {
[email protected]1c966092009-08-20 21:19:26239 'xcode_settings': {
240 'COPY_PHASE_STRIP': 'NO',
[email protected]d5d593a2009-08-28 23:23:29241 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
[email protected]ffd984b12009-09-11 19:37:00242 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26243 },
[email protected]2f80c312009-02-25 21:26:55244 'conditions': [
[email protected]2f80c312009-02-25 21:26:55245 [ 'OS=="win"', {
246 'configuration_platform': 'Win32',
247 'msvs_configuration_attributes': {
248 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
249 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
250 'CharacterSet': '1',
251 },
252 'msvs_settings': {
253 'VCCLCompilerTool': {
254 'Optimization': '0',
255 'PreprocessorDefinitions': ['_DEBUG'],
256 'BasicRuntimeChecks': '3',
257 'RuntimeLibrary': '1',
258 },
259 'VCLinkerTool': {
[email protected]1ffb6502009-06-02 07:46:24260 'LinkIncremental': '<(msvs_debug_link_incremental)',
[email protected]2f80c312009-02-25 21:26:55261 },
262 'VCResourceCompilerTool': {
263 'PreprocessorDefinitions': ['_DEBUG'],
264 },
265 },
266 }],
[email protected]ffd984b12009-09-11 19:37:00267 ['OS=="linux"', {
268 'cflags': [
269 '<@(debug_extra_cflags)',
270 ],
271 }],
[email protected]2f80c312009-02-25 21:26:55272 ],
273 },
274 'Release': {
275 'defines': [
276 'NDEBUG',
277 ],
[email protected]1c966092009-08-20 21:19:26278 'xcode_settings': {
279 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
280 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
[email protected]ffd984b12009-09-11 19:37:00281 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26282 },
[email protected]2f80c312009-02-25 21:26:55283 'conditions': [
[email protected]e5b2eaa2009-04-14 01:39:12284 [ 'OS=="win" and msvs_use_common_release', {
[email protected]2f80c312009-02-25 21:26:55285 'msvs_props': ['release.vsprops'],
286 }],
[email protected]825ff8d2009-05-22 01:40:48287 [ 'OS=="win"', {
[email protected]af7bdc42009-08-26 06:41:49288 'configuration_platform': 'Win32',
[email protected]1232bb42009-08-19 06:07:01289 'msvs_configuration_attributes': {
290 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
291 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
292 'CharacterSet': '1',
293 },
[email protected]825ff8d2009-05-22 01:40:48294 'msvs_settings': {
295 'VCLinkerTool': {
296 'LinkIncremental': '1',
297 },
298 },
299 }],
[email protected]ffd984b12009-09-11 19:37:00300 ['OS=="linux"', {
301 'cflags': [
302 '<@(release_extra_cflags)',
303 ],
304 }],
[email protected]2f80c312009-02-25 21:26:55305 ],
306 },
[email protected]f926fa0a2009-08-04 22:50:13307 'conditions': [
308 [ 'OS=="win"', {
309 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
310 'Purify': {
[email protected]af7bdc42009-08-26 06:41:49311 'configuration_platform': 'Win32',
[email protected]f926fa0a2009-08-04 22:50:13312 'defines': [
313 'NDEBUG',
314 'PURIFY',
315 'NO_TCMALLOC',
316 ],
[email protected]1232bb42009-08-19 06:07:01317 'msvs_configuration_attributes': {
318 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
319 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
320 'CharacterSet': '1',
321 },
[email protected]f926fa0a2009-08-04 22:50:13322 'msvs_settings': {
323 'VCCLCompilerTool': {
324 'Optimization': '0',
325 'RuntimeLibrary': '0',
326 'BufferSecurityCheck': 'false',
327 },
328 'VCLinkerTool': {
329 'EnableCOMDATFolding': '1',
330 'LinkIncremental': '1',
331 },
332 },
333 'conditions': [
334 [ 'msvs_use_common_release', {
[email protected]f926fa0a2009-08-04 22:50:13335 'msvs_props': ['release.vsprops'],
336 }],
337 ],
338 },
339 'Release - no tcmalloc': {
[email protected]af7bdc42009-08-26 06:41:49340 'configuration_platform': 'Win32',
[email protected]f926fa0a2009-08-04 22:50:13341 'defines': [
342 'NDEBUG',
343 'NO_TCMALLOC',
344 ],
[email protected]1232bb42009-08-19 06:07:01345 'msvs_configuration_attributes': {
346 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
347 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
348 'CharacterSet': '1',
349 },
[email protected]f926fa0a2009-08-04 22:50:13350 'conditions': [
351 [ 'msvs_use_common_release', {
[email protected]f926fa0a2009-08-04 22:50:13352 'msvs_props': ['release.vsprops'],
353 }],
354 ],
355 'msvs_settings': {
356 'VCLinkerTool': {
357 'LinkIncremental': '1',
358 },
359 },
360 },
361 }],
362 ],
[email protected]2f80c312009-02-25 21:26:55363 },
364 },
365 'conditions': [
[email protected]606116d22009-05-06 22:38:23366 ['OS=="linux"', {
[email protected]9d384032009-03-20 23:13:26367 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27368 # Enable -Werror by default, but put it in a variable so it can
369 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
370 'variables': {
371 'werror%': '-Werror',
[email protected]cc4219a2009-08-14 05:30:52372 'no_strict_aliasing%': 0,
[email protected]5315f2842009-04-28 00:43:27373 },
[email protected]9d384032009-03-20 23:13:26374 'cflags': [
[email protected]1bba09c2009-08-13 12:53:16375 '<(werror)', # See note above about the werror variable.
376 '-pthread',
377 '-fno-exceptions',
378 '-Wall',
379 '-D_FILE_OFFSET_BITS=64',
[email protected]8a2fcba2009-07-29 00:52:24380 ],
381 'cflags_cc': [
[email protected]1bba09c2009-08-13 12:53:16382 '-fno-rtti',
[email protected]8a2fcba2009-07-29 00:52:24383 '-fno-threadsafe-statics',
[email protected]9d384032009-03-20 23:13:26384 ],
[email protected]a6cf87e2009-04-03 04:07:38385 'ldflags': [
[email protected]9d384032009-03-20 23:13:26386 '-pthread',
387 ],
[email protected]b5e46b92009-03-26 18:58:10388 'scons_variable_settings': {
389 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26390 # Linking of large files uses lots of RAM, so serialize links
391 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01392 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31393 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
394 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26395
396 # We have several cases where archives depend on each other in
397 # a cyclic fashion. Since the GNU linker does only a single
398 # pass over the archives we surround the libraries with
399 # --start-group and --end-group (aka -( and -) ). That causes
400 # ld to loop over the group until no more undefined symbols
401 # are found. In an ideal world we would only make groups from
402 # those libraries which we knew to be in cycles. However,
403 # that's tough with SCons, so we bodge it by making all the
404 # archives a group by redefining the linking command here.
405 #
406 # TODO: investigate whether we still have cycles that
407 # require --{start,end}-group. There has been a lot of
408 # refactoring since this was first coded, which might have
409 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41410 #
411 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
412 # so that we prefer our own built libraries (e.g. -lpng) to
413 # system versions of libraries that pkg-config might turn up.
414 # TODO(sgk): investigate handling this not by re-ordering the
415 # flags this way, but by adding a hook to use the SCons
416 # ParseFlags() option on the output from pkg-config.
417 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
418 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
419 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26420 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29421 # -rpath is only used when building with shared libraries.
422 'conditions': [
423 [ 'library=="shared_library"', {
424 'RPATH': '$LIB_DIR',
425 }],
426 ],
[email protected]9d384032009-03-20 23:13:26427 },
[email protected]b5e46b92009-03-26 18:58:10428 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49429 'AS',
[email protected]b5e46b92009-03-26 18:58:10430 'CC',
431 'CXX',
432 'LINK',
433 ],
434 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49435 'AS',
[email protected]b5e46b92009-03-26 18:58:10436 'CC',
437 'CCACHE_DIR',
438 'CXX',
439 'DISTCC_DIR',
440 'DISTCC_HOSTS',
441 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47442 'INCLUDE_SERVER_ARGS',
443 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10444 'LINK',
[email protected]fff920a2009-05-08 22:35:32445 'CHROME_BUILD_TYPE',
446 'CHROMIUM_BUILD',
447 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10448 ],
[email protected]3aacaf952009-04-02 15:34:09449 'configurations': {
450 'Debug': {
[email protected]c5bdc032009-04-20 19:11:31451 'variables': {
452 'debug_optimize%': '0',
453 },
[email protected]3aacaf952009-04-02 15:34:09454 'defines': [
455 '_DEBUG',
456 ],
457 'cflags': [
[email protected]c5bdc032009-04-20 19:11:31458 '-O<(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09459 '-g',
[email protected]9a5d2a52009-05-22 03:37:45460 # One can use '-gstabs' to enable building the debugging
461 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09462 ],
[email protected]96fd0032009-04-24 00:13:08463 'ldflags': [
464 '-rdynamic', # Allows backtrace to resolve symbols.
465 ],
[email protected]5315f2842009-04-28 00:43:27466 },
[email protected]3aacaf952009-04-02 15:34:09467 'Release': {
[email protected]740e2de2009-07-21 11:41:01468 'variables': {
469 'release_optimize%': '2',
470 },
[email protected]3aacaf952009-04-02 15:34:09471 'cflags': [
[email protected]740e2de2009-07-21 11:41:01472 '-O<(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53473 # Don't emit the GCC version ident directives, they just end up
474 # in the .comment section taking up binary size.
475 '-fno-ident',
476 # Put data and code in their own sections, so that unused symbols
477 # can be removed at link time with --gc-sections.
478 '-fdata-sections',
479 '-ffunction-sections',
[email protected]3aacaf952009-04-02 15:34:09480 ],
481 },
482 },
[email protected]601b540222009-04-03 21:32:04483 'variants': {
484 'coverage': {
485 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
486 'ldflags': ['-fprofile-arcs'],
487 },
488 'profile': {
489 'cflags': ['-pg', '-g'],
490 'ldflags': ['-pg'],
491 },
492 'symbols': {
493 'cflags': ['-g'],
494 },
495 },
[email protected]606116d22009-05-06 22:38:23496 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00497 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23498 'asflags': [
499 # Needed so that libs with .s files (e.g. libicudata.a)
500 # are compatible with the general 32-bit-ness.
501 '-32',
502 ],
503 # All floating-point computations on x87 happens in 80-bit
504 # precision. Because the C and C++ language standards allow
505 # the compiler to keep the floating-point values in higher
506 # precision than what's specified in the source and doing so
507 # is more efficient than constantly rounding up to 64-bit or
508 # 32-bit precision as specified in the source, the compiler,
509 # especially in the optimized mode, tries very hard to keep
510 # values in x87 floating-point stack (in 80-bit precision)
511 # as long as possible. This has important side effects, that
512 # the real value used in computation may change depending on
513 # how the compiler did the optimization - that is, the value
514 # kept in 80-bit is different than the value rounded down to
515 # 64-bit or 32-bit. There are possible compiler options to make
516 # this behavior consistent (e.g. -ffloat-store would keep all
517 # floating-values in the memory, thus force them to be rounded
518 # to its original precision) but they have significant runtime
519 # performance penalty.
520 #
521 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
522 # which keep floating-point values in SSE registers in its
523 # native precision (32-bit for single precision, and 64-bit for
524 # double precision values). This means the floating-point value
525 # used during computation does not change depending on how the
526 # compiler optimized the code, since the value is always kept
527 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06528 'conditions': [
529 ['branding=="Chromium"', {
530 'cflags': [
531 '-march=pentium4',
532 '-msse2',
533 '-mfpmath=sse',
534 ],
535 }],
536 ],
[email protected]606116d22009-05-06 22:38:23537 'cflags': [
538 '-m32',
[email protected]1c6560af2009-07-14 11:02:16539 ],
[email protected]606116d22009-05-06 22:38:23540 'ldflags': [
541 '-m32',
542 ],
543 }],
[email protected]3dda8a962009-08-10 18:58:07544 ['target_arch=="arm"', {
545 'conditions': [
546 ['chromeos==1', {
547 'cflags': [
548 '-march=armv7-a',
549 '-mtune=cortex-a8',
550 '-mfpu=vfp',
551 '-mfloat-abi=softfp',
552 ],
553 }],
554 ],
555 }],
[email protected]ee28c9f2009-09-04 01:53:01556 ['sysroot!=""', {
557 'cflags': [
558 '--sysroot=<(sysroot)',
559 ],
560 'ldflags': [
561 '--sysroot=<(sysroot)',
562 ],
563 }],
[email protected]cc4219a2009-08-14 05:30:52564 ['no_strict_aliasing==1', {
565 'cflags': [
566 '-fno-strict-aliasing',
567 ],
568 }],
[email protected]cbd5fd52009-08-26 00:14:27569 ['linux_breakpad==1', {
570 'cflags': [ '-gstabs' ],
571 'defines': ['USE_LINUX_BREAKPAD'],
572 }],
[email protected]606116d22009-05-06 22:38:23573 ],
[email protected]9d384032009-03-20 23:13:26574 },
575 }],
[email protected]2f80c312009-02-25 21:26:55576 ['OS=="mac"', {
577 'target_defaults': {
[email protected]24700642009-06-01 16:01:20578 'variables': {
579 # This should be 'mac_real_dsym%', but there seems to be a bug
580 # with % in variables that are intended to be set to different
581 # values in different targets, like this one.
582 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
583 },
[email protected]d92c7c012009-03-19 19:26:42584 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:55585 'xcode_settings': {
586 'ALWAYS_SEARCH_USER_PATHS': 'NO',
[email protected]ab2956372009-08-13 18:11:04587 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
588 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
589 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
590 # (Equivalent to -fPIC)
591 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
592 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
593 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
594 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
595 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
596 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
597 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
598 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
[email protected]2f80c312009-02-25 21:26:55599 'GCC_VERSION': '4.2',
[email protected]ab2956372009-08-13 18:11:04600 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
601 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
602 'PREBINDING': 'NO', # No -Wl,-prebind
603 'SDKROOT': 'macosx10.5', # -isysroot
[email protected]2f80c312009-02-25 21:26:55604 'USE_HEADERMAP': 'NO',
605 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:24606 'conditions': [
607 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
608 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}],
609 ],
[email protected]2f80c312009-02-25 21:26:55610 },
611 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:55612 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:46613 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
614 }],
615 ['_mac_bundle', {
616 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:08617 }],
[email protected]e14a9f92009-08-05 19:26:07618 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:20619 'target_conditions': [
620 ['mac_real_dsym == 1', {
621 # To get a real .dSYM bundle produced by dsymutil, set the
622 # debug information format to dwarf-with-dsym. Since
623 # strip_from_xcode will not be used, set Xcode to do the
624 # stripping as well.
625 'configurations': {
626 'Release': {
627 'xcode_settings': {
628 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
629 'DEPLOYMENT_POSTPROCESSING': 'YES',
630 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:07631 'target_conditions': [
632 ['_type=="shared_library"', {
633 # The Xcode default is to strip debugging symbols
634 # only (-S). Local symbols should be stripped as
635 # well, which will be handled by -x. Xcode will
636 # continue to insert -S when stripping even when
637 # additional flags are added with STRIPFLAGS.
638 'STRIPFLAGS': '-x',
639 }], # _type=="shared_library"
640 ], # target_conditions
641 }, # xcode_settings
642 }, # configuration "Release"
643 }, # configurations
[email protected]24700642009-06-01 16:01:20644 }, { # mac_real_dsym != 1
645 # To get a fast fake .dSYM bundle, use a post-build step to
646 # produce the .dSYM and strip the executable. strip_from_xcode
647 # only operates in the Release configuration.
648 'postbuilds': [
649 {
650 'variables': {
651 # Define strip_from_xcode in a variable ending in _path
652 # so that gyp understands it's a path and performs proper
653 # relativization during dict merging.
654 'strip_from_xcode_path': 'mac/strip_from_xcode',
655 },
656 'postbuild_name': 'Strip If Needed',
657 'action': ['<(strip_from_xcode_path)'],
658 },
[email protected]e14a9f92009-08-05 19:26:07659 ], # postbuilds
660 }], # mac_real_dsym
661 ], # target_conditions
662 }], # _type=="executable" or _type=="shared_library"
663 ], # target_conditions
664 }, # target_defaults
665 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:55666 ['OS=="win"', {
667 'target_defaults': {
668 'defines': [
669 '_WIN32_WINNT=0x0600',
670 'WINVER=0x0600',
671 'WIN32',
672 '_WINDOWS',
673 '_HAS_EXCEPTIONS=0',
674 'NOMINMAX',
675 '_CRT_RAND_S',
676 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
677 'WIN32_LEAN_AND_MEAN',
678 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:45679 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:55680 ],
[email protected]5b5ca7cb2009-07-20 23:00:20681 'msvs_system_include_dirs': [
[email protected]2f80c312009-02-25 21:26:55682 '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Include',
683 '$(VSInstallDir)/VC/atlmfc/include',
684 ],
[email protected]a8d99cef2009-08-26 20:47:49685 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:55686 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:55687 'msvs_settings': {
688 'VCCLCompilerTool': {
689 'MinimalRebuild': 'false',
690 'ExceptionHandling': '0',
691 'BufferSecurityCheck': 'true',
692 'EnableFunctionLevelLinking': 'true',
693 'RuntimeTypeInfo': 'false',
694 'WarningLevel': '3',
695 'WarnAsError': 'true',
696 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:58697 'conditions': [
[email protected]912c55c2009-07-31 23:33:55698 [ 'msvs_multi_core_compile', {
699 'AdditionalOptions': '/MP',
700 }],
[email protected]3fef6e62009-07-31 19:58:58701 ],
[email protected]2f80c312009-02-25 21:26:55702 },
703 'VCLibrarianTool': {
704 'AdditionalOptions': '/ignore:4221',
[email protected]2f80c312009-02-25 21:26:55705 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51706 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55707 },
708 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:55709 'AdditionalDependencies': [
710 'wininet.lib',
711 'version.lib',
712 'msimg32.lib',
713 'ws2_32.lib',
714 'usp10.lib',
715 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:08716 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:55717 ],
718 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51719 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55720 'GenerateDebugInformation': 'true',
721 'MapFileName': '$(OutDir)\\$(TargetName).map',
722 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
723 'TargetMachine': '1',
724 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:48725 # SubSystem values:
726 # 0 == not set
727 # 1 == /SUBSYSTEM:CONSOLE
728 # 2 == /SUBSYSTEM:WINDOWS
729 # Most of the executables we'll ever create are tests
730 # and utilities with console output.
731 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:55732 },
733 'VCMIDLTool': {
734 'GenerateStublessProxies': 'true',
735 'TypeLibraryName': '$(InputName).tlb',
736 'OutputDirectory': '$(IntDir)',
737 'HeaderFileName': '$(InputName).h',
738 'DLLDataFileName': 'dlldata.c',
739 'InterfaceIdentifierFileName': '$(InputName)_i.c',
740 'ProxyFileName': '$(InputName)_p.c',
741 },
742 'VCResourceCompilerTool': {
743 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:14744 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:55745 },
746 },
747 },
748 }],
749 ['chromium_code==0', {
750 # This section must follow the other conditon sections above because
751 # external_code.gypi expects to be merged into those settings.
752 'includes': [
753 'external_code.gypi',
754 ],
[email protected]dce5df52009-06-29 17:58:25755 }, {
756 'target_defaults': {
757 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
758 # C99 macros on Mac and Linux.
759 'defines': [
760 '__STDC_FORMAT_MACROS',
761 ],
762 },
[email protected]2f80c312009-02-25 21:26:55763 }],
[email protected]48c7af72009-07-03 22:00:19764 ['msvs_use_common_linker_extras', {
765 'target_defaults': {
766 'msvs_settings': {
767 'VCLinkerTool': {
768 'AdditionalOptions':
769 '/safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat',
770 'DelayLoadDLLs': [
771 'dbghelp.dll',
772 'dwmapi.dll',
773 'uxtheme.dll',
774 ],
775 },
776 },
777 },
778 }],
[email protected]2f80c312009-02-25 21:26:55779 ],
[email protected]c13fcbd2009-03-27 04:27:01780 'scons_settings': {
781 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:07782 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:01783 },
[email protected]2f80c312009-02-25 21:26:55784 'xcode_settings': {
785 # The Xcode generator will look for an xcode_settings section at the root
786 # of each dict and use it to apply settings on a file-wide basis. Most
787 # settings should not be here, they should be in target-specific
788 # xcode_settings sections, or better yet, should use non-Xcode-specific
789 # settings in target dicts. SYMROOT is a special case, because many other
790 # Xcode variables depend on it, including variables such as
791 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
792 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
793 # files to appear (when present) in the UI as actual files and not red
794 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
795 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:16796 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:55797 },
[email protected]ee28c9f2009-09-04 01:53:01798}