summaryrefslogtreecommitdiffstats
path: root/ipc/glue/moz.build
blob: d0d9f99378e386fc427e9064932d0f4076c43864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

EXPORTS += [
    'nsIIPCBackgroundChildCreateCallback.h',
    'nsIIPCSerializableInputStream.h',
    'nsIIPCSerializableURI.h',
]

EXPORTS.mozilla.ipc += [
    'BackgroundChild.h',
    'BackgroundParent.h',
    'BackgroundUtils.h',
    'BrowserProcessSubThread.h',
    'CrossProcessMutex.h',
    'FileDescriptor.h',
    'FileDescriptorSetChild.h',
    'FileDescriptorSetParent.h',
    'FileDescriptorUtils.h',
    'GeckoChildProcessHost.h',
    'InputStreamUtils.h',
    'IOThreadChild.h',
    'IPCStreamUtils.h',
    'MessageChannel.h',
    'MessageLink.h',
    'Neutering.h',
    'ProcessChild.h',
    'ProtocolUtils.h',
    'ScopedXREEmbed.h',
    'SendStream.h',
    'SendStreamAlloc.h',
    'SharedMemory.h',
    'SharedMemoryBasic.h',
    'Shmem.h',
    'TaskFactory.h',
    'Transport.h',
    'URIUtils.h',
    'WindowsMessageLoop.h',
]

if CONFIG['MOZ_FAULTY'] == '1':
    EXPORTS.mozilla.ipc += ['Faulty.h']
    SOURCES += ['Faulty.cpp']

if CONFIG['OS_ARCH'] == 'WINNT':
    DEFINES['WEBRTC_WIN'] = True
    EXPORTS.mozilla.ipc += [
        'Transport_win.h',
    ]
    SOURCES += [
        'SharedMemory_windows.cpp',
        'Transport_win.cpp',
        'WindowsMessageLoop.cpp',
    ]
else:
    DEFINES['WEBRTC_POSIX'] = True
    EXPORTS.mozilla.ipc += [
        'Transport_posix.h',
    ]
    UNIFIED_SOURCES += [
        'SharedMemory_posix.cpp',
        'Transport_posix.cpp',
    ]

if CONFIG['OS_ARCH'] == 'WINNT':
    SOURCES += [
        'CrossProcessMutex_windows.cpp',
    ]
elif not CONFIG['OS_ARCH'] in ('NetBSD', 'OpenBSD'):
    UNIFIED_SOURCES += [
        'CrossProcessMutex_posix.cpp',
    ]
else:
    UNIFIED_SOURCES += [
        'CrossProcessMutex_unimplemented.cpp',
    ]

# Android has its own,
# almost-but-not-quite-compatible-with-POSIX-or-/dev/shm shared memory
# impl.
if CONFIG['OS_TARGET'] == 'Android':
    EXPORTS.mozilla.ipc += ['SharedMemoryBasic_android.h']
    UNIFIED_SOURCES += [
        'SharedMemoryBasic_android.cpp',
    ]
elif CONFIG['OS_ARCH'] == 'Darwin':
    EXPORTS.mozilla.ipc += ['SharedMemoryBasic_mach.h']
    SOURCES += [
        'SharedMemoryBasic_mach.mm',
    ]
else:
    EXPORTS.mozilla.ipc += ['SharedMemoryBasic_chromium.h']

if CONFIG['OS_ARCH'] == 'Linux':
    UNIFIED_SOURCES += [
        'ProcessUtils_linux.cpp',
    ]
elif CONFIG['OS_ARCH'] in ('DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD'):
    UNIFIED_SOURCES += [
        'ProcessUtils_bsd.cpp'
    ]
elif CONFIG['OS_ARCH'] == 'Darwin':
    UNIFIED_SOURCES += [
        'ProcessUtils_mac.mm'
    ]
else:
    UNIFIED_SOURCES += [
        'ProcessUtils_none.cpp',
    ]

EXPORTS.ipc += [
    'IPCMessageUtils.h',
]

UNIFIED_SOURCES += [
    'BackgroundImpl.cpp',
    'BackgroundUtils.cpp',
    'BrowserProcessSubThread.cpp',
    'FileDescriptor.cpp',
    'FileDescriptorUtils.cpp',
    'InputStreamUtils.cpp',
    'IPCMessageUtils.cpp',
    'IPCStreamUtils.cpp',
    'MessageChannel.cpp',
    'MessageLink.cpp',
    'MessagePump.cpp',
    'ProcessChild.cpp',
    'ProtocolUtils.cpp',
    'ScopedXREEmbed.cpp',
    'SendStreamChild.cpp',
    'SendStreamParent.cpp',
    'SharedMemory.cpp',
    'Shmem.cpp',
    'StringUtil.cpp',
]

# GeckoChildProcessHost.cpp cannot be built in unified mode because it uses plarena.h.
# URIUtils.cpp cannot be built in unified mode because of name clashes on strdup.
SOURCES += [
    'BackgroundChildImpl.cpp',
    'BackgroundParentImpl.cpp',
    'FileDescriptorSetChild.cpp',
    'FileDescriptorSetParent.cpp',
    'GeckoChildProcessHost.cpp',
    'URIUtils.cpp',
]

if CONFIG['_MSC_VER']:
    # This is intended as a temporary hack to support building with VS2015.
    # 'reinterpret_cast': conversion from 'DWORD' to 'HANDLE' of greater size
    SOURCES['BackgroundChildImpl.cpp'].flags += ['-wd4312']
    SOURCES['BackgroundParentImpl.cpp'].flags += ['-wd4312']

LOCAL_INCLUDES += [
    '/caps',
    '/dom/broadcastchannel',
    '/dom/indexedDB',
    '/dom/workers',
    '/media/webrtc/trunk',
    '/xpcom/build',
]

IPDL_SOURCES = [
    'InputStreamParams.ipdlh',
    'IPCStream.ipdlh',
    'PBackground.ipdl',
    'PBackgroundSharedTypes.ipdlh',
    'PBackgroundTest.ipdl',
    'PFileDescriptorSet.ipdl',
    'ProtocolTypes.ipdlh',
    'PSendStream.ipdl',
    'URIParams.ipdlh',
]

LOCAL_INCLUDES += [
    '/dom/ipc',
    '/toolkit/crashreporter',
    '/toolkit/xre',
    '/xpcom/threads',
]

include('/ipc/chromium/chromium-config.mozbuild')

FINAL_LIBRARY = 'xul'

for var in ('MOZ_CHILD_PROCESS_NAME', 'MOZ_CHILD_PROCESS_NAME_PIE',
            'MOZ_CHILD_PROCESS_BUNDLE', 'DLL_PREFIX', 'DLL_SUFFIX'):
    DEFINES[var] = '"%s"' % CONFIG[var]

if CONFIG['GNU_CXX']:
    CXXFLAGS += ['-Wno-shadow']