OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 { | |
6 'target_defaults': { | |
7 'variables': { | |
8 # This code gets run a lot and debugged rarely, so it should be fast | |
9 # by default. See http://crbug.com/388949. | |
10 'debug_optimize': '2', | |
11 'win_debug_Optimization': '0', | |
12 # Run time checks are incompatible with any level of optimizations. | |
13 'win_debug_RuntimeChecks': '0', | |
14 }, | |
15 }, | |
16 'variables': { | |
17 'tcmalloc_dir': '../../third_party/tcmalloc/chromium', | |
18 'use_vtable_verify%': 0, | |
19 }, | |
20 'targets': [ | |
21 # Only executables and not libraries should depend on the | |
22 # allocator target; only the application (the final executable) | |
23 # knows what allocator makes sense. | |
24 { | |
25 'target_name': 'allocator', | |
26 'type': 'static_library', | |
27 'direct_dependent_settings': { | |
28 'configurations': { | |
29 'Common_Base': { | |
30 'msvs_settings': { | |
31 'VCLinkerTool': { | |
32 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'], | |
33 'AdditionalDependencies': [ | |
34 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib' | |
35 ], | |
36 }, | |
37 }, | |
38 }, | |
39 }, | |
40 'conditions': [ | |
41 ['OS=="win"', { | |
42 'defines': [ | |
43 'PERFTOOLS_DLL_DECL=', | |
44 ], | |
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 }, | |
67 'variables': { | |
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"', { | |
86 # Disable the heap checker in tcmalloc. | |
87 'defines': [ | |
88 'NO_HEAP_CHECK', | |
89 ], | |
90 'include_dirs': [ | |
91 '.', | |
92 '<(tcmalloc_dir)/src/base', | |
93 '<(tcmalloc_dir)/src', | |
94 '../..', | |
95 ], | |
96 'sources': [ | |
97 # Generated for our configuration from tcmalloc's build | |
98 # and checked in. | |
99 '<(tcmalloc_dir)/src/config.h', | |
100 '<(tcmalloc_dir)/src/config_android.h', | |
101 '<(tcmalloc_dir)/src/config_linux.h', | |
102 '<(tcmalloc_dir)/src/config_win.h', | |
103 | |
104 # all tcmalloc native and forked files | |
105 '<(tcmalloc_dir)/src/addressmap-inl.h', | |
106 '<(tcmalloc_dir)/src/base/abort.cc', | |
107 '<(tcmalloc_dir)/src/base/abort.h', | |
108 '<(tcmalloc_dir)/src/base/arm_instruction_set_select.h', | |
109 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-generic.h', | |
110 '<(tcmalloc_dir)/src/base/atomicops-internals-arm-v6plus.h', | |
111 '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h', | |
112 '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h', | |
113 '<(tcmalloc_dir)/src/base/atomicops-internals-windows.h', | |
114 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.cc', | |
115 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h', | |
116 '<(tcmalloc_dir)/src/base/atomicops.h', | |
117 '<(tcmalloc_dir)/src/base/basictypes.h', | |
118 '<(tcmalloc_dir)/src/base/commandlineflags.h', | |
119 '<(tcmalloc_dir)/src/base/cycleclock.h', | |
120 # We don't list dynamic_annotations.c since its copy is already | |
121 # present in the dynamic_annotations target. | |
122 '<(tcmalloc_dir)/src/base/dynamic_annotations.h', | |
123 '<(tcmalloc_dir)/src/base/elf_mem_image.cc', | |
124 '<(tcmalloc_dir)/src/base/elf_mem_image.h', | |
125 '<(tcmalloc_dir)/src/base/elfcore.h', | |
126 '<(tcmalloc_dir)/src/base/googleinit.h', | |
127 '<(tcmalloc_dir)/src/base/linux_syscall_support.h', | |
128 '<(tcmalloc_dir)/src/base/linuxthreads.cc', | |
129 '<(tcmalloc_dir)/src/base/linuxthreads.h', | |
130 '<(tcmalloc_dir)/src/base/logging.cc', | |
131 '<(tcmalloc_dir)/src/base/logging.h', | |
132 '<(tcmalloc_dir)/src/base/low_level_alloc.cc', | |
133 '<(tcmalloc_dir)/src/base/low_level_alloc.h', | |
134 '<(tcmalloc_dir)/src/base/simple_mutex.h', | |
135 '<(tcmalloc_dir)/src/base/spinlock.cc', | |
136 '<(tcmalloc_dir)/src/base/spinlock.h', | |
137 '<(tcmalloc_dir)/src/base/spinlock_internal.cc', | |
138 '<(tcmalloc_dir)/src/base/spinlock_internal.h', | |
139 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h', | |
140 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h', | |
141 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h', | |
142 '<(tcmalloc_dir)/src/base/stl_allocator.h', | |
143 '<(tcmalloc_dir)/src/base/synchronization_profiling.h', | |
144 '<(tcmalloc_dir)/src/base/sysinfo.cc', | |
145 '<(tcmalloc_dir)/src/base/sysinfo.h', | |
146 '<(tcmalloc_dir)/src/base/thread_annotations.h', | |
147 '<(tcmalloc_dir)/src/base/thread_lister.c', | |
148 '<(tcmalloc_dir)/src/base/thread_lister.h', | |
149 '<(tcmalloc_dir)/src/base/vdso_support.cc', | |
150 '<(tcmalloc_dir)/src/base/vdso_support.h', | |
151 '<(tcmalloc_dir)/src/central_freelist.cc', | |
152 '<(tcmalloc_dir)/src/central_freelist.h', | |
153 '<(tcmalloc_dir)/src/common.cc', | |
154 '<(tcmalloc_dir)/src/common.h', | |
155 '<(tcmalloc_dir)/src/debugallocation.cc', | |
156 '<(tcmalloc_dir)/src/deep-heap-profile.cc', | |
157 '<(tcmalloc_dir)/src/deep-heap-profile.h', | |
158 '<(tcmalloc_dir)/src/free_list.cc', | |
159 '<(tcmalloc_dir)/src/free_list.h', | |
160 '<(tcmalloc_dir)/src/getpc.h', | |
161 '<(tcmalloc_dir)/src/gperftools/heap-checker.h', | |
162 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h', | |
163 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h', | |
164 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h', | |
165 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h', | |
166 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h', | |
167 '<(tcmalloc_dir)/src/gperftools/profiler.h', | |
168 '<(tcmalloc_dir)/src/gperftools/stacktrace.h', | |
169 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h', | |
170 '<(tcmalloc_dir)/src/heap-checker-bcad.cc', | |
171 '<(tcmalloc_dir)/src/heap-checker.cc', | |
172 '<(tcmalloc_dir)/src/heap-profile-table.cc', | |
173 '<(tcmalloc_dir)/src/heap-profile-table.h', | |
174 '<(tcmalloc_dir)/src/heap-profiler.cc', | |
175 '<(tcmalloc_dir)/src/internal_logging.cc', | |
176 '<(tcmalloc_dir)/src/internal_logging.h', | |
177 '<(tcmalloc_dir)/src/libc_override.h', | |
178 '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h', | |
179 '<(tcmalloc_dir)/src/libc_override_glibc.h', | |
180 '<(tcmalloc_dir)/src/libc_override_osx.h', | |
181 '<(tcmalloc_dir)/src/libc_override_redefine.h', | |
182 '<(tcmalloc_dir)/src/linked_list.h', | |
183 '<(tcmalloc_dir)/src/malloc_extension.cc', | |
184 '<(tcmalloc_dir)/src/malloc_hook-inl.h', | |
185 '<(tcmalloc_dir)/src/malloc_hook.cc', | |
186 '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h', | |
187 '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h', | |
188 '<(tcmalloc_dir)/src/maybe_threads.cc', | |
189 '<(tcmalloc_dir)/src/maybe_threads.h', | |
190 '<(tcmalloc_dir)/src/memfs_malloc.cc', | |
191 '<(tcmalloc_dir)/src/memory_region_map.cc', | |
192 '<(tcmalloc_dir)/src/memory_region_map.h', | |
193 '<(tcmalloc_dir)/src/packed-cache-inl.h', | |
194 '<(tcmalloc_dir)/src/page_heap.cc', | |
195 '<(tcmalloc_dir)/src/page_heap.h', | |
196 '<(tcmalloc_dir)/src/page_heap_allocator.h', | |
197 '<(tcmalloc_dir)/src/pagemap.h', | |
198 '<(tcmalloc_dir)/src/profile-handler.cc', | |
199 '<(tcmalloc_dir)/src/profile-handler.h', | |
200 '<(tcmalloc_dir)/src/profiledata.cc', | |
201 '<(tcmalloc_dir)/src/profiledata.h', | |
202 '<(tcmalloc_dir)/src/profiler.cc', | |
203 '<(tcmalloc_dir)/src/raw_printer.cc', | |
204 '<(tcmalloc_dir)/src/raw_printer.h', | |
205 '<(tcmalloc_dir)/src/sampler.cc', | |
206 '<(tcmalloc_dir)/src/sampler.h', | |
207 '<(tcmalloc_dir)/src/span.cc', | |
208 '<(tcmalloc_dir)/src/span.h', | |
209 '<(tcmalloc_dir)/src/stack_trace_table.cc', | |
210 '<(tcmalloc_dir)/src/stack_trace_table.h', | |
211 '<(tcmalloc_dir)/src/stacktrace.cc', | |
212 '<(tcmalloc_dir)/src/stacktrace_arm-inl.h', | |
213 '<(tcmalloc_dir)/src/stacktrace_config.h', | |
214 '<(tcmalloc_dir)/src/stacktrace_generic-inl.h', | |
215 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h', | |
216 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h', | |
217 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h', | |
218 '<(tcmalloc_dir)/src/stacktrace_with_context.cc', | |
219 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h', | |
220 '<(tcmalloc_dir)/src/static_vars.cc', | |
221 '<(tcmalloc_dir)/src/static_vars.h', | |
222 '<(tcmalloc_dir)/src/symbolize.cc', | |
223 '<(tcmalloc_dir)/src/symbolize.h', | |
224 '<(tcmalloc_dir)/src/system-alloc.cc', | |
225 '<(tcmalloc_dir)/src/system-alloc.h', | |
226 '<(tcmalloc_dir)/src/tcmalloc.cc', | |
227 '<(tcmalloc_dir)/src/tcmalloc_guard.h', | |
228 '<(tcmalloc_dir)/src/thread_cache.cc', | |
229 '<(tcmalloc_dir)/src/thread_cache.h', | |
230 | |
231 'debugallocation_shim.cc', | |
232 ], | |
233 # sources! means that these are not compiled directly. | |
234 'sources!': [ | |
235 # We simply don't use these, but list them above so that IDE | |
236 # users can view the full available source for reference, etc. | |
237 '<(tcmalloc_dir)/src/addressmap-inl.h', | |
238 '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h', | |
239 '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h', | |
240 '<(tcmalloc_dir)/src/base/atomicops-internals-x86-msvc.h', | |
241 '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h', | |
242 '<(tcmalloc_dir)/src/base/atomicops.h', | |
243 '<(tcmalloc_dir)/src/base/basictypes.h', | |
244 '<(tcmalloc_dir)/src/base/commandlineflags.h', | |
245 '<(tcmalloc_dir)/src/base/cycleclock.h', | |
246 '<(tcmalloc_dir)/src/base/elf_mem_image.h', | |
247 '<(tcmalloc_dir)/src/base/elfcore.h', | |
248 '<(tcmalloc_dir)/src/base/googleinit.h', | |
249 '<(tcmalloc_dir)/src/base/linux_syscall_support.h', | |
250 '<(tcmalloc_dir)/src/base/simple_mutex.h', | |
251 '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h', | |
252 '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h', | |
253 '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h', | |
254 '<(tcmalloc_dir)/src/base/stl_allocator.h', | |
255 '<(tcmalloc_dir)/src/base/thread_annotations.h', | |
256 '<(tcmalloc_dir)/src/getpc.h', | |
257 '<(tcmalloc_dir)/src/gperftools/heap-checker.h', | |
258 '<(tcmalloc_dir)/src/gperftools/heap-profiler.h', | |
259 '<(tcmalloc_dir)/src/gperftools/malloc_extension.h', | |
260 '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h', | |
261 '<(tcmalloc_dir)/src/gperftools/malloc_hook.h', | |
262 '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h', | |
263 '<(tcmalloc_dir)/src/gperftools/profiler.h', | |
264 '<(tcmalloc_dir)/src/gperftools/stacktrace.h', | |
265 '<(tcmalloc_dir)/src/gperftools/tcmalloc.h', | |
266 '<(tcmalloc_dir)/src/heap-checker-bcad.cc', | |
267 '<(tcmalloc_dir)/src/heap-checker.cc', | |
268 '<(tcmalloc_dir)/src/libc_override.h', | |
269 '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h', | |
270 '<(tcmalloc_dir)/src/libc_override_glibc.h', | |
271 '<(tcmalloc_dir)/src/libc_override_osx.h', | |
272 '<(tcmalloc_dir)/src/libc_override_redefine.h', | |
273 '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h', | |
274 '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h', | |
275 '<(tcmalloc_dir)/src/memfs_malloc.cc', | |
276 '<(tcmalloc_dir)/src/packed-cache-inl.h', | |
277 '<(tcmalloc_dir)/src/page_heap_allocator.h', | |
278 '<(tcmalloc_dir)/src/pagemap.h', | |
279 '<(tcmalloc_dir)/src/stacktrace_arm-inl.h', | |
280 '<(tcmalloc_dir)/src/stacktrace_config.h', | |
281 '<(tcmalloc_dir)/src/stacktrace_generic-inl.h', | |
282 '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h', | |
283 '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h', | |
284 '<(tcmalloc_dir)/src/stacktrace_win32-inl.h', | |
285 '<(tcmalloc_dir)/src/stacktrace_with_context.cc', | |
286 '<(tcmalloc_dir)/src/stacktrace_x86-inl.h', | |
287 '<(tcmalloc_dir)/src/tcmalloc_guard.h', | |
288 | |
289 # Included by debugallocation_shim.cc. | |
290 '<(tcmalloc_dir)/src/debugallocation.cc', | |
291 '<(tcmalloc_dir)/src/tcmalloc.cc', | |
292 ] | |
293 },{ | |
294 'include_dirs': [ | |
295 '.', | |
296 '../..', | |
297 ], | |
298 }], | |
299 ['OS=="linux" and clang_type_profiler==1', { | |
300 'dependencies': [ | |
301 'type_profiler_tcmalloc', | |
302 ], | |
303 # It is undoing dependencies and cflags_cc for type_profiler which | |
304 # build/common.gypi injects into all targets. | |
305 'dependencies!': [ | |
306 'type_profiler', | |
307 ], | |
308 'cflags_cc!': [ | |
309 '-fintercept-allocation-functions', | |
310 ], | |
311 }], | |
312 ['OS=="win"', { | |
313 'dependencies': [ | |
314 'libcmt', | |
315 ], | |
316 'sources': [ | |
317 'allocator_shim_win.cc', | |
318 ], | |
319 }], | |
320 ['profiling!=1', { | |
321 'sources!': [ | |
322 # cpuprofiler | |
323 '<(tcmalloc_dir)/src/base/thread_lister.c', | |
324 '<(tcmalloc_dir)/src/base/thread_lister.h', | |
325 '<(tcmalloc_dir)/src/profile-handler.cc', | |
326 '<(tcmalloc_dir)/src/profile-handler.h', | |
327 '<(tcmalloc_dir)/src/profiledata.cc', | |
328 '<(tcmalloc_dir)/src/profiledata.h', | |
329 '<(tcmalloc_dir)/src/profiler.cc', | |
330 ], | |
331 }], | |
332 ['OS=="linux" or OS=="freebsd" or OS=="solaris" or OS=="android"', { | |
333 'sources!': [ | |
334 '<(tcmalloc_dir)/src/system-alloc.h', | |
335 ], | |
336 # We enable all warnings by default, but upstream disables a few. | |
337 # Keep "-Wno-*" flags in sync with upstream by comparing against: | |
338 # http://code.google.com/p/google-perftools/source/browse/trunk/Makefi
le.am | |
339 'cflags': [ | |
340 '-Wno-sign-compare', | |
341 '-Wno-unused-result', | |
342 ], | |
343 'cflags!': [ | |
344 '-fvisibility=hidden', | |
345 ], | |
346 'link_settings': { | |
347 'ldflags': [ | |
348 # Don't let linker rip this symbol out, otherwise the heap&cpu | |
349 # profilers will not initialize properly on startup. | |
350 '-Wl,-uIsHeapProfilerRunning,-uProfilerStart', | |
351 # Do the same for heap leak checker. | |
352 '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapP
KvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi', | |
353 '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapP
KvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl', | |
354 '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakCheck
er14UnIgnoreObjectEPKv', | |
355 ]}, | |
356 }], | |
357 [ 'use_vtable_verify==1', { | |
358 'cflags': [ | |
359 '-fvtable-verify=preinit', | |
360 ], | |
361 }], | |
362 ['order_profiling != 0', { | |
363 'target_conditions' : [ | |
364 ['_toolset=="target"', { | |
365 'cflags!': [ '-finstrument-functions' ], | |
366 }], | |
367 ], | |
368 }], | |
369 ], | |
370 }, | |
371 { | |
372 # This library is linked in to src/base.gypi:base and allocator_unittests | |
373 # It can't depend on either and nothing else should depend on it - all | |
374 # other code should use the interfaced provided by base. | |
375 'target_name': 'allocator_extension_thunks', | |
376 'type': 'static_library', | |
377 'sources': [ | |
378 'allocator_extension_thunks.cc', | |
379 'allocator_extension_thunks.h', | |
380 ], | |
381 'toolsets': ['host', 'target'], | |
382 'include_dirs': [ | |
383 '../../' | |
384 ], | |
385 'conditions': [ | |
386 ['OS=="linux" and clang_type_profiler==1', { | |
387 # It is undoing dependencies and cflags_cc for type_profiler which | |
388 # build/common.gypi injects into all targets. | |
389 'dependencies!': [ | |
390 'type_profiler', | |
391 ], | |
392 'cflags_cc!': [ | |
393 '-fintercept-allocation-functions', | |
394 ], | |
395 }], | |
396 ], | |
397 }, | |
398 ], | |
399 'conditions': [ | |
400 ['OS=="win"', { | |
401 'targets': [ | |
402 { | |
403 'target_name': 'libcmt', | |
404 'type': 'none', | |
405 'actions': [ | |
406 { | |
407 'action_name': 'libcmt', | |
408 'inputs': [ | |
409 'prep_libc.py', | |
410 ], | |
411 'outputs': [ | |
412 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib', | |
413 ], | |
414 'action': [ | |
415 'python', | |
416 'prep_libc.py', | |
417 '$(VCInstallDir)lib', | |
418 '<(SHARED_INTERMEDIATE_DIR)/allocator', | |
419 '<(target_arch)', | |
420 ], | |
421 }, | |
422 ], | |
423 }, | |
424 { | |
425 'target_name': 'allocator_unittests', | |
426 'type': 'executable', | |
427 'dependencies': [ | |
428 'allocator', | |
429 'allocator_extension_thunks', | |
430 '../../testing/gtest.gyp:gtest', | |
431 ], | |
432 'include_dirs': [ | |
433 '.', | |
434 '../..', | |
435 ], | |
436 'sources': [ | |
437 '../profiler/alternate_timer.cc', | |
438 '../profiler/alternate_timer.h', | |
439 'allocator_unittest.cc', | |
440 ], | |
441 }, | |
442 ], | |
443 }], | |
444 ['OS=="win" and target_arch=="ia32"', { | |
445 'targets': [ | |
446 { | |
447 'target_name': 'allocator_extension_thunks_win64', | |
448 'type': 'static_library', | |
449 'sources': [ | |
450 'allocator_extension_thunks.cc', | |
451 'allocator_extension_thunks.h', | |
452 ], | |
453 'toolsets': ['host', 'target'], | |
454 'include_dirs': [ | |
455 '../../' | |
456 ], | |
457 'configurations': { | |
458 'Common_Base': { | |
459 'msvs_target_platform': 'x64', | |
460 }, | |
461 }, | |
462 }, | |
463 ], | |
464 }], | |
465 ['OS=="linux" and clang_type_profiler==1', { | |
466 # Some targets in this section undo dependencies and cflags_cc for | |
467 # type_profiler which build/common.gypi injects into all targets. | |
468 'targets': [ | |
469 { | |
470 'target_name': 'type_profiler', | |
471 'type': 'static_library', | |
472 'dependencies!': [ | |
473 'type_profiler', | |
474 ], | |
475 'cflags_cc!': [ | |
476 '-fintercept-allocation-functions', | |
477 ], | |
478 'include_dirs': [ | |
479 '../..', | |
480 ], | |
481 'sources': [ | |
482 'type_profiler.cc', | |
483 'type_profiler.h', | |
484 'type_profiler_control.h', | |
485 ], | |
486 'toolsets': ['host', 'target'], | |
487 }, | |
488 { | |
489 'target_name': 'type_profiler_tcmalloc', | |
490 'type': 'static_library', | |
491 'dependencies!': [ | |
492 'type_profiler', | |
493 ], | |
494 'cflags_cc!': [ | |
495 '-fintercept-allocation-functions', | |
496 ], | |
497 'include_dirs': [ | |
498 '<(tcmalloc_dir)/src', | |
499 '../..', | |
500 ], | |
501 'sources': [ | |
502 '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h', | |
503 '<(tcmalloc_dir)/src/type_profiler_map.cc', | |
504 'type_profiler_tcmalloc.cc', | |
505 'type_profiler_tcmalloc.h', | |
506 ], | |
507 }, | |
508 { | |
509 'target_name': 'type_profiler_unittests', | |
510 'type': 'executable', | |
511 'dependencies': [ | |
512 '../../testing/gtest.gyp:gtest', | |
513 '../base.gyp:base', | |
514 'allocator', | |
515 'type_profiler_tcmalloc', | |
516 ], | |
517 'include_dirs': [ | |
518 '../..', | |
519 ], | |
520 'sources': [ | |
521 'type_profiler_control.cc', | |
522 'type_profiler_control.h', | |
523 'type_profiler_unittest.cc', | |
524 ], | |
525 }, | |
526 { | |
527 'target_name': 'type_profiler_map_unittests', | |
528 'type': 'executable', | |
529 'dependencies': [ | |
530 '../../testing/gtest.gyp:gtest', | |
531 '../base.gyp:base', | |
532 'allocator', | |
533 ], | |
534 'dependencies!': [ | |
535 'type_profiler', | |
536 ], | |
537 'cflags_cc!': [ | |
538 '-fintercept-allocation-functions', | |
539 ], | |
540 'include_dirs': [ | |
541 '<(tcmalloc_dir)/src', | |
542 '../..', | |
543 ], | |
544 'sources': [ | |
545 '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h', | |
546 '<(tcmalloc_dir)/src/type_profiler_map.cc', | |
547 'type_profiler_map_unittest.cc', | |
548 ], | |
549 }, | |
550 ], | |
551 }], | |
552 ['use_allocator=="tcmalloc"', { | |
553 'targets': [ | |
554 { | |
555 'target_name': 'tcmalloc_unittest', | |
556 'type': 'executable', | |
557 'sources': [ | |
558 'tcmalloc_unittest.cc', | |
559 ], | |
560 'include_dirs': [ | |
561 '<(tcmalloc_dir)/src', | |
562 '../..', | |
563 ], | |
564 'dependencies': [ | |
565 '../../testing/gtest.gyp:gtest', | |
566 'allocator', | |
567 ], | |
568 }, | |
569 ], | |
570 }], | |
571 ], | |
572 } | |
OLD | NEW |