moz.build (8090B)
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") 7 8 EXPORTS += [ 9 "nsIIPCSerializableInputStream.h", 10 ] 11 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 "ByteBuf.h", 21 "ByteBufUtils.h", 22 "CrashReporterClient.h", 23 "CrashReporterHelper.h", 24 "CrashReporterHost.h", 25 "CrossProcessMutex.h", 26 "CrossProcessSemaphore.h", 27 "DataPipe.h", 28 "Endpoint.h", 29 "EnvironmentMap.h", 30 "FileDescriptor.h", 31 "FileDescriptorUtils.h", 32 "GeckoChildProcessHost.h", 33 "IdleSchedulerChild.h", 34 "IdleSchedulerParent.h", 35 "InputStreamUtils.h", 36 "IOThread.h", 37 "IPCCore.h", 38 "IPCForwards.h", 39 "IPCStreamUtils.h", 40 "IPCTypes.h", 41 "IPDLStructMember.h", 42 "LaunchError.h", 43 "MessageChannel.h", 44 "MessageLink.h", 45 "MessagePump.h", 46 "Neutering.h", 47 "NodeChannel.h", 48 "NodeController.h", 49 "ProcessChild.h", 50 "ProcessUtils.h", 51 "ProtocolMessageUtils.h", 52 "ProtocolUtils.h", 53 "RandomAccessStreamUtils.h", 54 "RustMessageUtils.h", 55 "ScopedPort.h", 56 "SerializedStructuredCloneBuffer.h", 57 "SerializeToBytesUtil.h", 58 "SharedMemoryCursor.h", 59 "SharedMemoryHandle.h", 60 "SharedMemoryMapping.h", 61 "Shmem.h", 62 "ShmemMessageUtils.h", 63 "SideVariant.h", 64 "TaintingIPCUtils.h", 65 "TaskFactory.h", 66 "TransportSecurityInfoUtils.h", 67 "URIUtils.h", 68 "UtilityMediaService.h", 69 "UtilityMediaServiceChild.h", 70 "UtilityMediaServiceParent.h", 71 "UtilityProcessChild.h", 72 "UtilityProcessHost.h", 73 "UtilityProcessImpl.h", 74 "UtilityProcessManager.h", 75 "UtilityProcessParent.h", 76 "UtilityProcessSandboxing.h", 77 "WindowsMessageLoop.h", 78 ] 79 80 if CONFIG["OS_ARCH"] == "WINNT": 81 SOURCES += ["WindowsMessageLoop.cpp"] 82 83 if CONFIG["OS_ARCH"] == "WINNT": 84 SOURCES += [ 85 "CrossProcessMutex_windows.cpp", 86 ] 87 elif not CONFIG["OS_ARCH"] in ("NetBSD", "OpenBSD"): 88 UNIFIED_SOURCES += [ 89 "CrossProcessMutex_posix.cpp", 90 ] 91 else: 92 UNIFIED_SOURCES += [ 93 "CrossProcessMutex_unimplemented.cpp", 94 ] 95 96 if CONFIG["OS_ARCH"] == "WINNT": 97 SOURCES += [ 98 "CrossProcessSemaphore_windows.cpp", 99 ] 100 elif CONFIG["OS_ARCH"] == "Darwin": 101 SOURCES += [ 102 "CrossProcessSemaphore_mach.cpp", 103 ] 104 else: 105 UNIFIED_SOURCES += [ 106 "CrossProcessSemaphore_posix.cpp", 107 ] 108 109 if CONFIG["OS_ARCH"] == "Darwin": 110 UNIFIED_SOURCES += ["SharedMemoryPlatform_mach.cpp"] 111 elif CONFIG["OS_ARCH"] == "WINNT": 112 UNIFIED_SOURCES += ["SharedMemoryPlatform_windows.cpp"] 113 elif CONFIG["OS_TARGET"] == "Android": 114 UNIFIED_SOURCES += ["SharedMemoryPlatform_android.cpp"] 115 else: 116 UNIFIED_SOURCES += ["SharedMemoryPlatform_posix.cpp"] 117 118 119 if CONFIG["OS_ARCH"] == "Linux": 120 UNIFIED_SOURCES += [ 121 "ProcessUtils_linux.cpp", 122 "SetProcessTitle.cpp", 123 ] 124 EXPORTS.mozilla.ipc += [ 125 "SetProcessTitle.h", 126 ] 127 elif CONFIG["OS_ARCH"] in ("DragonFly", "FreeBSD", "NetBSD", "OpenBSD"): 128 UNIFIED_SOURCES += [ 129 "ProcessUtils_bsd.cpp", 130 "SetProcessTitle.cpp", 131 ] 132 EXPORTS.mozilla.ipc += [ 133 "SetProcessTitle.h", 134 ] 135 elif CONFIG["TARGET_OS"] == "OSX": 136 UNIFIED_SOURCES += ["ProcessUtils_mac.mm"] 137 else: 138 UNIFIED_SOURCES += [ 139 "ProcessUtils_none.cpp", 140 ] 141 142 if CONFIG["OS_ARCH"] != "WINNT": 143 EXPORTS.mozilla.ipc += [ 144 "FileDescriptorShuffle.h", 145 ] 146 UNIFIED_SOURCES += [ 147 "FileDescriptorShuffle.cpp", 148 ] 149 150 if CONFIG["TARGET_OS"] == "iOS": 151 EXPORTS.mozilla.ipc += [ 152 "ExtensionKitUtils.h", 153 ] 154 UNIFIED_SOURCES += [ 155 "ExtensionKitUtils.mm", 156 ] 157 158 EXPORTS.ipc += [ 159 "EnumSerializer.h", 160 "IPCMessageUtils.h", 161 "IPCMessageUtilsSpecializations.h", 162 ] 163 164 UNIFIED_SOURCES += [ 165 "BackgroundImpl.cpp", 166 "BackgroundUtils.cpp", 167 "BigBuffer.cpp", 168 "CrashReporterClient.cpp", 169 "CrashReporterHost.cpp", 170 "DataPipe.cpp", 171 "Endpoint.cpp", 172 "FileDescriptor.cpp", 173 "FileDescriptorUtils.cpp", 174 "IdleSchedulerChild.cpp", 175 "IdleSchedulerParent.cpp", 176 "InputStreamUtils.cpp", 177 "IOThread.cpp", 178 "IPCMessageUtilsSpecializations.cpp", 179 "IPCStreamUtils.cpp", 180 "MessageChannel.cpp", 181 "MessageLink.cpp", 182 "MessagePump.cpp", 183 "NodeChannel.cpp", 184 "NodeController.cpp", 185 "ProcessChild.cpp", 186 "ProcessUtils_common.cpp", 187 "ProtocolUtils.cpp", 188 "RandomAccessStreamUtils.cpp", 189 "ScopedPort.cpp", 190 "SerializedStructuredCloneBuffer.cpp", 191 "SharedMemoryCursor.cpp", 192 "SharedMemoryHandle.cpp", 193 "SharedMemoryMapping.cpp", 194 "Shmem.cpp", 195 "StringUtil.cpp", 196 "TransportSecurityInfoUtils.cpp", 197 "URIUtils.cpp", 198 "UtilityMediaService.cpp", 199 "UtilityMediaServiceChild.cpp", 200 "UtilityMediaServiceParent.cpp", 201 "UtilityProcessChild.cpp", 202 "UtilityProcessHost.cpp", 203 "UtilityProcessImpl.cpp", 204 "UtilityProcessManager.cpp", 205 "UtilityProcessParent.cpp", 206 "UtilityProcessSandboxing.cpp", 207 ] 208 209 SOURCES += [ 210 "BackgroundChildImpl.cpp", 211 "BackgroundParentImpl.cpp", 212 ] 213 214 if CONFIG["OS_ARCH"] == "Darwin": 215 # GeckoChildProcessHost.cpp cannot be built unified due to OSX header 216 # clashes with TextRange. 217 SOURCES += [ 218 "GeckoChildProcessHost.cpp", 219 ] 220 else: 221 UNIFIED_SOURCES += [ 222 "GeckoChildProcessHost.cpp", 223 ] 224 225 if CONFIG["OS_ARCH"] == "WINNT": 226 UNIFIED_SOURCES += ["MessagePump_windows.cpp"] 227 elif CONFIG["OS_ARCH"] == "Darwin": 228 UNIFIED_SOURCES += ["MessagePump_mac.mm"] 229 elif CONFIG["OS_TARGET"] == "Android": 230 UNIFIED_SOURCES += ["MessagePump_android.cpp"] 231 232 LOCAL_INCLUDES += [ 233 "!/dist/include/libwebrtc_overrides", 234 "/caps", 235 "/dom/broadcastchannel", 236 "/dom/indexedDB", 237 "/dom/storage", 238 "/netwerk/base", 239 "/third_party/abseil-cpp", 240 "/third_party/libwebrtc", 241 "/tools/fuzzing/ipc", 242 "/xpcom/build", 243 ] 244 245 PREPROCESSED_IPDL_SOURCES = [ 246 "PUtilityMediaService.ipdl", 247 "PUtilityProcess.ipdl", 248 ] 249 250 IPDL_SOURCES = [ 251 "InputStreamParams.ipdlh", 252 "IPCStream.ipdlh", 253 "PBackground.ipdl", 254 "PBackgroundSharedTypes.ipdlh", 255 "PBackgroundStarter.ipdl", 256 "PBackgroundTest.ipdl", 257 "PIdleScheduler.ipdl", 258 "ProtocolTypes.ipdlh", 259 "RandomAccessStreamParams.ipdlh", 260 "URIParams.ipdlh", 261 ] 262 263 if CONFIG["MOZ_ENABLE_FORKSERVER"]: 264 EXPORTS.mozilla.ipc += [ 265 "ForkServer.h", 266 "ForkServiceChild.h", 267 "MiniTransceiver.h", 268 ] 269 UNIFIED_SOURCES += [ 270 "ForkServer.cpp", 271 "ForkServiceChild.cpp", 272 "MiniTransceiver.cpp", 273 ] 274 XPCOM_MANIFESTS += [ 275 "components.conf", 276 ] 277 278 LOCAL_INCLUDES += [ 279 "/dom/ipc", 280 "/toolkit/crashreporter", 281 "/toolkit/xre", 282 "/xpcom/base", 283 "/xpcom/threads", 284 ] 285 286 include("/ipc/chromium/chromium-config.mozbuild") 287 288 FINAL_LIBRARY = "xul" 289 290 if CONFIG["TARGET_OS"] == "OSX": 291 OS_LIBS += ["bsm"] # for audit_token_to_pid 292 elif CONFIG["TARGET_OS"] == "iOS": 293 OS_LIBS += ["-framework BrowserEngineKit"] 294 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": 295 OS_LIBS += ["android"] 296 297 for var in ( 298 "MOZ_CHILD_PROCESS_NAME", 299 "MOZ_CHILD_PROCESS_BUNDLENAME", 300 "MOZ_EME_PROCESS_NAME_BRANDED", 301 "MOZ_EME_PROCESS_BUNDLENAME", 302 "MOZ_GPU_PROCESS_NAME_BRANDED", 303 "MOZ_GPU_PROCESS_BUNDLENAME", 304 ): 305 DEFINES[var] = '"%s"' % CONFIG[var] 306 307 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT": 308 LOCAL_INCLUDES += [ 309 "/security/sandbox/chromium", 310 "/security/sandbox/chromium-shim", 311 "/security/sandbox/win/src/sandboxbroker", 312 ] 313 314 TEST_DIRS += [ 315 "test/gtest", 316 "test/utility_process_xpcom", 317 "test/browser", 318 ] 319 320 # Add libFuzzer configuration directives 321 include("/tools/fuzzing/libfuzzer-config.mozbuild")