|
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/. |
|
6 NO_VISIBILITY_FLAGS = True |
|
7 |
|
8 EXPORTS.mozilla += [ |
|
9 'fallible.h', |
|
10 'mozalloc.h', |
|
11 'mozalloc_abort.h', |
|
12 'mozalloc_oom.h', |
|
13 'VolatileBuffer.h', |
|
14 ] |
|
15 |
|
16 if CONFIG['MOZ_MSVC_STL_WRAP__RAISE'] or CONFIG['MOZ_MSVC_STL_WRAP__Throw']: |
|
17 build_msvc_wrappers = 1 |
|
18 else: |
|
19 build_msvc_wrappers = 0 |
|
20 |
|
21 if CONFIG['WRAP_STL_INCLUDES']: |
|
22 if CONFIG['GNU_CXX']: |
|
23 EXPORTS.mozilla += ['throw_gcc.h'] |
|
24 elif CONFIG['_MSC_VER']: |
|
25 DEFINES['_HAS_EXCEPTIONS'] = 0 |
|
26 if build_msvc_wrappers: |
|
27 EXPORTS.mozilla += [ |
|
28 'msvc_raise_wrappers.h', |
|
29 'msvc_throw_wrapper.h', |
|
30 'throw_msvc.h', |
|
31 ] |
|
32 SOURCES += [ |
|
33 'msvc_raise_wrappers.cpp', |
|
34 'msvc_throw_wrapper.cpp', |
|
35 ] |
|
36 |
|
37 UNIFIED_SOURCES += [ |
|
38 'mozalloc.cpp', |
|
39 'mozalloc_abort.cpp', |
|
40 'mozalloc_oom.cpp', |
|
41 ] |
|
42 |
|
43 if CONFIG['OS_TARGET'] == 'Android': |
|
44 UNIFIED_SOURCES += [ |
|
45 'VolatileBufferAshmem.cpp', |
|
46 ] |
|
47 elif CONFIG['OS_TARGET'] == 'Darwin': |
|
48 UNIFIED_SOURCES += [ |
|
49 'VolatileBufferOSX.cpp', |
|
50 ] |
|
51 elif CONFIG['OS_TARGET'] == 'WINNT': |
|
52 UNIFIED_SOURCES += [ |
|
53 'VolatileBufferWindows.cpp', |
|
54 ] |
|
55 else: |
|
56 UNIFIED_SOURCES += [ |
|
57 'VolatileBufferFallback.cpp', |
|
58 ] |
|
59 |
|
60 LIBRARY_NAME = 'mozalloc' |
|
61 |
|
62 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': |
|
63 FORCE_STATIC_LIB = True |
|
64 else: |
|
65 FORCE_SHARED_LIB = True |
|
66 |
|
67 # The strndup declaration in string.h is in an ifdef __USE_GNU section |
|
68 DEFINES['_GNU_SOURCE'] = True |
|
69 |
|
70 TEST_TOOL_DIRS += ['tests'] |
|
71 |
|
72 GENERATED_INCLUDES += ['/xpcom'] |
|
73 |
|
74 DISABLE_STL_WRAPPING = True |