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