| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 'target_defaults': { | 6 'target_defaults': { |
| 7 'variables': { | 7 'variables': { |
| 8 # This code gets run a lot and debugged rarely, so it should be fast | 8 # This code gets run a lot and debugged rarely, so it should be fast |
| 9 # by default. See http://crbug.com/388949. | 9 # by default. See http://crbug.com/388949. |
| 10 'debug_optimize': '2', | 10 'debug_optimize': '2', |
| 11 'win_debug_Optimization': '0', | 11 'win_debug_Optimization': '0', |
| 12 # Run time checks are incompatible with any level of optimizations. | 12 # Run time checks are incompatible with any level of optimizations. |
| 13 'win_debug_RuntimeChecks': '0', | 13 'win_debug_RuntimeChecks': '0', |
| 14 }, | 14 }, |
| 15 }, | 15 }, |
| 16 'variables': { | 16 'variables': { |
| 17 'tcmalloc_dir': '../../third_party/tcmalloc/chromium', | 17 'tcmalloc_dir': '../../third_party/tcmalloc/chromium', |
| 18 'use_vtable_verify%': 0, | 18 'use_vtable_verify%': 0, |
| 19 # Provide a way to force disable debugallocation in Debug builds | 19 # Provide a way to force disable debugallocation in Debug builds |
| 20 # e.g. for profiling (it's more rare to profile Debug builds, | 20 # e.g. for profiling (it's more rare to profile Debug builds, |
| 21 # but people sometimes need to do that). | 21 # but people sometimes need to do that). |
| 22 'disable_debugallocation%': 0, | 22 'disable_debugallocation%': 0, |
| 23 }, | 23 }, |
| 24 'targets': [ | 24 'targets': [ |
| 25 # Only executables and not libraries should depend on the | 25 # Only executables and not libraries should depend on the |
| 26 # allocator target; only the application (the final executable) | 26 # allocator target; only the application (the final executable) |
| 27 # knows what allocator makes sense. | 27 # knows what allocator makes sense. |
| 28 { | 28 { |
| 29 'target_name': 'allocator', | 29 'target_name': 'allocator', |
| 30 # TODO(primiano): This should be type: none for the noop cases (an empty | 30 'variables': { |
| 31 # static lib can confuse some gyp generators). Fix it once the refactoring | 31 'conditions': [ |
| 32 # (crbug.com/564618) bring this file to a saner state (fewer conditions). | 32 ['use_allocator!="none" or (OS=="win" and win_use_allocator_shim==1)',
{ |
| 33 'type': 'static_library', | 33 'allocator_target_type%': 'static_library', |
| 34 }, { |
| 35 'allocator_target_type%': 'none', |
| 36 }], |
| 37 ], |
| 38 }, |
| 39 'type': '<(allocator_target_type)', |
| 40 'toolsets': ['host', 'target'], |
| 34 'conditions': [ | 41 'conditions': [ |
| 35 ['OS=="win" and win_use_allocator_shim==1', { | 42 ['OS=="win" and win_use_allocator_shim==1', { |
| 36 'msvs_settings': { | 43 'msvs_settings': { |
| 37 # TODO(sgk): merge this with build/common.gypi settings | 44 # TODO(sgk): merge this with build/common.gypi settings |
| 38 'VCLibrarianTool': { | 45 'VCLibrarianTool': { |
| 39 'AdditionalOptions': ['/ignore:4006,4221'], | 46 'AdditionalOptions': ['/ignore:4006,4221'], |
| 40 }, | 47 }, |
| 41 'VCLinkerTool': { | 48 'VCLinkerTool': { |
| 42 'AdditionalOptions': ['/ignore:4006'], | 49 'AdditionalOptions': ['/ignore:4006'], |
| 43 }, | 50 }, |
| 44 }, | 51 }, |
| 45 'dependencies': [ | 52 'dependencies': [ |
| 46 'libcmt', | 53 'libcmt', |
| 47 ], | 54 ], |
| 48 'include_dirs': [ | 55 'include_dirs': [ |
| 49 '../..', | 56 '../..', |
| 50 ], | 57 ], |
| 51 'sources': [ | 58 'sources': [ |
| 52 'allocator_shim_win.cc', | 59 'allocator_shim_win.cc', |
| 53 ], | 60 ], |
| 61 'link_settings': { |
| 62 'msvs_settings': { |
| 63 'VCLinkerTool': { |
| 64 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], |
| 65 'AdditionalDependencies': [ |
| 66 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib' |
| 67 ], |
| 68 }, |
| 69 }, |
| 70 }, |
| 54 'configurations': { | 71 'configurations': { |
| 55 'Debug_Base': { | 72 'Debug_Base': { |
| 56 'msvs_settings': { | 73 'msvs_settings': { |
| 57 'VCCLCompilerTool': { | 74 'VCCLCompilerTool': { |
| 58 'RuntimeLibrary': '0', | 75 'RuntimeLibrary': '0', |
| 59 }, | 76 }, |
| 60 }, | 77 }, |
| 61 }, | 78 }, |
| 62 }, | 79 }, |
| 63 'direct_dependent_settings': { | |
| 64 'configurations': { | |
| 65 'Common_Base': { | |
| 66 'msvs_settings': { | |
| 67 'VCLinkerTool': { | |
| 68 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], | |
| 69 'AdditionalDependencies': [ | |
| 70 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib' | |
| 71 ], | |
| 72 }, | |
| 73 }, | |
| 74 }, | |
| 75 }, | |
| 76 }, | |
| 77 }], # OS=="win" | 80 }], # OS=="win" |
| 78 ['use_allocator=="tcmalloc"', { | 81 ['use_allocator=="tcmalloc"', { |
| 79 # Disable the heap checker in tcmalloc. | 82 # Disable the heap checker in tcmalloc. |
| 80 'defines': [ | 83 'defines': [ |
| 81 'NO_HEAP_CHECK', | 84 'NO_HEAP_CHECK', |
| 82 ], | 85 ], |
| 83 'dependencies': [ | 86 'dependencies': [ |
| 84 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_
annotations', | 87 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_
annotations', |
| 85 ], | 88 ], |
| 86 # The order of this include_dirs matters, as tc-malloc has its own | 89 # The order of this include_dirs matters, as tc-malloc has its own |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 'target_conditions' : [ | 368 'target_conditions' : [ |
| 366 ['_toolset=="target"', { | 369 ['_toolset=="target"', { |
| 367 'cflags!': [ '-finstrument-functions' ], | 370 'cflags!': [ '-finstrument-functions' ], |
| 368 }], | 371 }], |
| 369 ], | 372 ], |
| 370 }], | 373 }], |
| 371 ], # conditions of 'allocator' target. | 374 ], # conditions of 'allocator' target. |
| 372 }, # 'allocator' target. | 375 }, # 'allocator' target. |
| 373 ], # targets. | 376 ], # targets. |
| 374 'conditions': [ | 377 'conditions': [ |
| 375 ['OS=="win" and component!="shared_library"', { | 378 ['OS=="win" and win_use_allocator_shim==1', { |
| 376 'targets': [ | 379 'targets': [ |
| 377 { | 380 { |
| 378 'target_name': 'libcmt', | 381 'target_name': 'libcmt', |
| 379 'type': 'none', | 382 'type': 'none', |
| 380 'actions': [ | 383 'actions': [ |
| 381 { | 384 { |
| 382 'action_name': 'libcmt', | 385 'action_name': 'libcmt', |
| 383 'inputs': [ | 386 'inputs': [ |
| 384 'prep_libc.py', | 387 'prep_libc.py', |
| 385 ], | 388 ], |
| 386 'outputs': [ | 389 'outputs': [ |
| 387 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib', | 390 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib', |
| 388 ], | 391 ], |
| 389 'action': [ | 392 'action': [ |
| 390 'python', | 393 'python', |
| 391 'prep_libc.py', | 394 'prep_libc.py', |
| 392 '$(VCInstallDir)lib', | 395 '$(VCInstallDir)lib', |
| 393 '<(SHARED_INTERMEDIATE_DIR)/allocator', | 396 '<(SHARED_INTERMEDIATE_DIR)/allocator', |
| 394 '<(target_arch)', | 397 '<(target_arch)', |
| 395 ], | 398 ], |
| 396 }, | 399 }, |
| 397 ], | 400 ], |
| 398 }, | 401 }, |
| 399 ], | 402 ], |
| 400 }], | 403 }], |
| 401 ], | 404 ], |
| 402 } | 405 } |
| OLD | NEW |