Bumping manifests a=b2g-bump
[gecko.git] / memory / build / moz.build
blob447d02f85a42e966a438c358b2d3110f03738398
1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 EXPORTS += [
8     'mozmemory.h',
9     'mozmemory_wrap.h',
12 DEFINES['MOZ_MEMORY_IMPL'] = True
14 if CONFIG['MOZ_REPLACE_MALLOC']:
15     EXPORTS += [
16         'malloc_decls.h',
17         'replace_malloc.h',
18     ]
19     DEFINES['MOZ_REPLACE_MALLOC'] = True
21 SOURCES += [
22     'jemalloc_config.c',
23     'mozmemory_wrap.c',
26 if CONFIG['MOZ_JEMALLOC3']:
27     SOURCES += [
28         'mozjemalloc_compat.c',
29     ]
30     GENERATED_INCLUDES += ['../jemalloc/src/include']
31     if CONFIG['_MSC_VER']:
32         LOCAL_INCLUDES += ['/memory/jemalloc/src/include/msvc_compat']
34 if CONFIG['MOZ_REPLACE_MALLOC']:
35     SOURCES += [
36         'replace_malloc.c',
37     ]
39 LIBRARY_NAME = 'memory'
41 if CONFIG['MOZ_JEMALLOC3']:
42     if not CONFIG['MOZ_NATIVE_JEMALLOC']:
43         USE_LIBS += [
44             'jemalloc',
45         ]
46 else:
47     USE_LIBS += [
48         'mozjemalloc',
49     ]
51 if CONFIG['MOZ_GLUE_PROGRAM_LDFLAGS']:
52     SDK_LIBRARY = True
54 # Keep jemalloc separated when mozglue is statically linked
55 if CONFIG['MOZ_MEMORY'] and (CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') or
56                              CONFIG['MOZ_NATIVE_JEMALLOC']):
57     FINAL_LIBRARY = 'mozglue'
59 if CONFIG['MOZ_REPLACE_MALLOC'] and CONFIG['OS_TARGET'] == 'Darwin':
60     # The zone allocator for OSX needs some jemalloc internal functions
61     LOCAL_INCLUDES += ['/memory/jemalloc/src/include']
63 FAIL_ON_WARNINGS = True