Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(508)

Side by Side Diff: base/allocator/allocator.gyp

Issue 1489403002: allocator cleanup: Reorganize allocator.gyp for cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove obsolete comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
20 # e.g. for profiling (it's more rare to profile Debug builds,
21 # but people sometimes need to do that).
22 'disable_debugallocation%': 0,
19 }, 23 },
20 'targets': [ 24 'targets': [
21 # Only executables and not libraries should depend on the 25 # Only executables and not libraries should depend on the
22 # allocator target; only the application (the final executable) 26 # allocator target; only the application (the final executable)
23 # knows what allocator makes sense. 27 # knows what allocator makes sense.
24 { 28 {
25 'target_name': 'allocator', 29 'target_name': 'allocator',
30 # TODO(primiano): This should be type: none for the noop cases (an empty
31 # static lib can confuse some gyp generators). Fix it once the refactoring
32 # (crbug.com/564618) bring this file to a saner state (fewer conditions).
26 'type': 'static_library', 33 'type': 'static_library',
27 'direct_dependent_settings': { 34 'conditions': [
28 'configurations': { 35 # TODO(primiano): in next CL this should check win_use_allocator_shim.
29 'Common_Base': { 36 # Right now that would produce a non-zero ninja diff for asan=1.
30 'msvs_settings': { 37 ['OS=="win" and component!="shared_library"', {
31 'VCLinkerTool': { 38 'msvs_settings': {
32 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], 39 # TODO(sgk): merge this with build/common.gypi settings
33 'AdditionalDependencies': [ 40 'VCLibrarianTool': {
34 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib' 41 'AdditionalOptions': ['/ignore:4006,4221'],
35 ], 42 },
43 'VCLinkerTool': {
44 'AdditionalOptions': ['/ignore:4006'],
45 },
46 },
47 'dependencies': [
48 'libcmt',
49
50 # TODO(primiano): remove in next CL, not really needed.
51 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_ annotations',
52 ],
53 'include_dirs': [
54 '.', # TODO(primiano): remove in next CL, not really needed.
55 '../..',
56 ],
57 'sources': [
58 'allocator_shim_win.cc',
59 ],
60 'configurations': {
61 'Debug_Base': {
62 'msvs_settings': {
63 'VCCLCompilerTool': {
64 'RuntimeLibrary': '0',
65 },
66 },
67 # TODO(primiano): remove this 'conditions' section soon. This is
68 # only for tc-malloc, which is not supported on windows. The only
69 # reason os it is to make the initial refactoring easier and
70 # a zero-diff ninja w.r.t. the current situation.
71 'conditions': [
72 ['disable_debugallocation==0', {
73 'defines': [ 'TCMALLOC_FOR_DEBUGALLOCATION' ],
74 }],
75 ],
76 },
77 },
78 'direct_dependent_settings': {
79 'configurations': {
80 'Common_Base': {
81 'msvs_settings': {
82 'VCLinkerTool': {
83 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'],
84 'AdditionalDependencies': [
85 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib'
86 ],
87 },
88 },
36 }, 89 },
37 }, 90 },
38 },
39 },
40 'conditions': [
41 ['OS=="win"', {
42 'defines': [ 91 'defines': [
43 'PERFTOOLS_DLL_DECL=', 92 'PERFTOOLS_DLL_DECL=',
44 ], 93 ],
45 }],
46 ],
47 },
48 'dependencies': [
49 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_anno tations',
50 ],
51 'msvs_settings': {
52 # TODO(sgk): merge this with build/common.gypi settings
53 'VCLibrarianTool': {
54 'AdditionalOptions': ['/ignore:4006,4221'],
55 },
56 'VCLinkerTool': {
57 'AdditionalOptions': ['/ignore:4006'],
58 },
59 },
60 'configurations': {
61 'Debug_Base': {
62 'msvs_settings': {
63 'VCCLCompilerTool': {
64 'RuntimeLibrary': '0',
65 },
66 }, 94 },
67 'variables': { 95 }], # OS=="win"
68 # Provide a way to force disable debugallocation in Debug builds,
69 # e.g. for profiling (it's more rare to profile Debug builds,
70 # but people sometimes need to do that).
71 'disable_debugallocation%': 0,
72 },
73 'conditions': [
74 ['disable_debugallocation==0', {
75 'defines': [
76 # Use debugallocation for Debug builds to catch problems early
77 # and cleanly, http://crbug.com/30715 .
78 'TCMALLOC_FOR_DEBUGALLOCATION',
79 ],
80 }],
81 ],
82 },
83 },
84 'conditions': [
85 ['use_allocator=="tcmalloc"', { 96 ['use_allocator=="tcmalloc"', {
86 # Disable the heap checker in tcmalloc. 97 # Disable the heap checker in tcmalloc.
87 'defines': [ 98 'defines': [
88 'NO_HEAP_CHECK', 99 'NO_HEAP_CHECK',
89 ], 100 ],
101 'dependencies': [
102 '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_ annotations',
103 ],
104 # The order of this include_dirs matters, as tc-malloc has its own
105 # base/ mini-fork. Do not factor these out of this conditions section.
90 'include_dirs': [ 106 'include_dirs': [
91 '.', 107 '.',
92 '<(tcmalloc_dir)/src/base', 108 '<(tcmalloc_dir)/src/base',
93 '<(tcmalloc_dir)/src', 109 '<(tcmalloc_dir)/src',
94 '../..', 110 '../..',
95 ], 111 ],
96 'sources': [ 112 'sources': [
97 # Generated for our configuration from tcmalloc's build 113 # Generated for our configuration from tcmalloc's build
98 # and checked in. 114 # and checked in.
99 '<(tcmalloc_dir)/src/config.h', 115 '<(tcmalloc_dir)/src/config.h',
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h', 296 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h',
281 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h', 297 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h',
282 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h', 298 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h',
283 '<(tcmalloc_dir)/src/stacktrace_with_context.cc', 299 '<(tcmalloc_dir)/src/stacktrace_with_context.cc',
284 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h', 300 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h',
285 '<(tcmalloc_dir)/src/tcmalloc_guard.h', 301 '<(tcmalloc_dir)/src/tcmalloc_guard.h',
286 302
287 # Included by debugallocation_shim.cc. 303 # Included by debugallocation_shim.cc.
288 '<(tcmalloc_dir)/src/debugallocation.cc', 304 '<(tcmalloc_dir)/src/debugallocation.cc',
289 '<(tcmalloc_dir)/src/tcmalloc.cc', 305 '<(tcmalloc_dir)/src/tcmalloc.cc',
290 ]
291 },{
292 'include_dirs': [
293 '.',
294 '../..',
295 ], 306 ],
296 }], 307 'conditions': [
297 ['OS=="win" and component!="shared_library"', { 308 ['OS=="linux" or OS=="freebsd" or OS=="solaris" or OS=="android"', {
298 'dependencies': [ 309 'sources!': [
299 'libcmt', 310 '<(tcmalloc_dir)/src/system-alloc.h',
311 ],
312 # We enable all warnings by default, but upstream disables a few.
313 # Keep "-Wno-*" flags in sync with upstream by comparing against:
314 # http://code.google.com/p/google-perftools/source/browse/trunk/Ma kefile.am
315 'cflags': [
316 '-Wno-sign-compare',
317 '-Wno-unused-result',
318 ],
319 'cflags!': [
320 '-fvisibility=hidden',
321 ],
322 'link_settings': {
323 'ldflags': [
324 # Don't let linker rip this symbol out, otherwise the heap&cpu
325 # profilers will not initialize properly on startup.
326 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart',
327 # Do the same for heap leak checker.
328 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_M MapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi',
329 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_M MapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl',
330 '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakC hecker14UnIgnoreObjectEPKv',
331 ],
332 },
333 }],
334 ['profiling!=1', {
335 'sources!': [
336 # cpuprofiler
337 '<(tcmalloc_dir)/src/base/thread_lister.c',
338 '<(tcmalloc_dir)/src/base/thread_lister.h',
339 '<(tcmalloc_dir)/src/profile-handler.cc',
340 '<(tcmalloc_dir)/src/profile-handler.h',
341 '<(tcmalloc_dir)/src/profiledata.cc',
342 '<(tcmalloc_dir)/src/profiledata.h',
343 '<(tcmalloc_dir)/src/profiler.cc',
344 ],
345 }],
300 ], 346 ],
301 'sources': [ 347 'configurations': {
302 'allocator_shim_win.cc', 348 'Debug_Base': {
303 ], 349 'conditions': [
304 }], 350 ['disable_debugallocation==0', {
305 ['profiling!=1', { 351 'defines': [
306 'sources!': [ 352 # Use debugallocation for Debug builds to catch problems
307 # cpuprofiler 353 # early and cleanly, http://crbug.com/30715 .
308 '<(tcmalloc_dir)/src/base/thread_lister.c', 354 'TCMALLOC_FOR_DEBUGALLOCATION',
309 '<(tcmalloc_dir)/src/base/thread_lister.h', 355 ],
310 '<(tcmalloc_dir)/src/profile-handler.cc', 356 }],
311 '<(tcmalloc_dir)/src/profile-handler.h', 357 ],
312 '<(tcmalloc_dir)/src/profiledata.cc', 358 },
313 '<(tcmalloc_dir)/src/profiledata.h', 359 },
314 '<(tcmalloc_dir)/src/profiler.cc', 360 }], # use_allocator=="tcmalloc
315 ], 361 # For CrOS builds with vtable verification. According to the author of
316 }], 362 # crrev.com/10854031 this is used in conjuction with some other CrOS
317 ['OS=="linux" or OS=="freebsd" or OS=="solaris" or OS=="android"', { 363 # build flag, to enable verification of any allocator that uses virtual
318 'sources!': [ 364 # function calls.
319 '<(tcmalloc_dir)/src/system-alloc.h', 365 ['use_vtable_verify==1', {
320 ],
321 # We enable all warnings by default, but upstream disables a few.
322 # Keep "-Wno-*" flags in sync with upstream by comparing against:
323 # http://code.google.com/p/google-perftools/source/browse/trunk/Makefi le.am
324 'cflags': [
325 '-Wno-sign-compare',
326 '-Wno-unused-result',
327 ],
328 'cflags!': [
329 '-fvisibility=hidden',
330 ],
331 'link_settings': {
332 'ldflags': [
333 # Don't let linker rip this symbol out, otherwise the heap&cpu
334 # profilers will not initialize properly on startup.
335 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart',
336 # Do the same for heap leak checker.
337 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapP KvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi',
338 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapP KvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl',
339 '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakCheck er14UnIgnoreObjectEPKv',
340 ]},
341 }],
342 [ 'use_vtable_verify==1', {
343 'cflags': [ 366 'cflags': [
344 '-fvtable-verify=preinit', 367 '-fvtable-verify=preinit',
345 ], 368 ],
346 }], 369 }],
347 ['order_profiling != 0', { 370 ['order_profiling != 0', {
348 'target_conditions' : [ 371 'target_conditions' : [
349 ['_toolset=="target"', { 372 ['_toolset=="target"', {
350 'cflags!': [ '-finstrument-functions' ], 373 'cflags!': [ '-finstrument-functions' ],
351 }], 374 }],
352 ], 375 ],
353 }], 376 }],
354 ], 377 ], # conditions of 'allocator' target.
355 }, 378 }, # 'allocator' target.
356 { 379 {
357 # This library is linked in to src/base.gypi:base and allocator_unittests 380 # This library is linked in to src/base.gypi:base and allocator_unittests
358 # It can't depend on either and nothing else should depend on it - all 381 # It can't depend on either and nothing else should depend on it - all
359 # other code should use the interfaced provided by base. 382 # other code should use the interfaced provided by base.
360 'target_name': 'allocator_extension_thunks', 383 'target_name': 'allocator_extension_thunks',
361 'type': 'static_library', 384 'type': 'static_library',
362 'sources': [ 385 'sources': [
363 'allocator_extension_thunks.cc', 386 'allocator_extension_thunks.cc',
364 'allocator_extension_thunks.h', 387 'allocator_extension_thunks.h',
365 ], 388 ],
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 ], 472 ],
450 'dependencies': [ 473 'dependencies': [
451 '../../testing/gtest.gyp:gtest', 474 '../../testing/gtest.gyp:gtest',
452 'allocator', 475 'allocator',
453 ], 476 ],
454 }, 477 },
455 ], 478 ],
456 }], 479 }],
457 ], 480 ],
458 } 481 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698