Bug 1851451 [wpt PR 41799] - Update wpt metadata, a=testonly
[gecko.git] / memory / mozalloc / moz.build
blobc5cd78460792a687a504b691dcf653b98f47b228
1 # -*- Mode: python; 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 NoVisibilityFlags()
8 EXPORTS.mozilla += [
9     "cxxalloc.h",
10     "mozalloc.h",
11     "mozalloc_abort.h",
12     "mozalloc_oom.h",
15 if CONFIG["WRAP_STL_INCLUDES"]:
16     if CONFIG["CC_TYPE"] in ("clang", "gcc"):
17         EXPORTS.mozilla += ["throw_gcc.h"]
18     elif CONFIG["CC_TYPE"] == "clang-cl":
19         DEFINES["_HAS_EXCEPTIONS"] = 0
20         SOURCES += [
21             "msvc_raise_wrappers.cpp",
22         ]
24 if CONFIG["OS_TARGET"] == "WINNT":
25     # Don't build winheap.cpp when mozglue is a static library.
26     if CONFIG["MOZ_MEMORY"] or not CONFIG["JS_STANDALONE"]:
27         # Keep this file separate to avoid #include'ing windows.h everywhere.
28         SOURCES += [
29             "winheap.cpp",
30         ]
32 UNIFIED_SOURCES += [
33     "mozalloc.cpp",
34     "mozalloc_abort.cpp",
35     "mozalloc_oom.cpp",
38 if CONFIG["MOZ_MEMORY"]:
39     # In MinGW, we don't want to actually export these functions out of the library
40     # as the functions in libc++ correctly forward to jemalloc and exporting them
41     # produces duplicate symbol errors.
42     if not (CONFIG["CC_TYPE"] == "clang" and CONFIG["OS_TARGET"] == "WINNT"):
43         SOURCES += [
44             "cxxalloc.cpp",
45         ]
47 FINAL_LIBRARY = "mozglue"
49 # The strndup declaration in string.h is in an ifdef __USE_GNU section
50 DEFINES["_GNU_SOURCE"] = True
52 DisableStlWrapping()
54 LOCAL_INCLUDES += [
55     "!/xpcom",
56     "/memory/build",
59 DIST_INSTALL = True