OLD | NEW |
1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 { | 5 { |
6 'variables': { | 6 'variables': { |
7 # .gyp files should set chromium_code to 1 if they build Chromium-specific | 7 # .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 | 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 | 9 # such things as the set of warnings to enable, and whether warnings are |
10 # treated as errors. | 10 # treated as errors. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 },{ | 160 },{ |
161 'msvs_large_module_debug_link_mode%': '2', # Yes | 161 'msvs_large_module_debug_link_mode%': '2', # Yes |
162 }], | 162 }], |
163 ], | 163 ], |
164 }], | 164 }], |
165 ], | 165 ], |
166 }, | 166 }, |
167 'target_defaults': { | 167 'target_defaults': { |
168 'variables': { | 168 'variables': { |
169 'mac_release_optimization%': '3', # Use -O3 unless overridden | 169 'mac_release_optimization%': '3', # Use -O3 unless overridden |
170 'mac_debug_optimization%': '0' # Use -O0 unless overridden | 170 'mac_debug_optimization%': '0', # Use -O0 unless overridden |
| 171 'release_extra_cflags%': '', |
| 172 'debug_extra_cflags%': '', |
171 }, | 173 }, |
172 'conditions': [ | 174 'conditions': [ |
173 ['branding=="Chrome"', { | 175 ['branding=="Chrome"', { |
174 'defines': ['GOOGLE_CHROME_BUILD'], | 176 'defines': ['GOOGLE_CHROME_BUILD'], |
175 }, { # else: branding!="Chrome" | 177 }, { # else: branding!="Chrome" |
176 'defines': ['CHROMIUM_BUILD'], | 178 'defines': ['CHROMIUM_BUILD'], |
177 }], | 179 }], |
178 ['toolkit_views==1', { | 180 ['toolkit_views==1', { |
179 'defines': ['TOOLKIT_VIEWS=1'], | 181 'defines': ['TOOLKIT_VIEWS=1'], |
180 }], | 182 }], |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 'configurations': { | 226 'configurations': { |
225 # VCLinkerTool LinkIncremental values below: | 227 # VCLinkerTool LinkIncremental values below: |
226 # 0 == default | 228 # 0 == default |
227 # 1 == /INCREMENTAL:NO | 229 # 1 == /INCREMENTAL:NO |
228 # 2 == /INCREMENTAL | 230 # 2 == /INCREMENTAL |
229 # Debug links incremental, Release does not. | 231 # Debug links incremental, Release does not. |
230 'Debug': { | 232 'Debug': { |
231 'xcode_settings': { | 233 'xcode_settings': { |
232 'COPY_PHASE_STRIP': 'NO', | 234 'COPY_PHASE_STRIP': 'NO', |
233 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)', | 235 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)', |
| 236 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ], |
234 }, | 237 }, |
235 'conditions': [ | 238 'conditions': [ |
236 [ 'OS=="win"', { | 239 [ 'OS=="win"', { |
237 'configuration_platform': 'Win32', | 240 'configuration_platform': 'Win32', |
238 'msvs_configuration_attributes': { | 241 'msvs_configuration_attributes': { |
239 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', | 242 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', |
240 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', | 243 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', |
241 'CharacterSet': '1', | 244 'CharacterSet': '1', |
242 }, | 245 }, |
243 'msvs_settings': { | 246 'msvs_settings': { |
244 'VCCLCompilerTool': { | 247 'VCCLCompilerTool': { |
245 'Optimization': '0', | 248 'Optimization': '0', |
246 'PreprocessorDefinitions': ['_DEBUG'], | 249 'PreprocessorDefinitions': ['_DEBUG'], |
247 'BasicRuntimeChecks': '3', | 250 'BasicRuntimeChecks': '3', |
248 'RuntimeLibrary': '1', | 251 'RuntimeLibrary': '1', |
249 }, | 252 }, |
250 'VCLinkerTool': { | 253 'VCLinkerTool': { |
251 'LinkIncremental': '<(msvs_debug_link_incremental)', | 254 'LinkIncremental': '<(msvs_debug_link_incremental)', |
252 }, | 255 }, |
253 'VCResourceCompilerTool': { | 256 'VCResourceCompilerTool': { |
254 'PreprocessorDefinitions': ['_DEBUG'], | 257 'PreprocessorDefinitions': ['_DEBUG'], |
255 }, | 258 }, |
256 }, | 259 }, |
257 }], | 260 }], |
| 261 ['OS=="linux"', { |
| 262 'cflags': [ |
| 263 '<@(debug_extra_cflags)', |
| 264 ], |
| 265 }], |
258 ], | 266 ], |
259 }, | 267 }, |
260 'Release': { | 268 'Release': { |
261 'defines': [ | 269 'defines': [ |
262 'NDEBUG', | 270 'NDEBUG', |
263 ], | 271 ], |
264 'xcode_settings': { | 272 'xcode_settings': { |
265 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip | 273 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip |
266 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', | 274 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)', |
| 275 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ], |
267 }, | 276 }, |
268 'conditions': [ | 277 'conditions': [ |
269 [ 'OS=="win" and msvs_use_common_release', { | 278 [ 'OS=="win" and msvs_use_common_release', { |
270 'msvs_props': ['release.vsprops'], | 279 'msvs_props': ['release.vsprops'], |
271 }], | 280 }], |
272 [ 'OS=="win"', { | 281 [ 'OS=="win"', { |
273 'configuration_platform': 'Win32', | 282 'configuration_platform': 'Win32', |
274 'msvs_configuration_attributes': { | 283 'msvs_configuration_attributes': { |
275 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', | 284 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)', |
276 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', | 285 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', |
277 'CharacterSet': '1', | 286 'CharacterSet': '1', |
278 }, | 287 }, |
279 'msvs_settings': { | 288 'msvs_settings': { |
280 'VCLinkerTool': { | 289 'VCLinkerTool': { |
281 'LinkIncremental': '1', | 290 'LinkIncremental': '1', |
282 }, | 291 }, |
283 }, | 292 }, |
284 }], | 293 }], |
| 294 ['OS=="linux"', { |
| 295 'cflags': [ |
| 296 '<@(release_extra_cflags)', |
| 297 ], |
| 298 }], |
285 ], | 299 ], |
286 }, | 300 }, |
287 'conditions': [ | 301 'conditions': [ |
288 [ 'OS=="win"', { | 302 [ 'OS=="win"', { |
289 # TODO(bradnelson): add a gyp mechanism to make this more graceful. | 303 # TODO(bradnelson): add a gyp mechanism to make this more graceful. |
290 'Purify': { | 304 'Purify': { |
291 'configuration_platform': 'Win32', | 305 'configuration_platform': 'Win32', |
292 'defines': [ | 306 'defines': [ |
293 'NDEBUG', | 307 'NDEBUG', |
294 'PURIFY', | 308 'PURIFY', |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 # One can use '-gstabs' to enable building the debugging | 454 # One can use '-gstabs' to enable building the debugging |
441 # information in STABS format for breakpad's dumpsyms. | 455 # information in STABS format for breakpad's dumpsyms. |
442 ], | 456 ], |
443 'ldflags': [ | 457 'ldflags': [ |
444 '-rdynamic', # Allows backtrace to resolve symbols. | 458 '-rdynamic', # Allows backtrace to resolve symbols. |
445 ], | 459 ], |
446 }, | 460 }, |
447 'Release': { | 461 'Release': { |
448 'variables': { | 462 'variables': { |
449 'release_optimize%': '2', | 463 'release_optimize%': '2', |
450 'release_extra_cflags%': '', | |
451 }, | 464 }, |
452 'cflags': [ | 465 'cflags': [ |
453 '-O<(release_optimize)', | 466 '-O<(release_optimize)', |
454 # Don't emit the GCC version ident directives, they just end up | 467 # Don't emit the GCC version ident directives, they just end up |
455 # in the .comment section taking up binary size. | 468 # in the .comment section taking up binary size. |
456 '-fno-ident', | 469 '-fno-ident', |
457 # Put data and code in their own sections, so that unused symbols | 470 # Put data and code in their own sections, so that unused symbols |
458 # can be removed at link time with --gc-sections. | 471 # can be removed at link time with --gc-sections. |
459 '-fdata-sections', | 472 '-fdata-sections', |
460 '-ffunction-sections', | 473 '-ffunction-sections', |
461 '<(release_extra_cflags)', | |
462 ], | 474 ], |
463 }, | 475 }, |
464 }, | 476 }, |
465 'variants': { | 477 'variants': { |
466 'coverage': { | 478 'coverage': { |
467 'cflags': ['-fprofile-arcs', '-ftest-coverage'], | 479 'cflags': ['-fprofile-arcs', '-ftest-coverage'], |
468 'ldflags': ['-fprofile-arcs'], | 480 'ldflags': ['-fprofile-arcs'], |
469 }, | 481 }, |
470 'profile': { | 482 'profile': { |
471 'cflags': ['-pg', '-g'], | 483 'cflags': ['-pg', '-g'], |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 # settings in target dicts. SYMROOT is a special case, because many other | 783 # settings in target dicts. SYMROOT is a special case, because many other |
772 # Xcode variables depend on it, including variables such as | 784 # Xcode variables depend on it, including variables such as |
773 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something | 785 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something |
774 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the | 786 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the |
775 # files to appear (when present) in the UI as actual files and not red | 787 # files to appear (when present) in the UI as actual files and not red |
776 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, | 788 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, |
777 # and therefore SYMROOT, needs to be set at the project level. | 789 # and therefore SYMROOT, needs to be set at the project level. |
778 'SYMROOT': '<(DEPTH)/xcodebuild', | 790 'SYMROOT': '<(DEPTH)/xcodebuild', |
779 }, | 791 }, |
780 } | 792 } |
OLD | NEW |