Bug 1874684 - Part 17: Fix uninitialised variable warnings from clang-tidy. r=allstarschh
[gecko.git] / xpcom / base / moz.build
blobb7779a67db41f3d80b8e40759ba4a124d80d1864
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 XPIDL_SOURCES += [
8     "nsIAvailableMemoryWatcherBase.idl",
9     "nsIConsoleListener.idl",
10     "nsIConsoleMessage.idl",
11     "nsIConsoleService.idl",
12     "nsICycleCollectorListener.idl",
13     "nsIDebug2.idl",
14     "nsIException.idl",
15     "nsIInterfaceRequestor.idl",
16     "nsIMemoryInfoDumper.idl",
17     "nsIMemoryReporter.idl",
18     "nsISecurityConsoleMessage.idl",
19     "nsISupports.idl",
20     "nsIUUIDGenerator.idl",
21     "nsIVersionComparator.idl",
22     "nsIWeakReference.idl",
23     "nsrootidl.idl",
26 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
27     XPIDL_SOURCES += [
28         "nsIMacPreferencesReader.idl",
29     ]
30     EXPORTS.mozilla += [
31         "MacHelpers.h",
32         "nsMacPreferencesReader.h",
33     ]
34     UNIFIED_SOURCES += [
35         "MacHelpers.mm",
36         "nsMacPreferencesReader.mm",
37     ]
38 if CONFIG["OS_ARCH"] == "Darwin":
39     EXPORTS += [
40         "CFTypeRefPtr.h",
41         "nsObjCExceptions.h",
42     ]
43     EXPORTS.mozilla += [
44         "DarwinObjectPtr.h",
45         "MacStringHelpers.h",
46     ]
47     UNIFIED_SOURCES += [
48         "MacStringHelpers.mm",
49         "nsObjCExceptions.mm",
50     ]
52 XPIDL_MODULE = "xpcom_base"
54 XPCOM_MANIFESTS += [
55     "components.conf",
58 EXPORTS += [
59     "!ErrorList.h",
60     "!ErrorNamesInternal.h",
61     "CodeAddressService.h",
62     "nsAlgorithm.h",
63     "nsAutoRef.h",
64     "nsCom.h",
65     "nsCOMPtr.h",
66     "nscore.h",
67     "nsCRTGlue.h",
68     "nsCycleCollectionNoteChild.h",
69     "nsCycleCollectionNoteRootCallback.h",
70     "nsCycleCollectionParticipant.h",
71     "nsCycleCollectionTraversalCallback.h",
72     "nsCycleCollector.h",
73     "nsDebug.h",
74     "nsDebugImpl.h",
75     "nsDumpUtils.h",
76     "nsError.h",
77     "nsGZFileWriter.h",
78     "nsIClassInfoImpl.h",
79     "nsID.h",
80     "nsIDUtils.h",
81     "nsIInterfaceRequestorUtils.h",
82     "nsINIParser.h",
83     "nsInterfaceRequestorAgg.h",
84     "nsISizeOf.h",
85     "nsISupportsImpl.h",
86     "nsISupportsUtils.h",
87     "nsIWeakReferenceUtils.h",
88     "nsMaybeWeakPtr.h",
89     "nsMemory.h",
90     "nsMemoryReporterManager.h",
91     "nsQueryObject.h",
92     "nsSystemInfo.h",
93     "nsTraceRefcnt.h",
94     "nsVersionComparator.h",
95     "nsWeakReference.h",
98 if CONFIG["OS_ARCH"] == "WINNT":
99     EXPORTS += [
100         "nsWindowsHelpers.h",
101     ]
102     if CONFIG["CC_TYPE"] not in ("gcc", "clang"):
103         OS_LIBS += [
104             "wscapi",
105         ]
107 EXPORTS.mozilla += [
108     "AppShutdown.h",
109     "AutoRestore.h",
110     "AvailableMemoryTracker.h",
111     "AvailableMemoryWatcher.h",
112     "ClearOnShutdown.h",
113     "CountingAllocatorBase.h",
114     "CycleCollectedJSContext.h",
115     "CycleCollectedJSRuntime.h",
116     "Debug.h",
117     "DebuggerOnGCRunnable.h",
118     "DeferredFinalize.h",
119     "EnumeratedArrayCycleCollection.h",
120     "ErrorNames.h",
121     "GkRustUtils.h",
122     "HoldDropJSObjects.h",
123     "IntentionalCrash.h",
124     "JSObjectHolder.h",
125     "JSONStringWriteFuncs.h",
126     "Logging.h",
127     "MemoryInfo.h",
128     "MemoryMapping.h",
129     "MemoryReportingProcess.h",
130     "MemoryTelemetry.h",
131     "nsMemoryInfoDumper.h",
132     "NSPRLogModulesParser.h",
133     "OwningNonNull.h",
134     "RLBoxSandboxPool.h",
135     "RLBoxUtils.h",
136     "ShutdownPhase.h",
137     "SizeOfState.h",
138     "StaticLocalPtr.h",
139     "StaticMonitor.h",
140     "StaticMutex.h",
141     "StaticPtr.h",
144 SOURCES += [
145     # nsDebugImpl isn't unified because we disable PGO so that NS_ABORT_OOM isn't
146     # optimized away oddly.
147     "nsDebugImpl.cpp",
148     # nsDumpUtils.cpp includes SpecialSystemDirectory.h which includes
149     # nsLocalFileMac.h which upsets other files in this dir that have a different
150     # idea about what `TextRange` means.
151     "nsDumpUtils.cpp",
153 SOURCES["nsDebugImpl.cpp"].no_pgo = True
155 UNIFIED_SOURCES += [
156     "AppShutdown.cpp",
157     "AvailableMemoryTracker.cpp",
158     "AvailableMemoryWatcher.cpp",
159     "ClearOnShutdown.cpp",
160     "CycleCollectedJSContext.cpp",
161     "CycleCollectedJSRuntime.cpp",
162     "Debug.cpp",
163     "DebuggerOnGCRunnable.cpp",
164     "DeferredFinalize.cpp",
165     "ErrorNames.cpp",
166     "GkRustUtils.cpp",
167     "HoldDropJSObjects.cpp",
168     "JSObjectHolder.cpp",
169     "LogCommandLineHandler.cpp",
170     "Logging.cpp",
171     "LogModulePrefWatcher.cpp",
172     "MemoryTelemetry.cpp",
173     "nsClassInfoImpl.cpp",
174     "nsCOMPtr.cpp",
175     "nsConsoleMessage.cpp",
176     "nsConsoleService.cpp",
177     "nsCRTGlue.cpp",
178     "nsCycleCollectionParticipant.cpp",
179     "nsCycleCollector.cpp",
180     "nsCycleCollectorTraceJSHelpers.cpp",
181     "nsGZFileWriter.cpp",
182     "nsID.cpp",
183     "nsIInterfaceRequestorUtils.cpp",
184     "nsINIParser.cpp",
185     "nsInterfaceRequestorAgg.cpp",
186     "nsISupportsImpl.cpp",
187     "nsMemoryImpl.cpp",
188     "nsMemoryInfoDumper.cpp",
189     "nsMemoryReporterManager.cpp",
190     "NSPRLogModulesParser.cpp",
191     "nsSecurityConsoleMessage.cpp",
192     "nsSystemInfo.cpp",
193     "nsTraceRefcnt.cpp",
194     "nsUUIDGenerator.cpp",
195     "nsVersionComparator.cpp",
196     "nsVersionComparatorImpl.cpp",
197     "nsWeakReference.cpp",
198     "RLBoxSandboxPool.cpp",
201 if CONFIG["OS_TARGET"] in ("Linux", "Android"):
202     UNIFIED_SOURCES += [
203         "MemoryMapping.cpp",
204     ]
206 if CONFIG["OS_TARGET"] == "WINNT":
207     UNIFIED_SOURCES += [
208         "AvailableMemoryWatcherWin.cpp",
209         "MemoryInfo.cpp",
210     ]
212 if CONFIG["OS_TARGET"] == "Darwin":
213     UNIFIED_SOURCES += [
214         "AvailableMemoryWatcherMac.cpp",
215     ]
216     EXPORTS.mozilla += [
217         "MemoryPressureLevelMac.h",
218     ]
220 if CONFIG["OS_TARGET"] == "Linux":
221     UNIFIED_SOURCES += [
222         "AvailableMemoryWatcherLinux.cpp",
223     ]
224     EXPORTS.mozilla += [
225         "AvailableMemoryWatcherUtils.h",
226     ]
228 if CONFIG["MOZ_PHC"]:
229     DEFINES["MOZ_PHC"] = True
231 GeneratedFile("ErrorList.h", script="ErrorList.py", entry_point="error_list_h")
232 GeneratedFile(
233     "ErrorNamesInternal.h", script="ErrorList.py", entry_point="error_names_internal_h"
235 GeneratedFile("error_list.rs", script="ErrorList.py", entry_point="error_list_rs")
237 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
238     SOURCES += [
239         "nsMacUtilsImpl.cpp",
240     ]
241 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
242     SOURCES += [
243         "nsCrashOnException.cpp",
244     ]
246 if CONFIG["COMPILE_ENVIRONMENT"]:
247     EXPORTS.mozilla += [
248         "!gk_rust_utils_ffi_generated.h",
249     ]
251     CbindgenHeader("gk_rust_utils_ffi_generated.h", inputs=["/xpcom/rust/gkrust_utils"])
253 include("/ipc/chromium/chromium-config.mozbuild")
255 FINAL_LIBRARY = "xul"
257 LOCAL_INCLUDES += [
258     "../build",
259     "/dom/base",
260     "/mfbt",
261     "/netwerk/base",
262     "/xpcom/ds",
265 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
266     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
268 if CONFIG["MOZ_PHC"]:
269     EXPORTS.mozilla += [
270         "PHCManager.h",
271     ]
273     DEFINES["MOZ_PHC"] = 1
275     UNIFIED_SOURCES += ["PHCManager.cpp"]
277 with Files("PHCManager.*"):
278     BUG_COMPONENT = ("Core", "Memory Allocator")