Backed out 6 changesets (bug 1875528) for causing leakcheck failures. CLOSED TREE
[gecko.git] / ipc / glue / moz.build
blobbb23b29a453c2347b9734cfdc4f38e3de0f37404
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     "MessageChannel.h",
46     "MessageLink.h",
47     "MessagePump.h",
48     "Neutering.h",
49     "NodeChannel.h",
50     "NodeController.h",
51     "ProcessChild.h",
52     "ProcessUtils.h",
53     "ProtocolMessageUtils.h",
54     "ProtocolUtils.h",
55     "RandomAccessStreamUtils.h",
56     "RawShmem.h",
57     "ScopedPort.h",
58     "SerializedStructuredCloneBuffer.h",
59     "SharedMemory.h",
60     "SharedMemoryBasic.h",
61     "Shmem.h",
62     "ShmemMessageUtils.h",
63     "SideVariant.h",
64     "TaintingIPCUtils.h",
65     "TaskFactory.h",
66     "ToplevelActorHolder.h",
67     "TransportSecurityInfoUtils.h",
68     "URIUtils.h",
69     "UtilityAudioDecoder.h",
70     "UtilityAudioDecoderChild.h",
71     "UtilityAudioDecoderParent.h",
72     "UtilityProcessChild.h",
73     "UtilityProcessHost.h",
74     "UtilityProcessImpl.h",
75     "UtilityProcessManager.h",
76     "UtilityProcessParent.h",
77     "UtilityProcessSandboxing.h",
78     "WindowsMessageLoop.h",
81 if CONFIG["OS_ARCH"] == "WINNT":
82     SOURCES += [
83         "SharedMemory_windows.cpp",
84         "WindowsMessageLoop.cpp",
85     ]
86 else:
87     UNIFIED_SOURCES += [
88         "SharedMemory_posix.cpp",
89     ]
91 if CONFIG["OS_ARCH"] == "WINNT":
92     SOURCES += [
93         "CrossProcessMutex_windows.cpp",
94     ]
95 elif not CONFIG["OS_ARCH"] in ("NetBSD", "OpenBSD"):
96     UNIFIED_SOURCES += [
97         "CrossProcessMutex_posix.cpp",
98     ]
99 else:
100     UNIFIED_SOURCES += [
101         "CrossProcessMutex_unimplemented.cpp",
102     ]
104 if CONFIG["OS_ARCH"] == "WINNT":
105     SOURCES += [
106         "CrossProcessSemaphore_windows.cpp",
107     ]
108 elif CONFIG["OS_ARCH"] == "Darwin":
109     SOURCES += [
110         "CrossProcessSemaphore_mach.cpp",
111     ]
112 else:
113     UNIFIED_SOURCES += [
114         "CrossProcessSemaphore_posix.cpp",
115     ]
117 if CONFIG["OS_ARCH"] == "Darwin":
118     EXPORTS.mozilla.ipc += ["SharedMemoryBasic_mach.h"]
119     SOURCES += [
120         "SharedMemoryBasic_mach.mm",
121     ]
122 else:
123     EXPORTS.mozilla.ipc += ["SharedMemoryBasic_chromium.h"]
125 if CONFIG["OS_ARCH"] == "Linux":
126     UNIFIED_SOURCES += [
127         "ProcessUtils_linux.cpp",
128         "SetProcessTitle.cpp",
129     ]
130     EXPORTS.mozilla.ipc += [
131         "SetProcessTitle.h",
132     ]
133 elif CONFIG["OS_ARCH"] in ("DragonFly", "FreeBSD", "NetBSD", "OpenBSD"):
134     UNIFIED_SOURCES += [
135         "ProcessUtils_bsd.cpp",
136         "SetProcessTitle.cpp",
137     ]
138     EXPORTS.mozilla.ipc += [
139         "SetProcessTitle.h",
140     ]
141 elif CONFIG["OS_ARCH"] == "Darwin":
142     UNIFIED_SOURCES += ["ProcessUtils_mac.mm"]
143 else:
144     UNIFIED_SOURCES += [
145         "ProcessUtils_none.cpp",
146     ]
148 if CONFIG["OS_ARCH"] != "WINNT":
149     EXPORTS.mozilla.ipc += [
150         "FileDescriptorShuffle.h",
151     ]
152     UNIFIED_SOURCES += [
153         "FileDescriptorShuffle.cpp",
154     ]
156 EXPORTS.ipc += [
157     "EnumSerializer.h",
158     "IPCMessageUtils.h",
159     "IPCMessageUtilsSpecializations.h",
162 UNIFIED_SOURCES += [
163     "BackgroundImpl.cpp",
164     "BackgroundUtils.cpp",
165     "BigBuffer.cpp",
166     "BrowserProcessSubThread.cpp",
167     "CrashReporterClient.cpp",
168     "CrashReporterHost.cpp",
169     "DataPipe.cpp",
170     "Endpoint.cpp",
171     "FileDescriptor.cpp",
172     "FileDescriptorUtils.cpp",
173     "IdleSchedulerChild.cpp",
174     "IdleSchedulerParent.cpp",
175     "InputStreamUtils.cpp",
176     "IPCMessageUtilsSpecializations.cpp",
177     "IPCStreamUtils.cpp",
178     "LaunchError.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",
204     "UtilityProcessSandboxing.cpp",
207 SOURCES += [
208     "BackgroundChildImpl.cpp",
209     "BackgroundParentImpl.cpp",
212 if CONFIG["OS_ARCH"] == "Darwin":
213     # GeckoChildProcessHost.cpp cannot be built unified due to OSX header
214     # clashes with TextRange.
215     SOURCES += [
216         "GeckoChildProcessHost.cpp",
217     ]
218 else:
219     UNIFIED_SOURCES += [
220         "GeckoChildProcessHost.cpp",
221     ]
223 if CONFIG["OS_ARCH"] == "WINNT":
224     UNIFIED_SOURCES += ["MessagePump_windows.cpp"]
225 elif CONFIG["OS_ARCH"] == "Darwin":
226     UNIFIED_SOURCES += ["MessagePump_mac.mm"]
227 elif CONFIG["OS_TARGET"] == "Android":
228     UNIFIED_SOURCES += ["MessagePump_android.cpp"]
230 LOCAL_INCLUDES += [
231     "/caps",
232     "/dom/broadcastchannel",
233     "/dom/indexedDB",
234     "/dom/storage",
235     "/netwerk/base",
236     "/third_party/libwebrtc",
237     "/third_party/libwebrtc/third_party/abseil-cpp",
238     "/tools/fuzzing/ipc",
239     "/xpcom/build",
242 PREPROCESSED_IPDL_SOURCES = [
243     "PUtilityAudioDecoder.ipdl",
244     "PUtilityProcess.ipdl",
247 IPDL_SOURCES = [
248     "InputStreamParams.ipdlh",
249     "IPCStream.ipdlh",
250     "PBackground.ipdl",
251     "PBackgroundSharedTypes.ipdlh",
252     "PBackgroundStarter.ipdl",
253     "PBackgroundTest.ipdl",
254     "PIdleScheduler.ipdl",
255     "ProtocolTypes.ipdlh",
256     "RandomAccessStreamParams.ipdlh",
257     "URIParams.ipdlh",
260 if CONFIG["MOZ_ENABLE_FORKSERVER"]:
261     EXPORTS.mozilla.ipc += [
262         "ForkServer.h",
263         "ForkServiceChild.h",
264         "MiniTransceiver.h",
265     ]
266     UNIFIED_SOURCES += [
267         "ForkServer.cpp",
268         "ForkServiceChild.cpp",
269         "MiniTransceiver.cpp",
270     ]
271     XPCOM_MANIFESTS += [
272         "components.conf",
273     ]
275 LOCAL_INCLUDES += [
276     "/dom/ipc",
277     "/toolkit/crashreporter",
278     "/toolkit/xre",
279     "/xpcom/base",
280     "/xpcom/threads",
283 include("/ipc/chromium/chromium-config.mozbuild")
285 FINAL_LIBRARY = "xul"
287 if CONFIG["OS_ARCH"] == "Darwin":
288     OS_LIBS += ["bsm"]  # for audit_token_to_pid
290 for var in (
291     "MOZ_CHILD_PROCESS_NAME",
292     "MOZ_CHILD_PROCESS_BUNDLENAME",
293     "MOZ_EME_PROCESS_NAME_BRANDED",
294     "MOZ_EME_PROCESS_BUNDLENAME",
296     DEFINES[var] = '"%s"' % CONFIG[var]
298 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT":
299     LOCAL_INCLUDES += [
300         "/security/sandbox/chromium",
301         "/security/sandbox/chromium-shim",
302         "/security/sandbox/win/src/sandboxbroker",
303     ]
305 if CONFIG["ENABLE_TESTS"]:
306     DIRS += [
307         "test/gtest",
308         "test/utility_process_xpcom",
309         "test/browser",
310     ]
312 # Add libFuzzer configuration directives
313 include("/tools/fuzzing/libfuzzer-config.mozbuild")