blob: 7b8ad12f20cd1233186115bc0af796298cde837a [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]279cd4212009-09-11 22:32:1172
[email protected]06e6f872009-09-01 19:09:4173 # The Google Update appid.
74 'google_update_appid%': '{8A69D345-D564-463c-AFF1-A69D9E530F96}',
[email protected]279cd4212009-09-11 22:32:1175
76 # Whether to add the experimental build define.
77 'experimental_build_define%': 0,
[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]ad6d2c42009-09-15 20:13:38115 # Set this to true to enable SELinux support.
116 'selinux%': 0,
117
[email protected]912c55c2009-07-31 23:33:55118 'conditions': [
[email protected]cbd5fd52009-08-26 00:14:27119 ['OS=="linux"', {
120 'conditions': [
121 ['branding=="Chrome" or linux_chromium_breakpad==1', {
122 'linux_breakpad%': 1,
123 }, {
124 'linux_breakpad%': 0,
125 }],
126 ],
127 }], # OS=="linux"
[email protected]e14a9f92009-08-05 19:26:07128 ['OS=="mac"', {
129 'conditions': [
130 # mac_product_name is set to the name of the .app bundle as it should
131 # appear on disk. This duplicates data from
132 # chrome/app/theme/chromium/BRANDING and
133 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
134 # these names into the build system.
135 ['branding=="Chrome"', {
136 'mac_product_name%': 'Google Chrome',
137 }, { # else: branding!="Chrome"
138 'mac_product_name%': 'Chromium',
139 }],
140
141 # Feature variables for enabling Mac Breakpad and Keystone auto-update
142 # support. Both features are on by default in official builds with
143 # Chrome branding.
144 ['branding=="Chrome" and buildtype=="Official"', {
145 'mac_breakpad%': 1,
146 'mac_keystone%': 1,
147 }, { # else: branding!="Chrome" or buildtype!="Official"
148 'mac_breakpad%': 0,
149 'mac_keystone%': 0,
150 }],
151 ],
152 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55153 # Whether to use multiple cores to compile with visual studio. This is
154 # optional because it sometimes causes corruption on VS 2005.
155 # It is on by default on VS 2008 and off on VS 2005.
156 ['OS=="win"', {
157 'conditions': [
158 ['MSVS_VERSION=="2005"', {
[email protected]669795372009-08-14 17:51:13159 'msvs_multi_core_compile%': 0,
[email protected]912c55c2009-07-31 23:33:55160 },{
161 'msvs_multi_core_compile%': 1,
162 }],
[email protected]10bb8c92009-08-07 21:16:03163 # Don't do incremental linking for large modules on 32-bit.
164 ['MSVS_OS_BITS==32', {
165 'msvs_large_module_debug_link_mode%': '1', # No
166 },{
167 'msvs_large_module_debug_link_mode%': '2', # Yes
168 }],
[email protected]912c55c2009-07-31 23:33:55169 ],
170 }],
171 ],
[email protected]2f80c312009-02-25 21:26:55172 },
173 'target_defaults': {
[email protected]1c966092009-08-20 21:19:26174 'variables': {
[email protected]d5d593a2009-08-28 23:23:29175 'mac_release_optimization%': '3', # Use -O3 unless overridden
[email protected]ffd984b12009-09-11 19:37:00176 'mac_debug_optimization%': '0', # Use -O0 unless overridden
177 'release_extra_cflags%': '',
178 'debug_extra_cflags%': '',
[email protected]1c966092009-08-20 21:19:26179 },
[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]279cd4212009-09-11 22:32:11186 ['experimental_build_define', {
187 'defines': ['CHROME_EXP_BUILD'],
188 }],
[email protected]6cb1cec2009-05-15 03:05:20189 ['toolkit_views==1', {
[email protected]e6970232009-05-12 23:51:17190 'defines': ['TOOLKIT_VIEWS=1'],
191 }],
[email protected]16779842009-07-08 23:45:29192 ['chromeos==1', {
193 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50194 }],
[email protected]ad6d2c42009-09-15 20:13:38195 ['selinux==1', {
196 'defines': ['CHROMIUM_SELINUX=1'],
197 }],
[email protected]f5ecbba12009-04-03 04:35:18198 ['coverage!=0', {
199 'conditions': [
200 ['OS=="mac"', {
201 'xcode_settings': {
[email protected]ab2956372009-08-13 18:11:04202 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
203 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
[email protected]5ae4f55e2009-04-13 23:19:47204 },
[email protected]f5ecbba12009-04-03 04:35:18205 # Add -lgcov for executables, not for static_libraries.
206 # This is a delayed conditional.
207 'target_conditions': [
208 ['_type=="executable"', {
209 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47210 }],
211 ],
212 }],
[email protected]7122ffd52009-04-30 23:19:00213 # Linux gyp (into scons) doesn't like target_conditions?
214 # TODO(???): track down why 'target_conditions' doesn't work
215 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18216 ['OS=="linux"', {
217 'cflags': [ '-ftest-coverage',
218 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00219 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18220 }],
[email protected]e8f6ff42009-07-07 18:20:53221 # Finally, for Windows, we simply turn on profiling.
222 ['OS=="win"', {
223 'msvs_settings': {
224 'VCLinkerTool': {
225 'Profile': 'true',
226 },
[email protected]10bb8c92009-08-07 21:16:03227 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53228 # /Z7, not /Zi, so coverage is happyb
229 'DebugInformationFormat': '1',
230 'AdditionalOptions': '/Yd',
231 }
232 }
233 }], # OS==win
234 ], # conditions for coverage
235 }], # coverage!=0
236 ], # conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55237 'default_configuration': 'Debug',
238 'configurations': {
[email protected]825ff8d2009-05-22 01:40:48239 # VCLinkerTool LinkIncremental values below:
240 # 0 == default
241 # 1 == /INCREMENTAL:NO
242 # 2 == /INCREMENTAL
243 # Debug links incremental, Release does not.
[email protected]2f80c312009-02-25 21:26:55244 'Debug': {
[email protected]1c966092009-08-20 21:19:26245 'xcode_settings': {
246 'COPY_PHASE_STRIP': 'NO',
[email protected]d5d593a2009-08-28 23:23:29247 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
[email protected]ffd984b12009-09-11 19:37:00248 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26249 },
[email protected]2f80c312009-02-25 21:26:55250 'conditions': [
[email protected]2f80c312009-02-25 21:26:55251 [ 'OS=="win"', {
252 'configuration_platform': 'Win32',
253 'msvs_configuration_attributes': {
254 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
255 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
256 'CharacterSet': '1',
257 },
258 'msvs_settings': {
259 'VCCLCompilerTool': {
260 'Optimization': '0',
261 'PreprocessorDefinitions': ['_DEBUG'],
262 'BasicRuntimeChecks': '3',
263 'RuntimeLibrary': '1',
264 },
265 'VCLinkerTool': {
[email protected]1ffb6502009-06-02 07:46:24266 'LinkIncremental': '<(msvs_debug_link_incremental)',
[email protected]2f80c312009-02-25 21:26:55267 },
268 'VCResourceCompilerTool': {
269 'PreprocessorDefinitions': ['_DEBUG'],
270 },
271 },
272 }],
[email protected]ffd984b12009-09-11 19:37:00273 ['OS=="linux"', {
274 'cflags': [
275 '<@(debug_extra_cflags)',
276 ],
277 }],
[email protected]2f80c312009-02-25 21:26:55278 ],
279 },
280 'Release': {
281 'defines': [
282 'NDEBUG',
283 ],
[email protected]1c966092009-08-20 21:19:26284 'xcode_settings': {
285 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
286 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
[email protected]ffd984b12009-09-11 19:37:00287 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26288 },
[email protected]2f80c312009-02-25 21:26:55289 'conditions': [
[email protected]e5b2eaa2009-04-14 01:39:12290 [ 'OS=="win" and msvs_use_common_release', {
[email protected]2f80c312009-02-25 21:26:55291 'msvs_props': ['release.vsprops'],
292 }],
[email protected]825ff8d2009-05-22 01:40:48293 [ 'OS=="win"', {
[email protected]af7bdc42009-08-26 06:41:49294 'configuration_platform': 'Win32',
[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]825ff8d2009-05-22 01:40:48300 'msvs_settings': {
301 'VCLinkerTool': {
302 'LinkIncremental': '1',
303 },
304 },
305 }],
[email protected]ffd984b12009-09-11 19:37:00306 ['OS=="linux"', {
307 'cflags': [
308 '<@(release_extra_cflags)',
309 ],
310 }],
[email protected]2f80c312009-02-25 21:26:55311 ],
312 },
[email protected]f926fa0a2009-08-04 22:50:13313 'conditions': [
314 [ 'OS=="win"', {
315 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
316 'Purify': {
[email protected]af7bdc42009-08-26 06:41:49317 'configuration_platform': 'Win32',
[email protected]f926fa0a2009-08-04 22:50:13318 'defines': [
319 'NDEBUG',
320 'PURIFY',
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 'msvs_settings': {
329 'VCCLCompilerTool': {
330 'Optimization': '0',
331 'RuntimeLibrary': '0',
332 'BufferSecurityCheck': 'false',
333 },
334 'VCLinkerTool': {
335 'EnableCOMDATFolding': '1',
336 'LinkIncremental': '1',
337 },
338 },
339 'conditions': [
340 [ 'msvs_use_common_release', {
[email protected]f926fa0a2009-08-04 22:50:13341 'msvs_props': ['release.vsprops'],
342 }],
343 ],
344 },
345 'Release - no tcmalloc': {
[email protected]af7bdc42009-08-26 06:41:49346 'configuration_platform': 'Win32',
[email protected]f926fa0a2009-08-04 22:50:13347 'defines': [
348 'NDEBUG',
349 'NO_TCMALLOC',
350 ],
[email protected]1232bb42009-08-19 06:07:01351 'msvs_configuration_attributes': {
352 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
353 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
354 'CharacterSet': '1',
355 },
[email protected]f926fa0a2009-08-04 22:50:13356 'conditions': [
357 [ 'msvs_use_common_release', {
[email protected]f926fa0a2009-08-04 22:50:13358 'msvs_props': ['release.vsprops'],
359 }],
360 ],
361 'msvs_settings': {
362 'VCLinkerTool': {
363 'LinkIncremental': '1',
364 },
365 },
366 },
367 }],
368 ],
[email protected]2f80c312009-02-25 21:26:55369 },
370 },
371 'conditions': [
[email protected]606116d22009-05-06 22:38:23372 ['OS=="linux"', {
[email protected]9d384032009-03-20 23:13:26373 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27374 # Enable -Werror by default, but put it in a variable so it can
375 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
376 'variables': {
377 'werror%': '-Werror',
[email protected]cc4219a2009-08-14 05:30:52378 'no_strict_aliasing%': 0,
[email protected]5315f2842009-04-28 00:43:27379 },
[email protected]9d384032009-03-20 23:13:26380 'cflags': [
[email protected]1bba09c2009-08-13 12:53:16381 '<(werror)', # See note above about the werror variable.
382 '-pthread',
383 '-fno-exceptions',
384 '-Wall',
385 '-D_FILE_OFFSET_BITS=64',
[email protected]8a2fcba2009-07-29 00:52:24386 ],
387 'cflags_cc': [
[email protected]1bba09c2009-08-13 12:53:16388 '-fno-rtti',
[email protected]8a2fcba2009-07-29 00:52:24389 '-fno-threadsafe-statics',
[email protected]9d384032009-03-20 23:13:26390 ],
[email protected]a6cf87e2009-04-03 04:07:38391 'ldflags': [
[email protected]9d384032009-03-20 23:13:26392 '-pthread',
393 ],
[email protected]b5e46b92009-03-26 18:58:10394 'scons_variable_settings': {
395 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26396 # Linking of large files uses lots of RAM, so serialize links
397 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01398 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31399 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
400 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26401
402 # We have several cases where archives depend on each other in
403 # a cyclic fashion. Since the GNU linker does only a single
404 # pass over the archives we surround the libraries with
405 # --start-group and --end-group (aka -( and -) ). That causes
406 # ld to loop over the group until no more undefined symbols
407 # are found. In an ideal world we would only make groups from
408 # those libraries which we knew to be in cycles. However,
409 # that's tough with SCons, so we bodge it by making all the
410 # archives a group by redefining the linking command here.
411 #
412 # TODO: investigate whether we still have cycles that
413 # require --{start,end}-group. There has been a lot of
414 # refactoring since this was first coded, which might have
415 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41416 #
417 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
418 # so that we prefer our own built libraries (e.g. -lpng) to
419 # system versions of libraries that pkg-config might turn up.
420 # TODO(sgk): investigate handling this not by re-ordering the
421 # flags this way, but by adding a hook to use the SCons
422 # ParseFlags() option on the output from pkg-config.
423 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
424 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
425 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26426 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29427 # -rpath is only used when building with shared libraries.
428 'conditions': [
429 [ 'library=="shared_library"', {
430 'RPATH': '$LIB_DIR',
431 }],
432 ],
[email protected]9d384032009-03-20 23:13:26433 },
[email protected]b5e46b92009-03-26 18:58:10434 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49435 'AS',
[email protected]b5e46b92009-03-26 18:58:10436 'CC',
437 'CXX',
438 'LINK',
439 ],
440 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49441 'AS',
[email protected]b5e46b92009-03-26 18:58:10442 'CC',
443 'CCACHE_DIR',
444 'CXX',
445 'DISTCC_DIR',
446 'DISTCC_HOSTS',
447 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47448 'INCLUDE_SERVER_ARGS',
449 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10450 'LINK',
[email protected]fff920a2009-05-08 22:35:32451 'CHROME_BUILD_TYPE',
452 'CHROMIUM_BUILD',
453 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10454 ],
[email protected]3aacaf952009-04-02 15:34:09455 'configurations': {
456 'Debug': {
[email protected]c5bdc032009-04-20 19:11:31457 'variables': {
458 'debug_optimize%': '0',
459 },
[email protected]3aacaf952009-04-02 15:34:09460 'defines': [
461 '_DEBUG',
462 ],
463 'cflags': [
[email protected]c5bdc032009-04-20 19:11:31464 '-O<(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09465 '-g',
[email protected]9a5d2a52009-05-22 03:37:45466 # One can use '-gstabs' to enable building the debugging
467 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09468 ],
[email protected]96fd0032009-04-24 00:13:08469 'ldflags': [
470 '-rdynamic', # Allows backtrace to resolve symbols.
471 ],
[email protected]5315f2842009-04-28 00:43:27472 },
[email protected]3aacaf952009-04-02 15:34:09473 'Release': {
[email protected]740e2de2009-07-21 11:41:01474 'variables': {
475 'release_optimize%': '2',
476 },
[email protected]3aacaf952009-04-02 15:34:09477 'cflags': [
[email protected]740e2de2009-07-21 11:41:01478 '-O<(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53479 # Don't emit the GCC version ident directives, they just end up
480 # in the .comment section taking up binary size.
481 '-fno-ident',
482 # Put data and code in their own sections, so that unused symbols
483 # can be removed at link time with --gc-sections.
484 '-fdata-sections',
485 '-ffunction-sections',
[email protected]3aacaf952009-04-02 15:34:09486 ],
487 },
488 },
[email protected]601b540222009-04-03 21:32:04489 'variants': {
490 'coverage': {
491 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
492 'ldflags': ['-fprofile-arcs'],
493 },
494 'profile': {
495 'cflags': ['-pg', '-g'],
496 'ldflags': ['-pg'],
497 },
498 'symbols': {
499 'cflags': ['-g'],
500 },
501 },
[email protected]606116d22009-05-06 22:38:23502 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00503 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23504 'asflags': [
505 # Needed so that libs with .s files (e.g. libicudata.a)
506 # are compatible with the general 32-bit-ness.
507 '-32',
508 ],
509 # All floating-point computations on x87 happens in 80-bit
510 # precision. Because the C and C++ language standards allow
511 # the compiler to keep the floating-point values in higher
512 # precision than what's specified in the source and doing so
513 # is more efficient than constantly rounding up to 64-bit or
514 # 32-bit precision as specified in the source, the compiler,
515 # especially in the optimized mode, tries very hard to keep
516 # values in x87 floating-point stack (in 80-bit precision)
517 # as long as possible. This has important side effects, that
518 # the real value used in computation may change depending on
519 # how the compiler did the optimization - that is, the value
520 # kept in 80-bit is different than the value rounded down to
521 # 64-bit or 32-bit. There are possible compiler options to make
522 # this behavior consistent (e.g. -ffloat-store would keep all
523 # floating-values in the memory, thus force them to be rounded
524 # to its original precision) but they have significant runtime
525 # performance penalty.
526 #
527 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
528 # which keep floating-point values in SSE registers in its
529 # native precision (32-bit for single precision, and 64-bit for
530 # double precision values). This means the floating-point value
531 # used during computation does not change depending on how the
532 # compiler optimized the code, since the value is always kept
533 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06534 'conditions': [
535 ['branding=="Chromium"', {
536 'cflags': [
537 '-march=pentium4',
538 '-msse2',
539 '-mfpmath=sse',
540 ],
541 }],
542 ],
[email protected]606116d22009-05-06 22:38:23543 'cflags': [
544 '-m32',
[email protected]1c6560af2009-07-14 11:02:16545 ],
[email protected]606116d22009-05-06 22:38:23546 'ldflags': [
547 '-m32',
548 ],
549 }],
[email protected]3dda8a962009-08-10 18:58:07550 ['target_arch=="arm"', {
551 'conditions': [
552 ['chromeos==1', {
553 'cflags': [
554 '-march=armv7-a',
555 '-mtune=cortex-a8',
556 '-mfpu=vfp',
557 '-mfloat-abi=softfp',
558 ],
559 }],
560 ],
561 }],
[email protected]ee28c9f2009-09-04 01:53:01562 ['sysroot!=""', {
563 'cflags': [
564 '--sysroot=<(sysroot)',
565 ],
566 'ldflags': [
567 '--sysroot=<(sysroot)',
568 ],
569 }],
[email protected]cc4219a2009-08-14 05:30:52570 ['no_strict_aliasing==1', {
571 'cflags': [
572 '-fno-strict-aliasing',
573 ],
574 }],
[email protected]cbd5fd52009-08-26 00:14:27575 ['linux_breakpad==1', {
576 'cflags': [ '-gstabs' ],
577 'defines': ['USE_LINUX_BREAKPAD'],
578 }],
[email protected]606116d22009-05-06 22:38:23579 ],
[email protected]9d384032009-03-20 23:13:26580 },
581 }],
[email protected]2f80c312009-02-25 21:26:55582 ['OS=="mac"', {
583 'target_defaults': {
[email protected]24700642009-06-01 16:01:20584 'variables': {
585 # This should be 'mac_real_dsym%', but there seems to be a bug
586 # with % in variables that are intended to be set to different
587 # values in different targets, like this one.
588 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
589 },
[email protected]d92c7c012009-03-19 19:26:42590 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:55591 'xcode_settings': {
592 'ALWAYS_SEARCH_USER_PATHS': 'NO',
[email protected]ab2956372009-08-13 18:11:04593 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
594 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
595 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
596 # (Equivalent to -fPIC)
597 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
598 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
599 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
600 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
601 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
602 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
603 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
604 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
[email protected]2f80c312009-02-25 21:26:55605 'GCC_VERSION': '4.2',
[email protected]ab2956372009-08-13 18:11:04606 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
607 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
608 'PREBINDING': 'NO', # No -Wl,-prebind
609 'SDKROOT': 'macosx10.5', # -isysroot
[email protected]2f80c312009-02-25 21:26:55610 'USE_HEADERMAP': 'NO',
611 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:24612 'conditions': [
613 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
614 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}],
615 ],
[email protected]2f80c312009-02-25 21:26:55616 },
617 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:55618 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:46619 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
620 }],
621 ['_mac_bundle', {
622 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:08623 }],
[email protected]e14a9f92009-08-05 19:26:07624 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:20625 'target_conditions': [
626 ['mac_real_dsym == 1', {
627 # To get a real .dSYM bundle produced by dsymutil, set the
628 # debug information format to dwarf-with-dsym. Since
629 # strip_from_xcode will not be used, set Xcode to do the
630 # stripping as well.
631 'configurations': {
632 'Release': {
633 'xcode_settings': {
634 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
635 'DEPLOYMENT_POSTPROCESSING': 'YES',
636 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:07637 'target_conditions': [
638 ['_type=="shared_library"', {
639 # The Xcode default is to strip debugging symbols
640 # only (-S). Local symbols should be stripped as
641 # well, which will be handled by -x. Xcode will
642 # continue to insert -S when stripping even when
643 # additional flags are added with STRIPFLAGS.
644 'STRIPFLAGS': '-x',
645 }], # _type=="shared_library"
646 ], # target_conditions
647 }, # xcode_settings
648 }, # configuration "Release"
649 }, # configurations
[email protected]24700642009-06-01 16:01:20650 }, { # mac_real_dsym != 1
651 # To get a fast fake .dSYM bundle, use a post-build step to
652 # produce the .dSYM and strip the executable. strip_from_xcode
653 # only operates in the Release configuration.
654 'postbuilds': [
655 {
656 'variables': {
657 # Define strip_from_xcode in a variable ending in _path
658 # so that gyp understands it's a path and performs proper
659 # relativization during dict merging.
660 'strip_from_xcode_path': 'mac/strip_from_xcode',
661 },
662 'postbuild_name': 'Strip If Needed',
663 'action': ['<(strip_from_xcode_path)'],
664 },
[email protected]e14a9f92009-08-05 19:26:07665 ], # postbuilds
666 }], # mac_real_dsym
667 ], # target_conditions
668 }], # _type=="executable" or _type=="shared_library"
669 ], # target_conditions
670 }, # target_defaults
671 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:55672 ['OS=="win"', {
673 'target_defaults': {
674 'defines': [
675 '_WIN32_WINNT=0x0600',
676 'WINVER=0x0600',
677 'WIN32',
678 '_WINDOWS',
679 '_HAS_EXCEPTIONS=0',
680 'NOMINMAX',
681 '_CRT_RAND_S',
682 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
683 'WIN32_LEAN_AND_MEAN',
684 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:45685 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:55686 ],
[email protected]5b5ca7cb2009-07-20 23:00:20687 'msvs_system_include_dirs': [
[email protected]2f80c312009-02-25 21:26:55688 '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Include',
689 '$(VSInstallDir)/VC/atlmfc/include',
690 ],
[email protected]a8d99cef2009-08-26 20:47:49691 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:55692 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:55693 'msvs_settings': {
694 'VCCLCompilerTool': {
695 'MinimalRebuild': 'false',
696 'ExceptionHandling': '0',
697 'BufferSecurityCheck': 'true',
698 'EnableFunctionLevelLinking': 'true',
699 'RuntimeTypeInfo': 'false',
700 'WarningLevel': '3',
701 'WarnAsError': 'true',
702 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:58703 'conditions': [
[email protected]912c55c2009-07-31 23:33:55704 [ 'msvs_multi_core_compile', {
705 'AdditionalOptions': '/MP',
706 }],
[email protected]3fef6e62009-07-31 19:58:58707 ],
[email protected]2f80c312009-02-25 21:26:55708 },
709 'VCLibrarianTool': {
710 'AdditionalOptions': '/ignore:4221',
[email protected]2f80c312009-02-25 21:26:55711 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51712 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55713 },
714 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:55715 'AdditionalDependencies': [
716 'wininet.lib',
717 'version.lib',
718 'msimg32.lib',
719 'ws2_32.lib',
720 'usp10.lib',
721 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:08722 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:55723 ],
724 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51725 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55726 'GenerateDebugInformation': 'true',
727 'MapFileName': '$(OutDir)\\$(TargetName).map',
728 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
729 'TargetMachine': '1',
730 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:48731 # SubSystem values:
732 # 0 == not set
733 # 1 == /SUBSYSTEM:CONSOLE
734 # 2 == /SUBSYSTEM:WINDOWS
735 # Most of the executables we'll ever create are tests
736 # and utilities with console output.
737 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:55738 },
739 'VCMIDLTool': {
740 'GenerateStublessProxies': 'true',
741 'TypeLibraryName': '$(InputName).tlb',
742 'OutputDirectory': '$(IntDir)',
743 'HeaderFileName': '$(InputName).h',
744 'DLLDataFileName': 'dlldata.c',
745 'InterfaceIdentifierFileName': '$(InputName)_i.c',
746 'ProxyFileName': '$(InputName)_p.c',
747 },
748 'VCResourceCompilerTool': {
749 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:14750 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:55751 },
752 },
753 },
754 }],
755 ['chromium_code==0', {
756 # This section must follow the other conditon sections above because
757 # external_code.gypi expects to be merged into those settings.
758 'includes': [
759 'external_code.gypi',
760 ],
[email protected]dce5df52009-06-29 17:58:25761 }, {
762 'target_defaults': {
763 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
764 # C99 macros on Mac and Linux.
765 'defines': [
766 '__STDC_FORMAT_MACROS',
767 ],
768 },
[email protected]2f80c312009-02-25 21:26:55769 }],
[email protected]48c7af72009-07-03 22:00:19770 ['msvs_use_common_linker_extras', {
771 'target_defaults': {
772 'msvs_settings': {
773 'VCLinkerTool': {
774 'AdditionalOptions':
775 '/safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat',
776 'DelayLoadDLLs': [
777 'dbghelp.dll',
778 'dwmapi.dll',
779 'uxtheme.dll',
780 ],
781 },
782 },
783 },
784 }],
[email protected]2f80c312009-02-25 21:26:55785 ],
[email protected]c13fcbd2009-03-27 04:27:01786 'scons_settings': {
787 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:07788 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:01789 },
[email protected]2f80c312009-02-25 21:26:55790 'xcode_settings': {
791 # The Xcode generator will look for an xcode_settings section at the root
792 # of each dict and use it to apply settings on a file-wide basis. Most
793 # settings should not be here, they should be in target-specific
794 # xcode_settings sections, or better yet, should use non-Xcode-specific
795 # settings in target dicts. SYMROOT is a special case, because many other
796 # Xcode variables depend on it, including variables such as
797 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
798 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
799 # files to appear (when present) in the UI as actual files and not red
800 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
801 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:16802 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:55803 },
[email protected]ee28c9f2009-09-04 01:53:01804}