Bug 1814798 - pt 2. Add a PHCManager component to control PHC r=glandium,emilio
[gecko.git] / xpcom / base / moz.build
blob1ac409ed04ece0e2c9ac5173d92771cafffbd1eb
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 += [
31         "nsObjCExceptions.h",
32     ]
33     EXPORTS.mozilla += [
34         "MacHelpers.h",
35         "MacStringHelpers.h",
36         "nsMacPreferencesReader.h",
37     ]
38     UNIFIED_SOURCES += [
39         "MacHelpers.mm",
40         "MacStringHelpers.mm",
41         "nsMacPreferencesReader.mm",
42         "nsObjCExceptions.mm",
43     ]
45 XPIDL_MODULE = "xpcom_base"
47 XPCOM_MANIFESTS += [
48     "components.conf",
51 EXPORTS += [
52     "!ErrorList.h",
53     "!ErrorNamesInternal.h",
54     "CodeAddressService.h",
55     "nsAlgorithm.h",
56     "nsAutoRef.h",
57     "nsCom.h",
58     "nsCOMPtr.h",
59     "nscore.h",
60     "nsCRTGlue.h",
61     "nsCycleCollectionNoteChild.h",
62     "nsCycleCollectionNoteRootCallback.h",
63     "nsCycleCollectionParticipant.h",
64     "nsCycleCollectionTraversalCallback.h",
65     "nsCycleCollector.h",
66     "nsDebug.h",
67     "nsDebugImpl.h",
68     "nsDumpUtils.h",
69     "nsError.h",
70     "nsGZFileWriter.h",
71     "nsIClassInfoImpl.h",
72     "nsID.h",
73     "nsIDUtils.h",
74     "nsIInterfaceRequestorUtils.h",
75     "nsINIParser.h",
76     "nsInterfaceRequestorAgg.h",
77     "nsISizeOf.h",
78     "nsISupportsImpl.h",
79     "nsISupportsUtils.h",
80     "nsIWeakReferenceUtils.h",
81     "nsMaybeWeakPtr.h",
82     "nsMemory.h",
83     "nsMemoryReporterManager.h",
84     "nsQueryObject.h",
85     "nsSystemInfo.h",
86     "nsTraceRefcnt.h",
87     "nsVersionComparator.h",
88     "nsWeakReference.h",
91 if CONFIG["OS_ARCH"] == "WINNT":
92     EXPORTS += [
93         "nsWindowsHelpers.h",
94     ]
95     if CONFIG["CC_TYPE"] not in ("gcc", "clang"):
96         OS_LIBS += [
97             "wscapi",
98         ]
100 EXPORTS.mozilla += [
101     "AppShutdown.h",
102     "AutoRestore.h",
103     "AvailableMemoryTracker.h",
104     "AvailableMemoryWatcher.h",
105     "ClearOnShutdown.h",
106     "CountingAllocatorBase.h",
107     "CycleCollectedJSContext.h",
108     "CycleCollectedJSRuntime.h",
109     "Debug.h",
110     "DebuggerOnGCRunnable.h",
111     "DeferredFinalize.h",
112     "EnumeratedArrayCycleCollection.h",
113     "ErrorNames.h",
114     "GkRustUtils.h",
115     "HoldDropJSObjects.h",
116     "IntentionalCrash.h",
117     "JSObjectHolder.h",
118     "JSONStringWriteFuncs.h",
119     "Logging.h",
120     "MemoryInfo.h",
121     "MemoryMapping.h",
122     "MemoryReportingProcess.h",
123     "MemoryTelemetry.h",
124     "nsMemoryInfoDumper.h",
125     "NSPRLogModulesParser.h",
126     "OwningNonNull.h",
127     "RLBoxSandboxPool.h",
128     "RLBoxUtils.h",
129     "ShutdownPhase.h",
130     "SizeOfState.h",
131     "StaticLocalPtr.h",
132     "StaticMonitor.h",
133     "StaticMutex.h",
134     "StaticPtr.h",
137 SOURCES += [
138     # nsDebugImpl isn't unified because we disable PGO so that NS_ABORT_OOM isn't
139     # optimized away oddly.
140     "nsDebugImpl.cpp",
141     # nsDumpUtils.cpp includes SpecialSystemDirectory.h which includes
142     # nsLocalFileMac.h which upsets other files in this dir that have a different
143     # idea about what `TextRange` means.
144     "nsDumpUtils.cpp",
146 SOURCES["nsDebugImpl.cpp"].no_pgo = True
148 UNIFIED_SOURCES += [
149     "AppShutdown.cpp",
150     "AvailableMemoryTracker.cpp",
151     "AvailableMemoryWatcher.cpp",
152     "ClearOnShutdown.cpp",
153     "CycleCollectedJSContext.cpp",
154     "CycleCollectedJSRuntime.cpp",
155     "Debug.cpp",
156     "DebuggerOnGCRunnable.cpp",
157     "DeferredFinalize.cpp",
158     "ErrorNames.cpp",
159     "GkRustUtils.cpp",
160     "HoldDropJSObjects.cpp",
161     "JSObjectHolder.cpp",
162     "LogCommandLineHandler.cpp",
163     "Logging.cpp",
164     "LogModulePrefWatcher.cpp",
165     "MemoryTelemetry.cpp",
166     "nsClassInfoImpl.cpp",
167     "nsCOMPtr.cpp",
168     "nsConsoleMessage.cpp",
169     "nsConsoleService.cpp",
170     "nsCRTGlue.cpp",
171     "nsCycleCollectionParticipant.cpp",
172     "nsCycleCollector.cpp",
173     "nsCycleCollectorTraceJSHelpers.cpp",
174     "nsGZFileWriter.cpp",
175     "nsID.cpp",
176     "nsIInterfaceRequestorUtils.cpp",
177     "nsINIParser.cpp",
178     "nsInterfaceRequestorAgg.cpp",
179     "nsISupportsImpl.cpp",
180     "nsMemoryImpl.cpp",
181     "nsMemoryInfoDumper.cpp",
182     "nsMemoryReporterManager.cpp",
183     "NSPRLogModulesParser.cpp",
184     "nsSecurityConsoleMessage.cpp",
185     "nsSystemInfo.cpp",
186     "nsTraceRefcnt.cpp",
187     "nsUUIDGenerator.cpp",
188     "nsVersionComparator.cpp",
189     "nsVersionComparatorImpl.cpp",
190     "nsWeakReference.cpp",
191     "RLBoxSandboxPool.cpp",
194 if CONFIG["OS_TARGET"] in ("Linux", "Android"):
195     UNIFIED_SOURCES += [
196         "MemoryMapping.cpp",
197     ]
199 if CONFIG["OS_TARGET"] == "WINNT":
200     UNIFIED_SOURCES += [
201         "AvailableMemoryWatcherWin.cpp",
202         "MemoryInfo.cpp",
203     ]
205 if CONFIG["OS_TARGET"] == "Darwin":
206     UNIFIED_SOURCES += [
207         "AvailableMemoryWatcherMac.cpp",
208     ]
209     EXPORTS.mozilla += [
210         "MemoryPressureLevelMac.h",
211     ]
213 if CONFIG["OS_TARGET"] == "Linux":
214     UNIFIED_SOURCES += [
215         "AvailableMemoryWatcherLinux.cpp",
216     ]
217     EXPORTS.mozilla += [
218         "AvailableMemoryWatcherUtils.h",
219     ]
221 if CONFIG["MOZ_PHC"]:
222     DEFINES["MOZ_PHC"] = True
224 GeneratedFile("ErrorList.h", script="ErrorList.py", entry_point="error_list_h")
225 GeneratedFile(
226     "ErrorNamesInternal.h", script="ErrorList.py", entry_point="error_names_internal_h"
228 GeneratedFile("error_list.rs", script="ErrorList.py", entry_point="error_list_rs")
230 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
231     SOURCES += [
232         "nsMacUtilsImpl.cpp",
233     ]
234 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
235     SOURCES += [
236         "nsCrashOnException.cpp",
237     ]
239 if CONFIG["COMPILE_ENVIRONMENT"]:
240     EXPORTS.mozilla += [
241         "!gk_rust_utils_ffi_generated.h",
242     ]
244     CbindgenHeader("gk_rust_utils_ffi_generated.h", inputs=["/xpcom/rust/gkrust_utils"])
246 include("/ipc/chromium/chromium-config.mozbuild")
248 FINAL_LIBRARY = "xul"
250 LOCAL_INCLUDES += [
251     "../build",
252     "/dom/base",
253     "/mfbt",
254     "/netwerk/base",
255     "/xpcom/ds",
258 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
259     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
261 if CONFIG["MOZ_PHC"]:
262     EXPORTS.mozilla += [
263         "PHCManager.h",
264     ]
266     DEFINES["MOZ_PHC"] = 1
268     UNIFIED_SOURCES += ["PHCManager.cpp"]
270 with Files("PHCManager.*"):
271     BUG_COMPONENT = ("Core", "Memory Allocator")