Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / base / allocator / allocator.gyp
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   'variables': {
7     'tcmalloc_dir': '../../third_party/tcmalloc/chromium',
8     'use_vtable_verify%': 0,
9   },
10   'targets': [
11     # Only executables and not libraries should depend on the
12     # allocator target; only the application (the final executable)
13     # knows what allocator makes sense.
14     {
15       'target_name': 'allocator',
16       'type': 'static_library',
17       # Make sure the allocation library is optimized to
18       # the hilt in official builds.
19       'variables': {
20         'optimize': 'max',
21       },
22       'include_dirs': [
23         '.',
24         '<(tcmalloc_dir)/src/base',
25         '<(tcmalloc_dir)/src',
26         '../..',
27       ],
28       'direct_dependent_settings': {
29         'configurations': {
30           'Common_Base': {
31             'msvs_settings': {
32               'VCLinkerTool': {
33                 'IgnoreDefaultLibraryNames': ['libcmtd.lib', 'libcmt.lib'],
34                 'AdditionalDependencies': [
35                   '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib'
36                 ],
37               },
38             },
39           },
40         },
41         'conditions': [
42           ['OS=="win"', {
43             'defines': [
44               'PERFTOOLS_DLL_DECL=',
45             ],
46           }],
47         ],
48       },
49       'sources': [
50         # Generated for our configuration from tcmalloc's build
51         # and checked in.
52         '<(tcmalloc_dir)/src/config.h',
53         '<(tcmalloc_dir)/src/config_android.h',
54         '<(tcmalloc_dir)/src/config_linux.h',
55         '<(tcmalloc_dir)/src/config_win.h',
56
57         # all tcmalloc native and forked files
58         '<(tcmalloc_dir)/src/addressmap-inl.h',
59         '<(tcmalloc_dir)/src/base/abort.cc',
60         '<(tcmalloc_dir)/src/base/abort.h',
61         '<(tcmalloc_dir)/src/base/arm_instruction_set_select.h',
62         '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h',
63         '<(tcmalloc_dir)/src/base/atomicops-internals-arm-generic.h',
64         '<(tcmalloc_dir)/src/base/atomicops-internals-arm-v6plus.h',
65         '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h',
66         '<(tcmalloc_dir)/src/base/atomicops-internals-windows.h',
67         '<(tcmalloc_dir)/src/base/atomicops-internals-x86.cc',
68         '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h',
69         '<(tcmalloc_dir)/src/base/atomicops.h',
70         '<(tcmalloc_dir)/src/base/basictypes.h',
71         '<(tcmalloc_dir)/src/base/commandlineflags.h',
72         '<(tcmalloc_dir)/src/base/cycleclock.h',
73         # We don't list dynamic_annotations.c since its copy is already
74         # present in the dynamic_annotations target.
75         '<(tcmalloc_dir)/src/base/dynamic_annotations.h',
76         '<(tcmalloc_dir)/src/base/elf_mem_image.cc',
77         '<(tcmalloc_dir)/src/base/elf_mem_image.h',
78         '<(tcmalloc_dir)/src/base/elfcore.h',
79         '<(tcmalloc_dir)/src/base/googleinit.h',
80         '<(tcmalloc_dir)/src/base/linux_syscall_support.h',
81         '<(tcmalloc_dir)/src/base/linuxthreads.cc',
82         '<(tcmalloc_dir)/src/base/linuxthreads.h',
83         '<(tcmalloc_dir)/src/base/logging.cc',
84         '<(tcmalloc_dir)/src/base/logging.h',
85         '<(tcmalloc_dir)/src/base/low_level_alloc.cc',
86         '<(tcmalloc_dir)/src/base/low_level_alloc.h',
87         '<(tcmalloc_dir)/src/base/simple_mutex.h',
88         '<(tcmalloc_dir)/src/base/spinlock.cc',
89         '<(tcmalloc_dir)/src/base/spinlock.h',
90         '<(tcmalloc_dir)/src/base/spinlock_internal.cc',
91         '<(tcmalloc_dir)/src/base/spinlock_internal.h',
92         '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h',
93         '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h',
94         '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h',
95         '<(tcmalloc_dir)/src/base/stl_allocator.h',
96         '<(tcmalloc_dir)/src/base/synchronization_profiling.h',
97         '<(tcmalloc_dir)/src/base/sysinfo.cc',
98         '<(tcmalloc_dir)/src/base/sysinfo.h',
99         '<(tcmalloc_dir)/src/base/thread_annotations.h',
100         '<(tcmalloc_dir)/src/base/thread_lister.c',
101         '<(tcmalloc_dir)/src/base/thread_lister.h',
102         '<(tcmalloc_dir)/src/base/vdso_support.cc',
103         '<(tcmalloc_dir)/src/base/vdso_support.h',
104         '<(tcmalloc_dir)/src/central_freelist.cc',
105         '<(tcmalloc_dir)/src/central_freelist.h',
106         '<(tcmalloc_dir)/src/common.cc',
107         '<(tcmalloc_dir)/src/common.h',
108         '<(tcmalloc_dir)/src/debugallocation.cc',
109         '<(tcmalloc_dir)/src/deep-heap-profile.cc',
110         '<(tcmalloc_dir)/src/deep-heap-profile.h',
111         '<(tcmalloc_dir)/src/free_list.cc',
112         '<(tcmalloc_dir)/src/free_list.h',
113         '<(tcmalloc_dir)/src/getpc.h',
114         '<(tcmalloc_dir)/src/gperftools/heap-checker.h',
115         '<(tcmalloc_dir)/src/gperftools/heap-profiler.h',
116         '<(tcmalloc_dir)/src/gperftools/malloc_extension.h',
117         '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h',
118         '<(tcmalloc_dir)/src/gperftools/malloc_hook.h',
119         '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h',
120         '<(tcmalloc_dir)/src/gperftools/profiler.h',
121         '<(tcmalloc_dir)/src/gperftools/stacktrace.h',
122         '<(tcmalloc_dir)/src/gperftools/tcmalloc.h',
123         '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
124         '<(tcmalloc_dir)/src/heap-checker.cc',
125         '<(tcmalloc_dir)/src/heap-profile-table.cc',
126         '<(tcmalloc_dir)/src/heap-profile-table.h',
127         '<(tcmalloc_dir)/src/heap-profiler.cc',
128         '<(tcmalloc_dir)/src/internal_logging.cc',
129         '<(tcmalloc_dir)/src/internal_logging.h',
130         '<(tcmalloc_dir)/src/libc_override.h',
131         '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h',
132         '<(tcmalloc_dir)/src/libc_override_glibc.h',
133         '<(tcmalloc_dir)/src/libc_override_osx.h',
134         '<(tcmalloc_dir)/src/libc_override_redefine.h',
135         '<(tcmalloc_dir)/src/linked_list.h',
136         '<(tcmalloc_dir)/src/malloc_extension.cc',
137         '<(tcmalloc_dir)/src/malloc_hook-inl.h',
138         '<(tcmalloc_dir)/src/malloc_hook.cc',
139         '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h',
140         '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h',
141         '<(tcmalloc_dir)/src/maybe_threads.cc',
142         '<(tcmalloc_dir)/src/maybe_threads.h',
143         '<(tcmalloc_dir)/src/memfs_malloc.cc',
144         '<(tcmalloc_dir)/src/memory_region_map.cc',
145         '<(tcmalloc_dir)/src/memory_region_map.h',
146         '<(tcmalloc_dir)/src/packed-cache-inl.h',
147         '<(tcmalloc_dir)/src/page_heap.cc',
148         '<(tcmalloc_dir)/src/page_heap.h',
149         '<(tcmalloc_dir)/src/page_heap_allocator.h',
150         '<(tcmalloc_dir)/src/pagemap.h',
151         '<(tcmalloc_dir)/src/profile-handler.cc',
152         '<(tcmalloc_dir)/src/profile-handler.h',
153         '<(tcmalloc_dir)/src/profiledata.cc',
154         '<(tcmalloc_dir)/src/profiledata.h',
155         '<(tcmalloc_dir)/src/profiler.cc',
156         '<(tcmalloc_dir)/src/raw_printer.cc',
157         '<(tcmalloc_dir)/src/raw_printer.h',
158         '<(tcmalloc_dir)/src/sampler.cc',
159         '<(tcmalloc_dir)/src/sampler.h',
160         '<(tcmalloc_dir)/src/span.cc',
161         '<(tcmalloc_dir)/src/span.h',
162         '<(tcmalloc_dir)/src/stack_trace_table.cc',
163         '<(tcmalloc_dir)/src/stack_trace_table.h',
164         '<(tcmalloc_dir)/src/stacktrace.cc',
165         '<(tcmalloc_dir)/src/stacktrace_arm-inl.h',
166         '<(tcmalloc_dir)/src/stacktrace_config.h',
167         '<(tcmalloc_dir)/src/stacktrace_generic-inl.h',
168         '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h',
169         '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h',
170         '<(tcmalloc_dir)/src/stacktrace_win32-inl.h',
171         '<(tcmalloc_dir)/src/stacktrace_with_context.cc',
172         '<(tcmalloc_dir)/src/stacktrace_x86-inl.h',
173         '<(tcmalloc_dir)/src/static_vars.cc',
174         '<(tcmalloc_dir)/src/static_vars.h',
175         '<(tcmalloc_dir)/src/symbolize.cc',
176         '<(tcmalloc_dir)/src/symbolize.h',
177         '<(tcmalloc_dir)/src/system-alloc.cc',
178         '<(tcmalloc_dir)/src/system-alloc.h',
179         '<(tcmalloc_dir)/src/tcmalloc.cc',
180         '<(tcmalloc_dir)/src/tcmalloc_guard.h',
181         '<(tcmalloc_dir)/src/thread_cache.cc',
182         '<(tcmalloc_dir)/src/thread_cache.h',
183         '<(tcmalloc_dir)/src/windows/config.h',
184         '<(tcmalloc_dir)/src/windows/get_mangled_names.cc',
185         '<(tcmalloc_dir)/src/windows/gperftools/tcmalloc.h',
186         '<(tcmalloc_dir)/src/windows/ia32_modrm_map.cc',
187         '<(tcmalloc_dir)/src/windows/ia32_opcode_map.cc',
188         '<(tcmalloc_dir)/src/windows/mingw.h',
189         '<(tcmalloc_dir)/src/windows/mini_disassembler.cc',
190         '<(tcmalloc_dir)/src/windows/mini_disassembler.h',
191         '<(tcmalloc_dir)/src/windows/mini_disassembler_types.h',
192         '<(tcmalloc_dir)/src/windows/override_functions.cc',
193         '<(tcmalloc_dir)/src/windows/patch_functions.cc',
194         '<(tcmalloc_dir)/src/windows/port.cc',
195         '<(tcmalloc_dir)/src/windows/port.h',
196         '<(tcmalloc_dir)/src/windows/preamble_patcher.cc',
197         '<(tcmalloc_dir)/src/windows/preamble_patcher.h',
198         '<(tcmalloc_dir)/src/windows/preamble_patcher_with_stub.cc',
199
200         'allocator_shim.cc',
201         'allocator_shim.h',
202         'debugallocation_shim.cc',
203         'generic_allocators.cc',
204         'win_allocator.cc',
205       ],
206       # sources! means that these are not compiled directly.
207       'sources!': [
208         # Included by allocator_shim.cc for maximal inlining.
209         'generic_allocators.cc',
210         'win_allocator.cc',
211
212         # Included by debugallocation_shim.cc.
213         '<(tcmalloc_dir)/src/debugallocation.cc',
214         '<(tcmalloc_dir)/src/tcmalloc.cc',
215
216         # We simply don't use these, but list them above so that IDE
217         # users can view the full available source for reference, etc.
218         '<(tcmalloc_dir)/src/addressmap-inl.h',
219         '<(tcmalloc_dir)/src/base/atomicops-internals-linuxppc.h',
220         '<(tcmalloc_dir)/src/base/atomicops-internals-macosx.h',
221         '<(tcmalloc_dir)/src/base/atomicops-internals-x86-msvc.h',
222         '<(tcmalloc_dir)/src/base/atomicops-internals-x86.cc',
223         '<(tcmalloc_dir)/src/base/atomicops-internals-x86.h',
224         '<(tcmalloc_dir)/src/base/atomicops.h',
225         '<(tcmalloc_dir)/src/base/basictypes.h',
226         '<(tcmalloc_dir)/src/base/commandlineflags.h',
227         '<(tcmalloc_dir)/src/base/cycleclock.h',
228         '<(tcmalloc_dir)/src/base/elf_mem_image.h',
229         '<(tcmalloc_dir)/src/base/elfcore.h',
230         '<(tcmalloc_dir)/src/base/googleinit.h',
231         '<(tcmalloc_dir)/src/base/linux_syscall_support.h',
232         '<(tcmalloc_dir)/src/base/simple_mutex.h',
233         '<(tcmalloc_dir)/src/base/spinlock_linux-inl.h',
234         '<(tcmalloc_dir)/src/base/spinlock_posix-inl.h',
235         '<(tcmalloc_dir)/src/base/spinlock_win32-inl.h',
236         '<(tcmalloc_dir)/src/base/stl_allocator.h',
237         '<(tcmalloc_dir)/src/base/thread_annotations.h',
238         '<(tcmalloc_dir)/src/getpc.h',
239         '<(tcmalloc_dir)/src/gperftools/heap-checker.h',
240         '<(tcmalloc_dir)/src/gperftools/heap-profiler.h',
241         '<(tcmalloc_dir)/src/gperftools/malloc_extension.h',
242         '<(tcmalloc_dir)/src/gperftools/malloc_extension_c.h',
243         '<(tcmalloc_dir)/src/gperftools/malloc_hook.h',
244         '<(tcmalloc_dir)/src/gperftools/malloc_hook_c.h',
245         '<(tcmalloc_dir)/src/gperftools/profiler.h',
246         '<(tcmalloc_dir)/src/gperftools/stacktrace.h',
247         '<(tcmalloc_dir)/src/gperftools/tcmalloc.h',
248         '<(tcmalloc_dir)/src/heap-checker-bcad.cc',
249         '<(tcmalloc_dir)/src/heap-checker.cc',
250         '<(tcmalloc_dir)/src/libc_override.h',
251         '<(tcmalloc_dir)/src/libc_override_gcc_and_weak.h',
252         '<(tcmalloc_dir)/src/libc_override_glibc.h',
253         '<(tcmalloc_dir)/src/libc_override_osx.h',
254         '<(tcmalloc_dir)/src/libc_override_redefine.h',
255         '<(tcmalloc_dir)/src/malloc_hook_mmap_freebsd.h',
256         '<(tcmalloc_dir)/src/malloc_hook_mmap_linux.h',
257         '<(tcmalloc_dir)/src/memfs_malloc.cc',
258         '<(tcmalloc_dir)/src/packed-cache-inl.h',
259         '<(tcmalloc_dir)/src/page_heap_allocator.h',
260         '<(tcmalloc_dir)/src/pagemap.h',
261         '<(tcmalloc_dir)/src/stacktrace_arm-inl.h',
262         '<(tcmalloc_dir)/src/stacktrace_config.h',
263         '<(tcmalloc_dir)/src/stacktrace_generic-inl.h',
264         '<(tcmalloc_dir)/src/stacktrace_libunwind-inl.h',
265         '<(tcmalloc_dir)/src/stacktrace_powerpc-inl.h',
266         '<(tcmalloc_dir)/src/stacktrace_win32-inl.h',
267         '<(tcmalloc_dir)/src/stacktrace_with_context.cc',
268         '<(tcmalloc_dir)/src/stacktrace_x86-inl.h',
269         '<(tcmalloc_dir)/src/tcmalloc_guard.h',
270         '<(tcmalloc_dir)/src/windows/config.h',
271         '<(tcmalloc_dir)/src/windows/gperftools/tcmalloc.h',
272         '<(tcmalloc_dir)/src/windows/get_mangled_names.cc',
273         '<(tcmalloc_dir)/src/windows/ia32_modrm_map.cc',
274         '<(tcmalloc_dir)/src/windows/ia32_opcode_map.cc',
275         '<(tcmalloc_dir)/src/windows/mingw.h',
276         '<(tcmalloc_dir)/src/windows/mini_disassembler.cc',
277         '<(tcmalloc_dir)/src/windows/mini_disassembler.h',
278         '<(tcmalloc_dir)/src/windows/mini_disassembler_types.h',
279         '<(tcmalloc_dir)/src/windows/override_functions.cc',
280         '<(tcmalloc_dir)/src/windows/patch_functions.cc',
281         '<(tcmalloc_dir)/src/windows/preamble_patcher.cc',
282         '<(tcmalloc_dir)/src/windows/preamble_patcher.h',
283         '<(tcmalloc_dir)/src/windows/preamble_patcher_with_stub.cc',
284       ],
285       'dependencies': [
286         '../third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
287       ],
288       'msvs_settings': {
289         # TODO(sgk):  merge this with build/common.gypi settings
290         'VCLibrarianTool': {
291           'AdditionalOptions': ['/ignore:4006,4221'],
292         },
293         'VCLinkerTool': {
294           'AdditionalOptions': ['/ignore:4006'],
295         },
296       },
297       'configurations': {
298         'Debug_Base': {
299           'msvs_settings': {
300             'VCCLCompilerTool': {
301               'RuntimeLibrary': '0',
302             },
303           },
304           'variables': {
305             # Provide a way to force disable debugallocation in Debug builds,
306             # e.g. for profiling (it's more rare to profile Debug builds,
307             # but people sometimes need to do that).
308             'disable_debugallocation%': 0,
309           },
310           'conditions': [
311             # TODO(phajdan.jr): Also enable on Windows.
312             ['disable_debugallocation==0 and OS!="win"', {
313               'defines': [
314                 # Use debugallocation for Debug builds to catch problems early
315                 # and cleanly, http://crbug.com/30715 .
316                 'TCMALLOC_FOR_DEBUGALLOCATION',
317               ],
318             }],
319           ],
320         },
321       },
322       # Disable the heap checker in tcmalloc.
323       'defines': [
324         'NO_HEAP_CHECK',
325       ],
326       'conditions': [
327         ['OS=="linux" and clang_type_profiler==1', {
328           'dependencies': [
329             'type_profiler_tcmalloc',
330           ],
331           # It is undoing dependencies and cflags_cc for type_profiler which
332           # build/common.gypi injects into all targets.
333           'dependencies!': [
334             'type_profiler',
335           ],
336           'cflags_cc!': [
337             '-fintercept-allocation-functions',
338           ],
339         }],
340         ['OS=="win"', {
341           'defines': [
342             'PERFTOOLS_DLL_DECL=',
343           ],
344           'defines!': [
345             # tcmalloc source files unconditionally define this, remove it from
346             # the list of defines that common.gypi defines globally.
347             'NOMINMAX',
348           ],
349           'dependencies': [
350             'libcmt',
351           ],
352           'include_dirs': [
353             '<(tcmalloc_dir)/src/windows',
354           ],
355           'sources!': [
356             '<(tcmalloc_dir)/src/base/elf_mem_image.cc',
357             '<(tcmalloc_dir)/src/base/elf_mem_image.h',
358             '<(tcmalloc_dir)/src/base/linuxthreads.cc',
359             '<(tcmalloc_dir)/src/base/linuxthreads.h',
360             '<(tcmalloc_dir)/src/base/vdso_support.cc',
361             '<(tcmalloc_dir)/src/base/vdso_support.h',
362             '<(tcmalloc_dir)/src/maybe_threads.cc',
363             '<(tcmalloc_dir)/src/maybe_threads.h',
364             '<(tcmalloc_dir)/src/symbolize.h',
365             '<(tcmalloc_dir)/src/system-alloc.cc',
366             '<(tcmalloc_dir)/src/system-alloc.h',
367
368             # included by allocator_shim.cc
369             'debugallocation_shim.cc',
370
371             # cpuprofiler
372             '<(tcmalloc_dir)/src/base/thread_lister.c',
373             '<(tcmalloc_dir)/src/base/thread_lister.h',
374             '<(tcmalloc_dir)/src/profiledata.cc',
375             '<(tcmalloc_dir)/src/profiledata.h',
376             '<(tcmalloc_dir)/src/profile-handler.cc',
377             '<(tcmalloc_dir)/src/profile-handler.h',
378             '<(tcmalloc_dir)/src/profiler.cc',
379           ],
380         }],
381         ['OS=="linux" or OS=="freebsd" or OS=="solaris" or OS=="android"', {
382           'sources!': [
383             '<(tcmalloc_dir)/src/system-alloc.h',
384             '<(tcmalloc_dir)/src/windows/port.cc',
385             '<(tcmalloc_dir)/src/windows/port.h',
386
387             # TODO(willchan): Support allocator shim later on.
388             'allocator_shim.cc',
389           ],
390           # We enable all warnings by default, but upstream disables a few.
391           # Keep "-Wno-*" flags in sync with upstream by comparing against:
392           # http://code.google.com/p/google-perftools/source/browse/trunk/Makefile.am
393           'cflags': [
394             '-Wno-sign-compare',
395             '-Wno-unused-result',
396           ],
397           'cflags!': [
398             '-fvisibility=hidden',
399           ],
400           'link_settings': {
401             'ldflags': [
402               # Don't let linker rip this symbol out, otherwise the heap&cpu
403               # profilers will not initialize properly on startup.
404               '-Wl,-uIsHeapProfilerRunning,-uProfilerStart',
405               # Do the same for heap leak checker.
406               '-Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi',
407               '-Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl',
408               '-Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14UnIgnoreObjectEPKv',
409           ]},
410         }],
411         # Need to distinguish a non-SDK build for Android WebView
412         # due to differences in C include files.
413         ['OS=="android" and android_webview_build==1', {
414           'defines': ['ANDROID_NON_SDK_BUILD'],
415         }],
416         [ 'use_vtable_verify==1', {
417           'cflags': [
418             '-fvtable-verify=preinit',
419           ],
420         }],
421         ['order_profiling != 0', {
422           'target_conditions' : [
423             ['_toolset=="target"', {
424               'cflags!': [ '-finstrument-functions' ],
425             }],
426           ],
427         }],
428       ],
429     },
430     {
431       # This library is linked in to src/base.gypi:base and allocator_unittests
432       # It can't depend on either and nothing else should depend on it - all
433       # other code should use the interfaced provided by base.
434       'target_name': 'allocator_extension_thunks',
435       'type': 'static_library',
436       'sources': [
437         'allocator_extension_thunks.cc',
438         'allocator_extension_thunks.h',
439       ],
440       'toolsets': ['host', 'target'],
441       'include_dirs': [
442         '../../'
443       ],
444       'conditions': [
445         ['OS=="linux" and clang_type_profiler==1', {
446           # It is undoing dependencies and cflags_cc for type_profiler which
447           # build/common.gypi injects into all targets.
448           'dependencies!': [
449             'type_profiler',
450           ],
451           'cflags_cc!': [
452             '-fintercept-allocation-functions',
453           ],
454         }],
455       ],
456     },
457    ],
458   'conditions': [
459     ['OS=="win"', {
460       'targets': [
461         {
462           'target_name': 'libcmt',
463           'type': 'none',
464           'actions': [
465             {
466               'action_name': 'libcmt',
467               'inputs': [
468                 'prep_libc.py',
469               ],
470               'outputs': [
471                 '<(SHARED_INTERMEDIATE_DIR)/allocator/libcmt.lib',
472               ],
473               'action': [
474                 'python',
475                 'prep_libc.py',
476                 '$(VCInstallDir)lib',
477                 '<(SHARED_INTERMEDIATE_DIR)/allocator',
478                 '<(target_arch)',
479               ],
480             },
481           ],
482         },
483         {
484           'target_name': 'allocator_unittests',
485           'type': 'executable',
486           'dependencies': [
487             'allocator',
488             'allocator_extension_thunks',
489             '../../testing/gtest.gyp:gtest',
490           ],
491           'include_dirs': [
492             '.',
493             '<(tcmalloc_dir)/src/base',
494             '<(tcmalloc_dir)/src',
495             '../..',
496           ],
497           'sources': [
498             'allocator_unittest.cc',
499             '../profiler/alternate_timer.cc',
500             '../profiler/alternate_timer.h',
501           ],
502         },
503         {
504           'target_name': 'tcmalloc_unittest',
505           'type': 'executable',
506           'sources': [
507             'tcmalloc_unittest.cc',
508           ],
509           'include_dirs': [
510             '../..',
511             # For constants of TCMalloc.
512             '<(tcmalloc_dir)/src',
513           ],
514           'dependencies': [
515             '../../testing/gtest.gyp:gtest',
516             '../base.gyp:base',
517             'allocator',
518           ],
519         },
520       ],
521     }],
522     ['OS=="win" and target_arch=="ia32"', {
523       'targets': [
524         {
525           'target_name': 'allocator_extension_thunks_win64',
526           'type': 'static_library',
527           'sources': [
528             'allocator_extension_thunks.cc',
529             'allocator_extension_thunks.h',
530           ],
531           'toolsets': ['host', 'target'],
532           'include_dirs': [
533             '../../'
534           ],
535           'configurations': {
536             'Common_Base': {
537               'msvs_target_platform': 'x64',
538             },
539           },
540         },
541       ],
542     }],
543     ['OS=="linux" and clang_type_profiler==1', {
544       # Some targets in this section undo dependencies and cflags_cc for
545       # type_profiler which build/common.gypi injects into all targets.
546       'targets': [
547         {
548           'target_name': 'type_profiler',
549           'type': 'static_library',
550           'dependencies!': [
551             'type_profiler',
552           ],
553           'cflags_cc!': [
554             '-fintercept-allocation-functions',
555           ],
556           'include_dirs': [
557             '../..',
558           ],
559           'sources': [
560             'type_profiler.cc',
561             'type_profiler.h',
562             'type_profiler_control.h',
563           ],
564           'toolsets': ['host', 'target'],
565         },
566         {
567           'target_name': 'type_profiler_tcmalloc',
568           'type': 'static_library',
569           'dependencies!': [
570             'type_profiler',
571           ],
572           'cflags_cc!': [
573             '-fintercept-allocation-functions',
574           ],
575           'include_dirs': [
576             '<(tcmalloc_dir)/src',
577             '../..',
578           ],
579           'sources': [
580             'type_profiler_tcmalloc.cc',
581             'type_profiler_tcmalloc.h',
582             '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h',
583             '<(tcmalloc_dir)/src/type_profiler_map.cc',
584           ],
585         },
586         {
587           'target_name': 'type_profiler_unittests',
588           'type': 'executable',
589           'dependencies': [
590             '../../testing/gtest.gyp:gtest',
591             '../base.gyp:base',
592             'allocator',
593             'type_profiler_tcmalloc',
594           ],
595           'include_dirs': [
596             '../..',
597           ],
598           'sources': [
599             'type_profiler_control.cc',
600             'type_profiler_control.h',
601             'type_profiler_unittest.cc',
602           ],
603         },
604         {
605           'target_name': 'type_profiler_map_unittests',
606           'type': 'executable',
607           'dependencies': [
608             '../../testing/gtest.gyp:gtest',
609             '../base.gyp:base',
610             'allocator',
611           ],
612           'dependencies!': [
613             'type_profiler',
614           ],
615           'cflags_cc!': [
616             '-fintercept-allocation-functions',
617           ],
618           'include_dirs': [
619             '<(tcmalloc_dir)/src',
620             '../..',
621           ],
622           'sources': [
623             'type_profiler_map_unittest.cc',
624             '<(tcmalloc_dir)/src/gperftools/type_profiler_map.h',
625             '<(tcmalloc_dir)/src/type_profiler_map.cc',
626           ],
627         },
628       ],
629     }],
630   ],
631 }