blob: 757c8c5750799252c1281088a5b32aeea0d40d82 [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]9543af052009-09-15 22:42:5955 # We normally expect MacOS X 10.5 at runtime in the product generated.
56 # Set to 1 to enable MacOS X 10.4 support where possible.
57 # Harmless to set on other platforms, as it has no effect.
58 # This is designed so that products such as O3D can use some Chrome source
59 # without losing 10.4 support.
60 # Look for support_macosx_10_4 later in the file to see where it turns on
61 # compile flags, defines SUPPORT_MACOSX_10_4 in the C preprocessor,
62 # and changes the Xcode deployment target setting.
63 'support_macosx_10_4%': 0,
64
[email protected]f5ecbba12009-04-03 04:35:1865 # Set to 1 to enable code coverage. In addition to build changes
66 # (e.g. extra CFLAGS), also creates a new target in the src/chrome
67 # project file called "coverage".
68 # Currently ignored on Windows.
69 'coverage%': 0,
[email protected]653bd5f032009-04-08 12:55:4970
[email protected]c61f6432009-04-22 01:16:4271 # Overridable specification for potential use of alternative
72 # JavaScript engines.
73 'javascript_engine%': 'v8',
74
[email protected]653bd5f032009-04-08 12:55:4975 # To do a shared build on linux we need to be able to choose between type
76 # static_library and shared_library. We default to doing a static build
77 # but you can override this with "gyp -Dlibrary=shared_library" or you
78 # can add the following line (without the #) to ~/.gyp/include.gypi
79 # {'variables': {'library': 'shared_library'}}
80 # to compile as shared by default
81 'library%': 'static_library',
[email protected]279cd4212009-09-11 22:32:1182
[email protected]06e6f872009-09-01 19:09:4183 # The Google Update appid.
84 'google_update_appid%': '{8A69D345-D564-463c-AFF1-A69D9E530F96}',
[email protected]279cd4212009-09-11 22:32:1185
86 # Whether to add the experimental build define.
87 'experimental_build_define%': 0,
[email protected]e5b2eaa2009-04-14 01:39:1288
89 # TODO(bradnelson): eliminate this when possible.
90 # To allow local gyp files to prevent release.vsprops from being included.
91 # Yes(1) means include release.vsprops.
92 # Once all vsprops settings are migrated into gyp, this can go away.
93 'msvs_use_common_release%': 1,
[email protected]606116d22009-05-06 22:38:2394
[email protected]cbd5fd52009-08-26 00:14:2795 # TODO(bradnelson): eliminate this when possible.
96 # To allow local gyp files to override additional linker options for msvs.
97 # Yes(1) means set use the common linker options.
[email protected]48c7af72009-07-03 22:00:1998 'msvs_use_common_linker_extras%': 1,
99
[email protected]1ffb6502009-06-02 07:46:24100 # TODO(sgk): eliminate this if possible.
101 # It would be nicer to support this via a setting in 'target_defaults'
102 # in chrome/app/locales/locales.gypi overriding the setting in the
103 # 'Debug' configuration in the 'target_defaults' dict below,
104 # but that doesn't work as we'd like.
105 'msvs_debug_link_incremental%': '2',
106
[email protected]606116d22009-05-06 22:38:23107 # The architecture that we're building on.
108 'target_arch%': 'ia32',
[email protected]e6970232009-05-12 23:51:17109
110 # By default linux does not use views. To turn on views in Linux
111 # set the variable GYP_DEFINES to "toolkit_views=1", or modify
112 # ~/.gyp/include.gypi .
113 'toolkit_views%': 0,
[email protected]2b883b92009-06-02 22:57:50114
[email protected]16779842009-07-08 23:45:29115 'chromeos%': 0,
[email protected]397fe9d2009-06-30 00:02:27116
[email protected]ee28c9f2009-09-04 01:53:01117 # The system root for cross-compiles. Default: none.
118 'sysroot%': '',
119
[email protected]573136142009-07-15 22:48:37120 # This is the location of the sandbox binary. Chrome looks for this before
121 # running the zygote process. If found, and SUID, it will be used to
122 # sandbox the zygote process and, thus, all renderer processes.
123 'linux_sandbox_path%': '',
124
[email protected]ad6d2c42009-09-15 20:13:38125 # Set this to true to enable SELinux support.
126 'selinux%': 0,
127
[email protected]912c55c2009-07-31 23:33:55128 'conditions': [
[email protected]cbd5fd52009-08-26 00:14:27129 ['OS=="linux"', {
130 'conditions': [
131 ['branding=="Chrome" or linux_chromium_breakpad==1', {
132 'linux_breakpad%': 1,
133 }, {
134 'linux_breakpad%': 0,
135 }],
136 ],
137 }], # OS=="linux"
[email protected]e14a9f92009-08-05 19:26:07138 ['OS=="mac"', {
139 'conditions': [
140 # mac_product_name is set to the name of the .app bundle as it should
141 # appear on disk. This duplicates data from
142 # chrome/app/theme/chromium/BRANDING and
143 # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
144 # these names into the build system.
145 ['branding=="Chrome"', {
146 'mac_product_name%': 'Google Chrome',
147 }, { # else: branding!="Chrome"
148 'mac_product_name%': 'Chromium',
149 }],
150
151 # Feature variables for enabling Mac Breakpad and Keystone auto-update
152 # support. Both features are on by default in official builds with
153 # Chrome branding.
154 ['branding=="Chrome" and buildtype=="Official"', {
155 'mac_breakpad%': 1,
156 'mac_keystone%': 1,
157 }, { # else: branding!="Chrome" or buildtype!="Official"
158 'mac_breakpad%': 0,
159 'mac_keystone%': 0,
160 }],
161 ],
162 }], # OS=="mac"
[email protected]912c55c2009-07-31 23:33:55163 # Whether to use multiple cores to compile with visual studio. This is
164 # optional because it sometimes causes corruption on VS 2005.
165 # It is on by default on VS 2008 and off on VS 2005.
166 ['OS=="win"', {
167 'conditions': [
168 ['MSVS_VERSION=="2005"', {
[email protected]669795372009-08-14 17:51:13169 'msvs_multi_core_compile%': 0,
[email protected]912c55c2009-07-31 23:33:55170 },{
171 'msvs_multi_core_compile%': 1,
172 }],
[email protected]10bb8c92009-08-07 21:16:03173 # Don't do incremental linking for large modules on 32-bit.
174 ['MSVS_OS_BITS==32', {
175 'msvs_large_module_debug_link_mode%': '1', # No
176 },{
177 'msvs_large_module_debug_link_mode%': '2', # Yes
178 }],
[email protected]912c55c2009-07-31 23:33:55179 ],
180 }],
181 ],
[email protected]2f80c312009-02-25 21:26:55182 },
183 'target_defaults': {
[email protected]1c966092009-08-20 21:19:26184 'variables': {
[email protected]d5d593a2009-08-28 23:23:29185 'mac_release_optimization%': '3', # Use -O3 unless overridden
[email protected]ffd984b12009-09-11 19:37:00186 'mac_debug_optimization%': '0', # Use -O0 unless overridden
187 'release_extra_cflags%': '',
188 'debug_extra_cflags%': '',
[email protected]1c966092009-08-20 21:19:26189 },
[email protected]32aa8cc2009-03-04 21:36:39190 'conditions': [
191 ['branding=="Chrome"', {
192 'defines': ['GOOGLE_CHROME_BUILD'],
193 }, { # else: branding!="Chrome"
194 'defines': ['CHROMIUM_BUILD'],
195 }],
[email protected]279cd4212009-09-11 22:32:11196 ['experimental_build_define', {
197 'defines': ['CHROME_EXP_BUILD'],
198 }],
[email protected]6cb1cec2009-05-15 03:05:20199 ['toolkit_views==1', {
[email protected]e6970232009-05-12 23:51:17200 'defines': ['TOOLKIT_VIEWS=1'],
201 }],
[email protected]16779842009-07-08 23:45:29202 ['chromeos==1', {
203 'defines': ['OS_CHROMEOS=1'],
[email protected]2b883b92009-06-02 22:57:50204 }],
[email protected]ad6d2c42009-09-15 20:13:38205 ['selinux==1', {
206 'defines': ['CHROMIUM_SELINUX=1'],
207 }],
[email protected]f5ecbba12009-04-03 04:35:18208 ['coverage!=0', {
209 'conditions': [
210 ['OS=="mac"', {
211 'xcode_settings': {
[email protected]ab2956372009-08-13 18:11:04212 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
213 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
[email protected]5ae4f55e2009-04-13 23:19:47214 },
[email protected]f5ecbba12009-04-03 04:35:18215 # Add -lgcov for executables, not for static_libraries.
216 # This is a delayed conditional.
217 'target_conditions': [
218 ['_type=="executable"', {
219 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
[email protected]5ae4f55e2009-04-13 23:19:47220 }],
221 ],
222 }],
[email protected]7122ffd52009-04-30 23:19:00223 # Linux gyp (into scons) doesn't like target_conditions?
224 # TODO(???): track down why 'target_conditions' doesn't work
225 # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
[email protected]f5ecbba12009-04-03 04:35:18226 ['OS=="linux"', {
227 'cflags': [ '-ftest-coverage',
228 '-fprofile-arcs' ],
[email protected]7122ffd52009-04-30 23:19:00229 'link_settings': { 'libraries': [ '-lgcov' ] },
[email protected]f5ecbba12009-04-03 04:35:18230 }],
[email protected]e8f6ff42009-07-07 18:20:53231 # Finally, for Windows, we simply turn on profiling.
232 ['OS=="win"', {
233 'msvs_settings': {
234 'VCLinkerTool': {
235 'Profile': 'true',
236 },
[email protected]10bb8c92009-08-07 21:16:03237 'VCCLCompilerTool': {
[email protected]e8f6ff42009-07-07 18:20:53238 # /Z7, not /Zi, so coverage is happyb
239 'DebugInformationFormat': '1',
240 'AdditionalOptions': '/Yd',
241 }
242 }
243 }], # OS==win
244 ], # conditions for coverage
245 }], # coverage!=0
246 ], # conditions for 'target_defaults'
[email protected]2f80c312009-02-25 21:26:55247 'default_configuration': 'Debug',
248 'configurations': {
[email protected]825ff8d2009-05-22 01:40:48249 # VCLinkerTool LinkIncremental values below:
250 # 0 == default
251 # 1 == /INCREMENTAL:NO
252 # 2 == /INCREMENTAL
253 # Debug links incremental, Release does not.
[email protected]2f80c312009-02-25 21:26:55254 'Debug': {
[email protected]1c966092009-08-20 21:19:26255 'xcode_settings': {
256 'COPY_PHASE_STRIP': 'NO',
[email protected]d5d593a2009-08-28 23:23:29257 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
[email protected]ffd984b12009-09-11 19:37:00258 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26259 },
[email protected]2f80c312009-02-25 21:26:55260 'conditions': [
[email protected]2f80c312009-02-25 21:26:55261 [ 'OS=="win"', {
262 'configuration_platform': 'Win32',
263 'msvs_configuration_attributes': {
264 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
265 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
266 'CharacterSet': '1',
267 },
268 'msvs_settings': {
269 'VCCLCompilerTool': {
270 'Optimization': '0',
271 'PreprocessorDefinitions': ['_DEBUG'],
272 'BasicRuntimeChecks': '3',
273 'RuntimeLibrary': '1',
274 },
275 'VCLinkerTool': {
[email protected]1ffb6502009-06-02 07:46:24276 'LinkIncremental': '<(msvs_debug_link_incremental)',
[email protected]2f80c312009-02-25 21:26:55277 },
278 'VCResourceCompilerTool': {
279 'PreprocessorDefinitions': ['_DEBUG'],
280 },
281 },
282 }],
[email protected]ffd984b12009-09-11 19:37:00283 ['OS=="linux"', {
284 'cflags': [
285 '<@(debug_extra_cflags)',
286 ],
287 }],
[email protected]2f80c312009-02-25 21:26:55288 ],
289 },
290 'Release': {
291 'defines': [
292 'NDEBUG',
293 ],
[email protected]1c966092009-08-20 21:19:26294 'xcode_settings': {
295 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
296 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
[email protected]ffd984b12009-09-11 19:37:00297 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
[email protected]1c966092009-08-20 21:19:26298 },
[email protected]2f80c312009-02-25 21:26:55299 'conditions': [
[email protected]e5b2eaa2009-04-14 01:39:12300 [ 'OS=="win" and msvs_use_common_release', {
[email protected]2f80c312009-02-25 21:26:55301 'msvs_props': ['release.vsprops'],
302 }],
[email protected]825ff8d2009-05-22 01:40:48303 [ 'OS=="win"', {
[email protected]af7bdc42009-08-26 06:41:49304 'configuration_platform': 'Win32',
[email protected]1232bb42009-08-19 06:07:01305 'msvs_configuration_attributes': {
306 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
307 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
308 'CharacterSet': '1',
309 },
[email protected]825ff8d2009-05-22 01:40:48310 'msvs_settings': {
311 'VCLinkerTool': {
312 'LinkIncremental': '1',
313 },
314 },
315 }],
[email protected]ffd984b12009-09-11 19:37:00316 ['OS=="linux"', {
317 'cflags': [
318 '<@(release_extra_cflags)',
319 ],
320 }],
[email protected]2f80c312009-02-25 21:26:55321 ],
322 },
[email protected]f926fa0a2009-08-04 22:50:13323 'conditions': [
324 [ 'OS=="win"', {
325 # TODO(bradnelson): add a gyp mechanism to make this more graceful.
326 'Purify': {
[email protected]af7bdc42009-08-26 06:41:49327 'configuration_platform': 'Win32',
[email protected]f926fa0a2009-08-04 22:50:13328 'defines': [
329 'NDEBUG',
330 'PURIFY',
331 'NO_TCMALLOC',
332 ],
[email protected]1232bb42009-08-19 06:07:01333 'msvs_configuration_attributes': {
334 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
335 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
336 'CharacterSet': '1',
337 },
[email protected]f926fa0a2009-08-04 22:50:13338 'msvs_settings': {
339 'VCCLCompilerTool': {
340 'Optimization': '0',
341 'RuntimeLibrary': '0',
342 'BufferSecurityCheck': 'false',
343 },
344 'VCLinkerTool': {
345 'EnableCOMDATFolding': '1',
346 'LinkIncremental': '1',
347 },
348 },
349 'conditions': [
350 [ 'msvs_use_common_release', {
[email protected]f926fa0a2009-08-04 22:50:13351 'msvs_props': ['release.vsprops'],
352 }],
353 ],
354 },
355 'Release - no tcmalloc': {
[email protected]af7bdc42009-08-26 06:41:49356 'configuration_platform': 'Win32',
[email protected]f926fa0a2009-08-04 22:50:13357 'defines': [
358 'NDEBUG',
359 'NO_TCMALLOC',
360 ],
[email protected]1232bb42009-08-19 06:07:01361 'msvs_configuration_attributes': {
362 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
363 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
364 'CharacterSet': '1',
365 },
[email protected]f926fa0a2009-08-04 22:50:13366 'conditions': [
367 [ 'msvs_use_common_release', {
[email protected]f926fa0a2009-08-04 22:50:13368 'msvs_props': ['release.vsprops'],
369 }],
370 ],
371 'msvs_settings': {
372 'VCLinkerTool': {
373 'LinkIncremental': '1',
374 },
375 },
376 },
377 }],
378 ],
[email protected]2f80c312009-02-25 21:26:55379 },
380 },
381 'conditions': [
[email protected]606116d22009-05-06 22:38:23382 ['OS=="linux"', {
[email protected]9d384032009-03-20 23:13:26383 'target_defaults': {
[email protected]5315f2842009-04-28 00:43:27384 # Enable -Werror by default, but put it in a variable so it can
385 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
386 'variables': {
387 'werror%': '-Werror',
[email protected]cc4219a2009-08-14 05:30:52388 'no_strict_aliasing%': 0,
[email protected]5315f2842009-04-28 00:43:27389 },
[email protected]9d384032009-03-20 23:13:26390 'cflags': [
[email protected]1bba09c2009-08-13 12:53:16391 '<(werror)', # See note above about the werror variable.
392 '-pthread',
393 '-fno-exceptions',
394 '-Wall',
395 '-D_FILE_OFFSET_BITS=64',
[email protected]8a2fcba2009-07-29 00:52:24396 ],
397 'cflags_cc': [
[email protected]1bba09c2009-08-13 12:53:16398 '-fno-rtti',
[email protected]8a2fcba2009-07-29 00:52:24399 '-fno-threadsafe-statics',
[email protected]9d384032009-03-20 23:13:26400 ],
[email protected]a6cf87e2009-04-03 04:07:38401 'ldflags': [
[email protected]9d384032009-03-20 23:13:26402 '-pthread',
403 ],
[email protected]b5e46b92009-03-26 18:58:10404 'scons_variable_settings': {
405 'LIBPATH': ['$LIB_DIR'],
[email protected]9d384032009-03-20 23:13:26406 # Linking of large files uses lots of RAM, so serialize links
407 # using the handy flock command from util-linux.
[email protected]c13fcbd2009-03-27 04:27:01408 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
[email protected]789fbb7c2009-04-02 16:20:31409 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
410 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
[email protected]9d384032009-03-20 23:13:26411
412 # We have several cases where archives depend on each other in
413 # a cyclic fashion. Since the GNU linker does only a single
414 # pass over the archives we surround the libraries with
415 # --start-group and --end-group (aka -( and -) ). That causes
416 # ld to loop over the group until no more undefined symbols
417 # are found. In an ideal world we would only make groups from
418 # those libraries which we knew to be in cycles. However,
419 # that's tough with SCons, so we bodge it by making all the
420 # archives a group by redefining the linking command here.
421 #
422 # TODO: investigate whether we still have cycles that
423 # require --{start,end}-group. There has been a lot of
424 # refactoring since this was first coded, which might have
425 # eliminated the circular dependencies.
[email protected]12862922009-04-20 21:36:41426 #
427 # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
428 # so that we prefer our own built libraries (e.g. -lpng) to
429 # system versions of libraries that pkg-config might turn up.
430 # TODO(sgk): investigate handling this not by re-ordering the
431 # flags this way, but by adding a hook to use the SCons
432 # ParseFlags() option on the output from pkg-config.
433 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
434 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
435 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES', '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
[email protected]9d384032009-03-20 23:13:26436 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
[email protected]d0644282009-04-22 00:20:29437 # -rpath is only used when building with shared libraries.
438 'conditions': [
439 [ 'library=="shared_library"', {
440 'RPATH': '$LIB_DIR',
441 }],
442 ],
[email protected]9d384032009-03-20 23:13:26443 },
[email protected]b5e46b92009-03-26 18:58:10444 'scons_import_variables': [
[email protected]52049d5c2009-05-01 20:32:49445 'AS',
[email protected]b5e46b92009-03-26 18:58:10446 'CC',
447 'CXX',
448 'LINK',
449 ],
450 'scons_propagate_variables': [
[email protected]52049d5c2009-05-01 20:32:49451 'AS',
[email protected]b5e46b92009-03-26 18:58:10452 'CC',
453 'CCACHE_DIR',
454 'CXX',
455 'DISTCC_DIR',
456 'DISTCC_HOSTS',
457 'HOME',
[email protected]5ae4f55e2009-04-13 23:19:47458 'INCLUDE_SERVER_ARGS',
459 'INCLUDE_SERVER_PORT',
[email protected]b5e46b92009-03-26 18:58:10460 'LINK',
[email protected]fff920a2009-05-08 22:35:32461 'CHROME_BUILD_TYPE',
462 'CHROMIUM_BUILD',
463 'OFFICIAL_BUILD',
[email protected]b5e46b92009-03-26 18:58:10464 ],
[email protected]3aacaf952009-04-02 15:34:09465 'configurations': {
466 'Debug': {
[email protected]c5bdc032009-04-20 19:11:31467 'variables': {
468 'debug_optimize%': '0',
469 },
[email protected]3aacaf952009-04-02 15:34:09470 'defines': [
471 '_DEBUG',
472 ],
473 'cflags': [
[email protected]c5bdc032009-04-20 19:11:31474 '-O<(debug_optimize)',
[email protected]3aacaf952009-04-02 15:34:09475 '-g',
[email protected]9a5d2a52009-05-22 03:37:45476 # One can use '-gstabs' to enable building the debugging
477 # information in STABS format for breakpad's dumpsyms.
[email protected]3aacaf952009-04-02 15:34:09478 ],
[email protected]96fd0032009-04-24 00:13:08479 'ldflags': [
480 '-rdynamic', # Allows backtrace to resolve symbols.
481 ],
[email protected]5315f2842009-04-28 00:43:27482 },
[email protected]3aacaf952009-04-02 15:34:09483 'Release': {
[email protected]740e2de2009-07-21 11:41:01484 'variables': {
485 'release_optimize%': '2',
486 },
[email protected]3aacaf952009-04-02 15:34:09487 'cflags': [
[email protected]740e2de2009-07-21 11:41:01488 '-O<(release_optimize)',
[email protected]d8cc3a62009-04-08 18:29:53489 # Don't emit the GCC version ident directives, they just end up
490 # in the .comment section taking up binary size.
491 '-fno-ident',
492 # Put data and code in their own sections, so that unused symbols
493 # can be removed at link time with --gc-sections.
494 '-fdata-sections',
495 '-ffunction-sections',
[email protected]3aacaf952009-04-02 15:34:09496 ],
497 },
498 },
[email protected]601b540222009-04-03 21:32:04499 'variants': {
500 'coverage': {
501 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
502 'ldflags': ['-fprofile-arcs'],
503 },
504 'profile': {
505 'cflags': ['-pg', '-g'],
506 'ldflags': ['-pg'],
507 },
508 'symbols': {
509 'cflags': ['-g'],
510 },
511 },
[email protected]606116d22009-05-06 22:38:23512 'conditions': [
[email protected]7e8eb7612009-07-29 15:56:00513 [ 'target_arch=="ia32"', {
[email protected]606116d22009-05-06 22:38:23514 'asflags': [
515 # Needed so that libs with .s files (e.g. libicudata.a)
516 # are compatible with the general 32-bit-ness.
517 '-32',
518 ],
519 # All floating-point computations on x87 happens in 80-bit
520 # precision. Because the C and C++ language standards allow
521 # the compiler to keep the floating-point values in higher
522 # precision than what's specified in the source and doing so
523 # is more efficient than constantly rounding up to 64-bit or
524 # 32-bit precision as specified in the source, the compiler,
525 # especially in the optimized mode, tries very hard to keep
526 # values in x87 floating-point stack (in 80-bit precision)
527 # as long as possible. This has important side effects, that
528 # the real value used in computation may change depending on
529 # how the compiler did the optimization - that is, the value
530 # kept in 80-bit is different than the value rounded down to
531 # 64-bit or 32-bit. There are possible compiler options to make
532 # this behavior consistent (e.g. -ffloat-store would keep all
533 # floating-values in the memory, thus force them to be rounded
534 # to its original precision) but they have significant runtime
535 # performance penalty.
536 #
537 # -mfpmath=sse -msse2 makes the compiler use SSE instructions
538 # which keep floating-point values in SSE registers in its
539 # native precision (32-bit for single precision, and 64-bit for
540 # double precision values). This means the floating-point value
541 # used during computation does not change depending on how the
542 # compiler optimized the code, since the value is always kept
543 # in its specified precision.
[email protected]ffde7932009-05-29 00:39:06544 'conditions': [
545 ['branding=="Chromium"', {
546 'cflags': [
547 '-march=pentium4',
548 '-msse2',
549 '-mfpmath=sse',
550 ],
551 }],
552 ],
[email protected]606116d22009-05-06 22:38:23553 'cflags': [
554 '-m32',
[email protected]1c6560af2009-07-14 11:02:16555 ],
[email protected]606116d22009-05-06 22:38:23556 'ldflags': [
557 '-m32',
558 ],
559 }],
[email protected]3dda8a962009-08-10 18:58:07560 ['target_arch=="arm"', {
561 'conditions': [
562 ['chromeos==1', {
563 'cflags': [
564 '-march=armv7-a',
565 '-mtune=cortex-a8',
566 '-mfpu=vfp',
567 '-mfloat-abi=softfp',
568 ],
569 }],
570 ],
571 }],
[email protected]ee28c9f2009-09-04 01:53:01572 ['sysroot!=""', {
573 'cflags': [
574 '--sysroot=<(sysroot)',
575 ],
576 'ldflags': [
577 '--sysroot=<(sysroot)',
578 ],
579 }],
[email protected]cc4219a2009-08-14 05:30:52580 ['no_strict_aliasing==1', {
581 'cflags': [
582 '-fno-strict-aliasing',
583 ],
584 }],
[email protected]cbd5fd52009-08-26 00:14:27585 ['linux_breakpad==1', {
586 'cflags': [ '-gstabs' ],
587 'defines': ['USE_LINUX_BREAKPAD'],
588 }],
[email protected]606116d22009-05-06 22:38:23589 ],
[email protected]9d384032009-03-20 23:13:26590 },
591 }],
[email protected]2f80c312009-02-25 21:26:55592 ['OS=="mac"', {
593 'target_defaults': {
[email protected]24700642009-06-01 16:01:20594 'variables': {
595 # This should be 'mac_real_dsym%', but there seems to be a bug
596 # with % in variables that are intended to be set to different
597 # values in different targets, like this one.
598 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
599 },
[email protected]d92c7c012009-03-19 19:26:42600 'mac_bundle': 0,
[email protected]2f80c312009-02-25 21:26:55601 'xcode_settings': {
602 'ALWAYS_SEARCH_USER_PATHS': 'NO',
[email protected]ab2956372009-08-13 18:11:04603 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
604 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
605 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
606 # (Equivalent to -fPIC)
607 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
608 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
609 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
610 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden
611 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
612 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
613 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
614 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
[email protected]2f80c312009-02-25 21:26:55615 'GCC_VERSION': '4.2',
[email protected]ab2956372009-08-13 18:11:04616 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
617 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
618 'PREBINDING': 'NO', # No -Wl,-prebind
619 'SDKROOT': 'macosx10.5', # -isysroot
[email protected]2f80c312009-02-25 21:26:55620 'USE_HEADERMAP': 'NO',
621 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
[email protected]b3fb8092009-03-12 19:09:24622 'conditions': [
623 ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
[email protected]9543af052009-09-15 22:42:59624 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
625 ],
626 ['support_macosx_10_4',
627 {
628 'OTHER_CFLAGS': ['-D', 'SUPPORT_MACOSX_10_4',],
629 'MACOSX_DEPLOYMENT_TARGET': '10.4', # mmacosx-version-min=10.4
630 },
631 {
632 'MACOSX_DEPLOYMENT_TARGET': '10.5', # mmacosx-version-min=10.5
633 }
634 ],
[email protected]b3fb8092009-03-12 19:09:24635 ],
[email protected]2f80c312009-02-25 21:26:55636 },
637 'target_conditions': [
[email protected]2f80c312009-02-25 21:26:55638 ['_type!="static_library"', {
[email protected]5d7dc972009-04-16 15:30:46639 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
640 }],
641 ['_mac_bundle', {
642 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
[email protected]87fde4a2009-02-28 00:50:08643 }],
[email protected]e14a9f92009-08-05 19:26:07644 ['_type=="executable" or _type=="shared_library"', {
[email protected]24700642009-06-01 16:01:20645 'target_conditions': [
646 ['mac_real_dsym == 1', {
647 # To get a real .dSYM bundle produced by dsymutil, set the
648 # debug information format to dwarf-with-dsym. Since
649 # strip_from_xcode will not be used, set Xcode to do the
650 # stripping as well.
651 'configurations': {
652 'Release': {
653 'xcode_settings': {
654 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
655 'DEPLOYMENT_POSTPROCESSING': 'YES',
656 'STRIP_INSTALLED_PRODUCT': 'YES',
[email protected]e14a9f92009-08-05 19:26:07657 'target_conditions': [
658 ['_type=="shared_library"', {
659 # The Xcode default is to strip debugging symbols
660 # only (-S). Local symbols should be stripped as
661 # well, which will be handled by -x. Xcode will
662 # continue to insert -S when stripping even when
663 # additional flags are added with STRIPFLAGS.
664 'STRIPFLAGS': '-x',
665 }], # _type=="shared_library"
666 ], # target_conditions
667 }, # xcode_settings
668 }, # configuration "Release"
669 }, # configurations
[email protected]24700642009-06-01 16:01:20670 }, { # mac_real_dsym != 1
671 # To get a fast fake .dSYM bundle, use a post-build step to
672 # produce the .dSYM and strip the executable. strip_from_xcode
673 # only operates in the Release configuration.
674 'postbuilds': [
675 {
676 'variables': {
677 # Define strip_from_xcode in a variable ending in _path
678 # so that gyp understands it's a path and performs proper
679 # relativization during dict merging.
680 'strip_from_xcode_path': 'mac/strip_from_xcode',
681 },
682 'postbuild_name': 'Strip If Needed',
683 'action': ['<(strip_from_xcode_path)'],
684 },
[email protected]e14a9f92009-08-05 19:26:07685 ], # postbuilds
686 }], # mac_real_dsym
687 ], # target_conditions
688 }], # _type=="executable" or _type=="shared_library"
689 ], # target_conditions
690 }, # target_defaults
691 }], # OS=="mac"
[email protected]2f80c312009-02-25 21:26:55692 ['OS=="win"', {
693 'target_defaults': {
694 'defines': [
695 '_WIN32_WINNT=0x0600',
696 'WINVER=0x0600',
697 'WIN32',
698 '_WINDOWS',
699 '_HAS_EXCEPTIONS=0',
700 'NOMINMAX',
701 '_CRT_RAND_S',
702 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
703 'WIN32_LEAN_AND_MEAN',
704 '_SECURE_ATL',
[email protected]adfb98c2009-06-23 20:08:45705 '_HAS_TR1=0',
[email protected]2f80c312009-02-25 21:26:55706 ],
[email protected]5b5ca7cb2009-07-20 23:00:20707 'msvs_system_include_dirs': [
[email protected]2f80c312009-02-25 21:26:55708 '<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Include',
709 '$(VSInstallDir)/VC/atlmfc/include',
710 ],
[email protected]a8d99cef2009-08-26 20:47:49711 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
[email protected]6840561772009-05-12 16:37:55712 'msvs_disabled_warnings': [4396, 4503, 4819],
[email protected]2f80c312009-02-25 21:26:55713 'msvs_settings': {
714 'VCCLCompilerTool': {
715 'MinimalRebuild': 'false',
716 'ExceptionHandling': '0',
717 'BufferSecurityCheck': 'true',
718 'EnableFunctionLevelLinking': 'true',
719 'RuntimeTypeInfo': 'false',
720 'WarningLevel': '3',
721 'WarnAsError': 'true',
722 'DebugInformationFormat': '3',
[email protected]3fef6e62009-07-31 19:58:58723 'conditions': [
[email protected]912c55c2009-07-31 23:33:55724 [ 'msvs_multi_core_compile', {
725 'AdditionalOptions': '/MP',
726 }],
[email protected]3fef6e62009-07-31 19:58:58727 ],
[email protected]2f80c312009-02-25 21:26:55728 },
729 'VCLibrarianTool': {
730 'AdditionalOptions': '/ignore:4221',
[email protected]2f80c312009-02-25 21:26:55731 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51732 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55733 },
734 'VCLinkerTool': {
[email protected]2f80c312009-02-25 21:26:55735 'AdditionalDependencies': [
736 'wininet.lib',
737 'version.lib',
738 'msimg32.lib',
739 'ws2_32.lib',
740 'usp10.lib',
741 'psapi.lib',
[email protected]96fd0032009-04-24 00:13:08742 'dbghelp.lib',
[email protected]2f80c312009-02-25 21:26:55743 ],
744 'AdditionalLibraryDirectories':
[email protected]07506b502009-06-29 00:30:51745 ['<(DEPTH)/third_party/platformsdk_win2008_6_1/files/Lib'],
[email protected]2f80c312009-02-25 21:26:55746 'GenerateDebugInformation': 'true',
747 'MapFileName': '$(OutDir)\\$(TargetName).map',
748 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
749 'TargetMachine': '1',
750 'FixedBaseAddress': '1',
[email protected]825ff8d2009-05-22 01:40:48751 # SubSystem values:
752 # 0 == not set
753 # 1 == /SUBSYSTEM:CONSOLE
754 # 2 == /SUBSYSTEM:WINDOWS
755 # Most of the executables we'll ever create are tests
756 # and utilities with console output.
757 'SubSystem': '1',
[email protected]2f80c312009-02-25 21:26:55758 },
759 'VCMIDLTool': {
760 'GenerateStublessProxies': 'true',
761 'TypeLibraryName': '$(InputName).tlb',
762 'OutputDirectory': '$(IntDir)',
763 'HeaderFileName': '$(InputName).h',
764 'DLLDataFileName': 'dlldata.c',
765 'InterfaceIdentifierFileName': '$(InputName)_i.c',
766 'ProxyFileName': '$(InputName)_p.c',
767 },
768 'VCResourceCompilerTool': {
769 'Culture' : '1033',
[email protected]245b3cd592009-03-31 01:12:14770 'AdditionalIncludeDirectories': ['<(DEPTH)'],
[email protected]2f80c312009-02-25 21:26:55771 },
772 },
773 },
774 }],
775 ['chromium_code==0', {
776 # This section must follow the other conditon sections above because
777 # external_code.gypi expects to be merged into those settings.
778 'includes': [
779 'external_code.gypi',
780 ],
[email protected]dce5df52009-06-29 17:58:25781 }, {
782 'target_defaults': {
783 # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
784 # C99 macros on Mac and Linux.
785 'defines': [
786 '__STDC_FORMAT_MACROS',
787 ],
788 },
[email protected]2f80c312009-02-25 21:26:55789 }],
[email protected]48c7af72009-07-03 22:00:19790 ['msvs_use_common_linker_extras', {
791 'target_defaults': {
792 'msvs_settings': {
793 'VCLinkerTool': {
794 'AdditionalOptions':
795 '/safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat',
796 'DelayLoadDLLs': [
797 'dbghelp.dll',
798 'dwmapi.dll',
799 'uxtheme.dll',
800 ],
801 },
802 },
803 },
804 }],
[email protected]2f80c312009-02-25 21:26:55805 ],
[email protected]c13fcbd2009-03-27 04:27:01806 'scons_settings': {
807 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
[email protected]a8b56d92009-08-10 04:09:07808 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
[email protected]c13fcbd2009-03-27 04:27:01809 },
[email protected]2f80c312009-02-25 21:26:55810 'xcode_settings': {
811 # The Xcode generator will look for an xcode_settings section at the root
812 # of each dict and use it to apply settings on a file-wide basis. Most
813 # settings should not be here, they should be in target-specific
814 # xcode_settings sections, or better yet, should use non-Xcode-specific
815 # settings in target dicts. SYMROOT is a special case, because many other
816 # Xcode variables depend on it, including variables such as
817 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
818 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
819 # files to appear (when present) in the UI as actual files and not red
820 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
821 # and therefore SYMROOT, needs to be set at the project level.
[email protected]bfa24b962009-03-02 00:16:16822 'SYMROOT': '<(DEPTH)/xcodebuild',
[email protected]2f80c312009-02-25 21:26:55823 },
[email protected]ee28c9f2009-09-04 01:53:01824}