Bug 1834537 - Part 6: Simplify GCRuntime::checkAllocatorState a little r=sfink
[gecko.git] / ipc / glue / moz.build
blob3651a9794e8288f8e57065dc2985eb651e2cd1ce
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 include("/dom/media/webrtc/third_party_build/webrtc.mozbuild")
8 EXPORTS += [
9     "nsIIPCSerializableInputStream.h",
12 EXPORTS.mozilla.ipc += [
13     "AsyncBlockers.h",
14     "BackgroundChild.h",
15     "BackgroundParent.h",
16     "BackgroundStarterChild.h",
17     "BackgroundStarterParent.h",
18     "BackgroundUtils.h",
19     "BigBuffer.h",
20     "BrowserProcessSubThread.h",
21     "ByteBuf.h",
22     "ByteBufUtils.h",
23     "CrashReporterClient.h",
24     "CrashReporterHelper.h",
25     "CrashReporterHost.h",
26     "CrossProcessMutex.h",
27     "CrossProcessSemaphore.h",
28     "DataPipe.h",
29     "Endpoint.h",
30     "EnvironmentMap.h",
31     "FileDescriptor.h",
32     "FileDescriptorUtils.h",
33     "GeckoChildProcessHost.h",
34     "IdleSchedulerChild.h",
35     "IdleSchedulerParent.h",
36     "InputStreamUtils.h",
37     "IOThreadChild.h",
38     "IPCCore.h",
39     "IPCForwards.h",
40     "IPCStreamUtils.h",
41     "IPCTypes.h",
42     "IPDLParamTraits.h",
43     "IPDLStructMember.h",
44     "LaunchError.h",
45     "LibrarySandboxPreload.h",
46     "MessageChannel.h",
47     "MessageLink.h",
48     "MessagePump.h",
49     "Neutering.h",
50     "NodeChannel.h",
51     "NodeController.h",
52     "ProcessChild.h",
53     "ProcessUtils.h",
54     "ProtocolMessageUtils.h",
55     "ProtocolUtils.h",
56     "RandomAccessStreamUtils.h",
57     "RawShmem.h",
58     "ScopedPort.h",
59     "SerializedStructuredCloneBuffer.h",
60     "SharedMemory.h",
61     "SharedMemoryBasic.h",
62     "Shmem.h",
63     "ShmemMessageUtils.h",
64     "SideVariant.h",
65     "TaintingIPCUtils.h",
66     "TaskFactory.h",
67     "ToplevelActorHolder.h",
68     "TransportSecurityInfoUtils.h",
69     "URIUtils.h",
70     "UtilityAudioDecoder.h",
71     "UtilityAudioDecoderChild.h",
72     "UtilityAudioDecoderParent.h",
73     "UtilityProcessChild.h",
74     "UtilityProcessHost.h",
75     "UtilityProcessImpl.h",
76     "UtilityProcessManager.h",
77     "UtilityProcessParent.h",
78     "UtilityProcessSandboxing.h",
79     "WindowsMessageLoop.h",
82 if CONFIG["OS_ARCH"] == "WINNT":
83     SOURCES += [
84         "SharedMemory_windows.cpp",
85         "WindowsMessageLoop.cpp",
86     ]
87 else:
88     UNIFIED_SOURCES += [
89         "SharedMemory_posix.cpp",
90     ]
92 if CONFIG["OS_ARCH"] == "WINNT":
93     SOURCES += [
94         "CrossProcessMutex_windows.cpp",
95     ]
96 elif not CONFIG["OS_ARCH"] in ("NetBSD", "OpenBSD"):
97     UNIFIED_SOURCES += [
98         "CrossProcessMutex_posix.cpp",
99     ]
100 else:
101     UNIFIED_SOURCES += [
102         "CrossProcessMutex_unimplemented.cpp",
103     ]
105 if CONFIG["OS_ARCH"] == "WINNT":
106     SOURCES += [
107         "CrossProcessSemaphore_windows.cpp",
108     ]
109 elif CONFIG["OS_ARCH"] != "Darwin":
110     UNIFIED_SOURCES += [
111         "CrossProcessSemaphore_posix.cpp",
112     ]
113 else:
114     UNIFIED_SOURCES += [
115         "CrossProcessSemaphore_unimplemented.cpp",
116     ]
118 # Android has its own,
119 # almost-but-not-quite-compatible-with-POSIX-or-/dev/shm shared memory
120 # impl.
121 if CONFIG["OS_TARGET"] == "Android":
122     EXPORTS.mozilla.ipc += ["SharedMemoryBasic_android.h"]
123     UNIFIED_SOURCES += [
124         "SharedMemoryBasic_android.cpp",
125     ]
126 elif CONFIG["OS_ARCH"] == "Darwin":
127     EXPORTS.mozilla.ipc += ["SharedMemoryBasic_mach.h"]
128     SOURCES += [
129         "SharedMemoryBasic_mach.mm",
130     ]
131 else:
132     EXPORTS.mozilla.ipc += ["SharedMemoryBasic_chromium.h"]
134 if CONFIG["OS_ARCH"] == "Linux":
135     UNIFIED_SOURCES += [
136         "ProcessUtils_linux.cpp",
137     ]
138 elif CONFIG["OS_ARCH"] in ("DragonFly", "FreeBSD", "NetBSD", "OpenBSD"):
139     UNIFIED_SOURCES += ["ProcessUtils_bsd.cpp"]
140 elif CONFIG["OS_ARCH"] == "Darwin":
141     UNIFIED_SOURCES += ["ProcessUtils_mac.mm"]
142 else:
143     UNIFIED_SOURCES += [
144         "ProcessUtils_none.cpp",
145     ]
147 if CONFIG["OS_ARCH"] != "WINNT":
148     EXPORTS.mozilla.ipc += [
149         "FileDescriptorShuffle.h",
150     ]
151     UNIFIED_SOURCES += [
152         "FileDescriptorShuffle.cpp",
153     ]
155 EXPORTS.ipc += [
156     "EnumSerializer.h",
157     "IPCMessageUtils.h",
158     "IPCMessageUtilsSpecializations.h",
161 UNIFIED_SOURCES += [
162     "BackgroundImpl.cpp",
163     "BackgroundUtils.cpp",
164     "BigBuffer.cpp",
165     "BrowserProcessSubThread.cpp",
166     "CrashReporterClient.cpp",
167     "CrashReporterHost.cpp",
168     "DataPipe.cpp",
169     "Endpoint.cpp",
170     "FileDescriptor.cpp",
171     "FileDescriptorUtils.cpp",
172     "IdleSchedulerChild.cpp",
173     "IdleSchedulerParent.cpp",
174     "InputStreamUtils.cpp",
175     "IPCMessageUtilsSpecializations.cpp",
176     "IPCStreamUtils.cpp",
177     "LaunchError.cpp",
178     "LibrarySandboxPreload.cpp",
179     "MessageChannel.cpp",
180     "MessageLink.cpp",
181     "MessagePump.cpp",
182     "NodeChannel.cpp",
183     "NodeController.cpp",
184     "ProcessChild.cpp",
185     "ProcessUtils_common.cpp",
186     "ProtocolUtils.cpp",
187     "RandomAccessStreamUtils.cpp",
188     "RawShmem.cpp",
189     "ScopedPort.cpp",
190     "SerializedStructuredCloneBuffer.cpp",
191     "SharedMemory.cpp",
192     "Shmem.cpp",
193     "StringUtil.cpp",
194     "TransportSecurityInfoUtils.cpp",
195     "URIUtils.cpp",
196     "UtilityAudioDecoder.cpp",
197     "UtilityAudioDecoderChild.cpp",
198     "UtilityAudioDecoderParent.cpp",
199     "UtilityProcessChild.cpp",
200     "UtilityProcessHost.cpp",
201     "UtilityProcessImpl.cpp",
202     "UtilityProcessManager.cpp",
203     "UtilityProcessParent.cpp",
206 SOURCES += [
207     "BackgroundChildImpl.cpp",
208     "BackgroundParentImpl.cpp",
211 if CONFIG["OS_ARCH"] == "Darwin":
212     # GeckoChildProcessHost.cpp cannot be built unified due to OSX header
213     # clashes with TextRange.
214     SOURCES += [
215         "GeckoChildProcessHost.cpp",
216     ]
217 else:
218     UNIFIED_SOURCES += [
219         "GeckoChildProcessHost.cpp",
220     ]
222 if CONFIG["OS_ARCH"] == "WINNT":
223     UNIFIED_SOURCES += ["MessagePump_windows.cpp"]
224 elif CONFIG["OS_ARCH"] == "Darwin":
225     UNIFIED_SOURCES += ["MessagePump_mac.mm"]
226 elif CONFIG["OS_TARGET"] == "Android":
227     UNIFIED_SOURCES += ["MessagePump_android.cpp"]
229 LOCAL_INCLUDES += [
230     "/caps",
231     "/dom/broadcastchannel",
232     "/dom/indexedDB",
233     "/dom/storage",
234     "/netwerk/base",
235     "/third_party/libwebrtc",
236     "/third_party/libwebrtc/third_party/abseil-cpp",
237     "/tools/fuzzing/ipc",
238     "/xpcom/build",
241 PREPROCESSED_IPDL_SOURCES = [
242     "PUtilityAudioDecoder.ipdl",
243     "PUtilityProcess.ipdl",
246 IPDL_SOURCES = [
247     "InputStreamParams.ipdlh",
248     "IPCStream.ipdlh",
249     "PBackground.ipdl",
250     "PBackgroundSharedTypes.ipdlh",
251     "PBackgroundStarter.ipdl",
252     "PBackgroundTest.ipdl",
253     "PIdleScheduler.ipdl",
254     "ProtocolTypes.ipdlh",
255     "RandomAccessStreamParams.ipdlh",
256     "URIParams.ipdlh",
259 if CONFIG["MOZ_ENABLE_FORKSERVER"]:
260     EXPORTS.mozilla.ipc += [
261         "ForkServer.h",
262         "ForkServiceChild.h",
263         "MiniTransceiver.h",
264     ]
265     UNIFIED_SOURCES += [
266         "ForkServer.cpp",
267         "ForkServiceChild.cpp",
268         "MiniTransceiver.cpp",
269     ]
270     XPCOM_MANIFESTS += [
271         "components.conf",
272     ]
274 LOCAL_INCLUDES += [
275     "/dom/ipc",
276     "/toolkit/crashreporter",
277     "/toolkit/xre",
278     "/xpcom/base",
279     "/xpcom/threads",
282 include("/ipc/chromium/chromium-config.mozbuild")
284 FINAL_LIBRARY = "xul"
286 if CONFIG["OS_ARCH"] == "Darwin":
287     OS_LIBS += ["bsm"]  # for audit_token_to_pid
289 for var in ("MOZ_CHILD_PROCESS_NAME", "MOZ_CHILD_PROCESS_BUNDLE"):
290     DEFINES[var] = '"%s"' % CONFIG[var]
292 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT":
293     LOCAL_INCLUDES += [
294         "/security/sandbox/chromium",
295         "/security/sandbox/chromium-shim",
296         "/security/sandbox/win/src/sandboxbroker",
297     ]
299 if CONFIG["ENABLE_TESTS"]:
300     DIRS += [
301         "test/gtest",
302         "test/utility_process_xpcom",
303         "test/browser",
304     ]
306 # Add libFuzzer configuration directives
307 include("/tools/fuzzing/libfuzzer-config.mozbuild")