Bug 1845355 - Add some asserts to detect causes of a crash r=glandium
[gecko.git] / mfbt / moz.build
blob5f8c0925a54527a341bfc6e739a8ada68ac24c42
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/.
7 with Files("**"):
8     BUG_COMPONENT = ("Core", "MFBT")
10 Library("mfbt")
12 EXPORTS += [
13     "../third_party/rust/encoding_c_mem/include/encoding_rs_mem.h",
16 EXPORTS.mozilla = [
17     "Algorithm.h",
18     "Alignment.h",
19     "AllocPolicy.h",
20     "AlreadyAddRefed.h",
21     "Array.h",
22     "ArrayUtils.h",
23     "Assertions.h",
24     "AtomicBitfields.h",
25     "Atomics.h",
26     "Attributes.h",
27     "BinarySearch.h",
28     "BitSet.h",
29     "BloomFilter.h",
30     "Buffer.h",
31     "BufferList.h",
32     "Casting.h",
33     "ChaosMode.h",
34     "Char16.h",
35     "CheckedInt.h",
36     "CompactPair.h",
37     "Compiler.h",
38     "Compression.h",
39     "DbgMacro.h",
40     "DebugOnly.h",
41     "DefineEnum.h",
42     "DoublyLinkedList.h",
43     "EndianUtils.h",
44     "EnumeratedArray.h",
45     "EnumeratedRange.h",
46     "EnumSet.h",
47     "EnumTypeTraits.h",
48     "fallible.h",
49     "FastBernoulliTrial.h",
50     "FloatingPoint.h",
51     "FStream.h",
52     "FunctionRef.h",
53     "FunctionTypeTraits.h",
54     "Fuzzing.h",
55     "HashFunctions.h",
56     "HashTable.h",
57     "HelperMacros.h",
58     "InitializedOnce.h",
59     "IntegerRange.h",
60     "IntegerTypeTraits.h",
61     "JSONWriter.h",
62     "JsRust.h",
63     "Latin1.h",
64     "Likely.h",
65     "LinkedList.h",
66     "MacroArgs.h",
67     "MacroForEach.h",
68     "MathAlgorithms.h",
69     "Maybe.h",
70     "MaybeOneOf.h",
71     "MaybeStorageBase.h",
72     "MemoryChecking.h",
73     "MemoryReporting.h",
74     "MoveOnlyFunction.h",
75     "MruCache.h",
76     "NonDereferenceable.h",
77     "NotNull.h",
78     "Opaque.h",
79     "OperatorNewExtensions.h",
80     "PairHash.h",
81     "Path.h",
82     "PodOperations.h",
83     "Poison.h",
84     "RandomNum.h",
85     "Range.h",
86     "RangedArray.h",
87     "RangedPtr.h",
88     "ReentrancyGuard.h",
89     "RefCounted.h",
90     "RefCountType.h",
91     "RefPtr.h",
92     "Result.h",
93     "ResultExtensions.h",
94     "ResultVariant.h",
95     "ReverseIterator.h",
96     "RollingMean.h",
97     "Saturate.h",
98     "Scoped.h",
99     "ScopeExit.h",
100     "SegmentedVector.h",
101     "SHA1.h",
102     "SharedLibrary.h",
103     "SmallPointerArray.h",
104     "Span.h",
105     "SplayTree.h",
106     "SPSCQueue.h",
107     "StaticAnalysisFunctions.h",
108     "TaggedAnonymousMemory.h",
109     "Tainting.h",
110     "TemplateLib.h",
111     "TextUtils.h",
112     "ThreadLocal.h",
113     "ThreadSafety.h",
114     "ThreadSafeWeakPtr.h",
115     "ToString.h",
116     "TypedEnumBits.h",
117     "Types.h",
118     "UniquePtr.h",
119     "UniquePtrExtensions.h",
120     "Unused.h",
121     "Utf8.h",
122     "Variant.h",
123     "Vector.h",
124     "WeakPtr.h",
125     "WrappingOperations.h",
126     "XorShift128PlusRNG.h",
129 EXPORTS["double-conversion"] = [
130     "double-conversion/double-conversion/double-conversion.h",
131     "double-conversion/double-conversion/double-to-string.h",
132     "double-conversion/double-conversion/string-to-double.h",
133     "double-conversion/double-conversion/utils.h",
136 EXPORTS.function2 += [
137     "/third_party/function2/include/function2/function2.hpp",
140 LOCAL_INCLUDES += [
141     "/mfbt/double-conversion",
144 if CONFIG["OS_ARCH"] == "WINNT":
145     EXPORTS.mozilla += [
146         "WindowsVersion.h",
147     ]
149 if CONFIG["OS_ARCH"] == "WASI":
150     EXPORTS.mozilla += [
151         "WasiAtomic.h",
152     ]
154 if CONFIG["MOZ_TSAN"]:
155     EXPORTS.mozilla += [
156         "TsanOptions.h",
157     ]
159 UNIFIED_SOURCES += [
160     "Assertions.cpp",
161     "ChaosMode.cpp",
162     "Compression.cpp",
163     "double-conversion/double-conversion/bignum-dtoa.cc",
164     "double-conversion/double-conversion/bignum.cc",
165     "double-conversion/double-conversion/cached-powers.cc",
166     "double-conversion/double-conversion/double-to-string.cc",
167     "double-conversion/double-conversion/fast-dtoa.cc",
168     "double-conversion/double-conversion/fixed-dtoa.cc",
169     "double-conversion/double-conversion/string-to-double.cc",
170     "double-conversion/double-conversion/strtod.cc",
171     "FloatingPoint.cpp",
172     "HashFunctions.cpp",
173     "JSONWriter.cpp",
174     "Poison.cpp",
175     "RandomNum.cpp",
176     "SHA1.cpp",
177     "TaggedAnonymousMemory.cpp",
178     "UniquePtrExtensions.cpp",
179     "Unused.cpp",
180     "Utf8.cpp",
183 if CONFIG["MOZ_BUILD_APP"] not in (
184     "memory",
185     "tools/update-programs",
187     # Building MFBT tests adds a large overhead when building.
188     TEST_DIRS += ["tests"]
190 DEFINES["IMPL_MFBT"] = True
192 SOURCES += [
193     "lz4/lz4.c",
194     "lz4/lz4file.c",
195     "lz4/lz4frame.c",
196     "lz4/lz4hc.c",
197     "lz4/xxhash.c",
200 SOURCES["lz4/xxhash.c"].flags += ["-Wno-unused-function"]
202 DisableStlWrapping()
204 if CONFIG["MOZ_NEEDS_LIBATOMIC"]:
205     OS_LIBS += ["atomic"]
207 DEFINES["LZ4LIB_VISIBILITY"] = ""
209 # This is kind of gross because this is not a subdirectory,
210 # but pure_virtual requires mfbt to build and some projects
211 # don't use mfbt.
212 DIRS += ["../build/pure_virtual"]