moz.build (1946B)
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 7 EXPORTS += [ 8 "malloc_decls.h", 9 "mozjemalloc_profiling.h", 10 "mozjemalloc_types.h", 11 "mozmemory.h", 12 "mozmemory_stall.h", 13 "mozmemory_wrap.h", 14 "PHC.h", 15 ] 16 17 LIBRARY_DEFINES["MOZ_HAS_MOZGLUE"] = True 18 DEFINES["MOZ_MEMORY_IMPL"] = True 19 DEFINES["MOZ_SUPPORT_LEAKCHECKING"] = True 20 DEFINES["NON_RANDOM_ARENA_IDS"] = True 21 22 if CONFIG["MOZ_BUILD_APP"] == "memory": 23 DEFINES["IMPL_MFBT"] = True 24 25 if CONFIG["MOZ_REPLACE_MALLOC"]: 26 EXPORTS += [ 27 "replace_malloc.h", 28 "replace_malloc_bridge.h", 29 ] 30 31 if CONFIG["MOZ_PHC"]: 32 DEFINES["MOZ_PHC"] = True 33 UNIFIED_SOURCES += [ 34 "FdPrintf.cpp", 35 # PHC.cpp is #included in mozjemalloc.cpp 36 ] 37 38 if CONFIG["MOZ_MEMORY"]: 39 UNIFIED_SOURCES += [ 40 "BaseAlloc.cpp", 41 "Chunk.cpp", 42 "Globals.cpp", 43 "mozjemalloc.cpp", 44 "mozmemory_wrap.cpp", 45 "Mutex.cpp", 46 "Utils.cpp", 47 ] 48 else: 49 UNIFIED_SOURCES += [ 50 "Fallback.cpp", 51 ] 52 53 if CONFIG["OS_TARGET"] == "Darwin" and ( 54 CONFIG["MOZ_REPLACE_MALLOC"] or CONFIG["MOZ_MEMORY"] 55 ): 56 SOURCES += [ 57 "Zone.c", 58 ] 59 60 Library("memory") 61 62 if CONFIG["OS_TARGET"] == "Android" and CONFIG["CC_TYPE"] == "clang": 63 CXXFLAGS += [ 64 "-Wno-tautological-pointer-compare", 65 ] 66 67 if CONFIG["MOZ_BUILD_APP"] != "memory": 68 FINAL_LIBRARY = "mozglue" 69 70 if CONFIG["MOZ_REPLACE_MALLOC_STATIC"]: 71 DEFINES["MOZ_REPLACE_MALLOC_STATIC"] = True 72 73 DisableStlWrapping() 74 75 if CONFIG["CC_TYPE"] == "clang-cl": 76 AllowCompilerWarnings() # workaround for bug 1090497 77 78 TEST_DIRS += ["test"] 79 80 if CONFIG["NIGHTLY_BUILD"]: 81 DEFINES["MOZJEMALLOC_PROFILING_CALLBACKS"] = True