Bug 1769547 - Do not MOZ_CRASH() on missing process r=nika
[gecko.git] / widget / moz.build
blob003a98b284c76e8fc4a3ea48c687a30beeb9515c
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 with Files("**"):
8     BUG_COMPONENT = ("Core", "Widget")
10 with Files("crashtests/*1128214*"):
11     BUG_COMPONENT = ("Core", "Layout")
13 with Files("crashtests/*303901*"):
14     BUG_COMPONENT = ("Core", "Graphics")
16 with Files("crashtests/*380359*"):
17     BUG_COMPONENT = ("Core", "Widget")
19 with Files("reftests/**"):
20     BUG_COMPONENT = ("Core", "Widget: Cocoa")
22 with Files("reftests/*fallback*"):
23     BUG_COMPONENT = ("Core", "Layout: Form Controls")
25 with Files("*CompositorWidget*"):
26     BUG_COMPONENT = ("Core", "Graphics")
28 with Files("*ContentCache*"):
29     BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling")
31 with Files("*ContentData*"):
32     BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling")
34 with Files("*Events.h"):
35     BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling")
37 with Files("*FontRange*"):
38     BUG_COMPONENT = ("Core", "Widget: Cocoa")
40 with Files("*Gfx*"):
41     BUG_COMPONENT = ("Core", "Graphics")
43 with Files("*IMEData*"):
44     BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling")
46 with Files("*TextEventDispatcher*"):
47     BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling")
49 with Files("*NativeKeyBindings*"):
50     BUG_COMPONENT = ("Core", "DOM: UI Events & Focus Handling")
52 toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"]
54 if toolkit in ("android", "cocoa", "gtk", "uikit", "windows"):
55     DIRS += [toolkit]
57 if toolkit == "cocoa":
58     XPIDL_SOURCES += [
59         "nsIMacDockSupport.idl",
60         "nsIMacFinderProgress.idl",
61         "nsIMacSharingService.idl",
62         "nsIMacUserActivityUpdater.idl",
63         "nsIMacWebAppUtils.idl",
64         "nsIStandaloneNativeMenu.idl",
65         "nsITaskbarProgress.idl",
66         "nsITouchBarHelper.idl",
67         "nsITouchBarInput.idl",
68         "nsITouchBarUpdater.idl",
69     ]
70 elif toolkit == "gtk":
71     XPIDL_SOURCES += [
72         "nsIApplicationChooser.idl",
73         "nsIGtkTaskbarProgress.idl",
74         "nsITaskbarProgress.idl",
75     ]
76 elif toolkit == "windows":
77     XPIDL_SOURCES += [
78         "nsIJumpListBuilder.idl",
79         "nsIJumpListItem.idl",
80         "nsIPrintSettingsWin.idl",
81         "nsITaskbarOverlayIconController.idl",
82         "nsITaskbarPreview.idl",
83         "nsITaskbarPreviewButton.idl",
84         "nsITaskbarPreviewController.idl",
85         "nsITaskbarProgress.idl",
86         "nsITaskbarTabPreview.idl",
87         "nsITaskbarWindowPreview.idl",
88         "nsIWindowsUIUtils.idl",
89         "nsIWinTaskbar.idl",
90     ]
92 TEST_DIRS += ["tests", "tests/gtest"]
94 DIRS += ["headless"]
96 # Don't build the DSO under the 'build' directory as windows does.
98 # The DSOs get built in the toolkit dir itself.  Do this so that
99 # multiple implementations of widget can be built on the same
100 # source tree.
103 XPIDL_SOURCES += [
104     "nsIAppShell.idl",
105     "nsIBaseWindow.idl",
106     "nsIBidiKeyboard.idl",
107     "nsIClipboard.idl",
108     "nsIClipboardHelper.idl",
109     "nsIClipboardOwner.idl",
110     "nsIColorPicker.idl",
111     "nsIDisplayInfo.idl",
112     "nsIDragService.idl",
113     "nsIDragSession.idl",
114     "nsIFilePicker.idl",
115     "nsIFormatConverter.idl",
116     "nsIGfxInfo.idl",
117     "nsIGfxInfoDebug.idl",
118     "nsIPaper.idl",
119     "nsIPaperMargin.idl",
120     "nsIPrinter.idl",
121     "nsIPrinterList.idl",
122     "nsIPrintSettings.idl",
123     "nsIPrintSettingsService.idl",
124     "nsIScreen.idl",
125     "nsIScreenManager.idl",
126     "nsISharePicker.idl",
127     "nsISound.idl",
128     "nsISystemStatusBar.idl",
129     "nsITransferable.idl",
130     "nsIUserIdleService.idl",
131     "nsIUserIdleServiceInternal.idl",
134 XPIDL_MODULE = "widget"
136 EXPORTS += [
137     "GfxDriverInfo.h",
138     "GfxInfoBase.h",
139     "GfxInfoCollector.h",
140     "InputData.h",
141     "nsBaseAppShell.h",
142     "nsBaseDragService.h",
143     "nsBaseFilePicker.h",
144     "nsBaseScreen.h",
145     "nsBaseWidget.h",
146     "nsIDeviceContextSpec.h",
147     "nsIRollupListener.h",
148     "nsIWidget.h",
149     "nsIWidgetListener.h",
150     "nsPaper.h",
151     "nsPrinterListBase.h",
152     "nsUserIdleService.h",
153     "nsWidgetInitData.h",
154     "nsWidgetsCID.h",
155     "PuppetWidget.h",
158 EXPORTS.mozilla += [
159     "BasicEvents.h",
160     "ColorScheme.h",
161     "CommandList.h",
162     "ContentCache.h",
163     "ContentData.h",
164     "ContentEvents.h",
165     "EventClassList.h",
166     "EventForwards.h",
167     "EventMessageList.h",
168     "FontRange.h",
169     "LookAndFeel.h",
170     "MiscEvents.h",
171     "MouseEvents.h",
172     "NativeKeyBindingsType.h",
173     "SwipeTracker.h",
174     "TextEventDispatcher.h",
175     "TextEventDispatcherListener.h",
176     "TextEvents.h",
177     "TextRange.h",
178     "TouchEvents.h",
179     "VsyncDispatcher.h",
180     "WidgetUtils.h",
183 EXPORTS.mozilla.widget += [
184     "CompositorWidget.h",
185     "IconLoader.h",
186     "IMEData.h",
187     "InProcessCompositorWidget.h",
188     "MediaKeysEventSourceFactory.h",
189     "NativeMenu.h",
190     "NativeMenuSupport.h",
191     "nsAutoRollup.h",
192     "nsXPLookAndFeel.h",
193     "PuppetBidiKeyboard.h",
194     "RemoteLookAndFeel.h",
195     "Screen.h",
196     "ScreenManager.h",
197     "TextRecognition.h",
198     "ThemeChangeKind.h",
199     "WidgetMessageUtils.h",
200     "WindowOcclusionState.h",
203 UNIFIED_SOURCES += [
204     "CompositorWidget.cpp",
205     "ContentCache.cpp",
206     "ContentData.cpp",
207     "GfxDriverInfo.cpp",
208     "GfxInfoBase.cpp",
209     "GfxInfoCollector.cpp",
210     "IconLoader.cpp",
211     "IMEData.cpp",
212     "InProcessCompositorWidget.cpp",
213     "InputData.cpp",
214     "nsAutoRollup.cpp",
215     "nsBaseAppShell.cpp",
216     "nsBaseScreen.cpp",
217     "nsClipboardHelper.cpp",
218     "nsClipboardProxy.cpp",
219     "nsColorPickerProxy.cpp",
220     "nsContentProcessWidgetFactory.cpp",
221     "nsDragServiceProxy.cpp",
222     "nsFilePickerProxy.cpp",
223     "nsHTMLFormatConverter.cpp",
224     "nsIWidgetListener.cpp",
225     "nsPrimitiveHelpers.cpp",
226     "nsPrintSettingsImpl.cpp",
227     "nsSoundProxy.cpp",
228     "nsTransferable.cpp",
229     "nsUserIdleService.cpp",
230     "nsXPLookAndFeel.cpp",
231     "PuppetBidiKeyboard.cpp",
232     "PuppetWidget.cpp",
233     "RemoteLookAndFeel.cpp",
234     "Screen.cpp",
235     "ScrollbarDrawing.cpp",
236     "ScrollbarDrawingAndroid.cpp",
237     "ScrollbarDrawingCocoa.cpp",
238     "ScrollbarDrawingGTK.cpp",
239     "ScrollbarDrawingWin.cpp",
240     "ScrollbarDrawingWin11.cpp",
241     "SharedWidgetUtils.cpp",
242     "SwipeTracker.cpp",
243     "TextEventDispatcher.cpp",
244     "TextRecognition.cpp",
245     "Theme.cpp",
246     "ThemeCocoa.cpp",
247     "ThemeColors.cpp",
248     "ThemeDrawing.cpp",
249     "TouchResampler.cpp",
250     "VsyncDispatcher.cpp",
251     "WidgetEventImpl.cpp",
252     "WidgetUtils.cpp",
255 if CONFIG["OS_ARCH"] == "Linux":
256     EXPORTS.mozilla.widget += ["LSBUtils.h"]
257     SOURCES += ["LSBUtils.cpp"]
259 if CONFIG["NS_PRINTING"]:
260     XPIDL_SOURCES += [
261         "nsIPrintDialogService.idl",
262     ]
263     EXPORTS += [
264         "nsDeviceContextSpecProxy.h",
265         "nsPrintSettingsService.h",
266     ]
267     UNIFIED_SOURCES += [
268         "nsDeviceContextSpecProxy.cpp",
269         "nsPaper.cpp",
270         "nsPaperMargin.cpp",
271         "nsPrinterBase.cpp",
272         "nsPrinterListBase.cpp",
273         "nsPrintSettingsService.cpp",
274     ]
276     if toolkit in ("cocoa", "gtk"):
277         UNIFIED_SOURCES += [
278             "nsCUPSShim.cpp",
279             "nsPrinterCUPS.cpp",
280             "nsPrinterListCUPS.cpp",
281         ]
283 # nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
284 # nsBaseDragService.cpp moved out of UNIFIED to fix xgill crash (bug 1259850) after moving widget/ContentHelper -> apz/util/TouchActionHelper
285 SOURCES += [
286     "nsBaseDragService.cpp",
287     "nsBaseWidget.cpp",
288     "ScreenManager.cpp",
291 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
292     EXPORTS.mozilla += [
293         "WidgetTraceEvent.h",
294     ]
296 EXPORTS.ipc = ["nsGUIEventIPC.h"]
298 if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]:
299     DIRS += ["x11"]
301 if toolkit in ("cocoa", "windows"):
302     UNIFIED_SOURCES += [
303         "nsBaseClipboard.cpp",
304     ]
306 if toolkit in {"gtk", "cocoa", "windows", "android", "uikit"}:
307     UNIFIED_SOURCES += [
308         "nsBaseFilePicker.cpp",
309     ]
311 if toolkit in ("gtk", "windows", "cocoa", "android"):
312     UNIFIED_SOURCES += [
313         "nsNativeTheme.cpp",
314     ]
316 DEFINES["MOZ_CROSS_PROCESS_IME"] = True
318 include("/ipc/chromium/chromium-config.mozbuild")
320 LOCAL_INCLUDES += [
321     "/dom/base",
322     "/dom/ipc",
323     "/gfx/2d",
324     "/layout/base",
325     "/layout/forms",
326     "/layout/generic",
327     "/layout/painting",
328     "/layout/xul",
329     "/layout/xul/tree/",
330     "/view",
331     "/widget",
332     "/widget/headless",
335 # We use the CUPS headers on Cocoa and GTK, but on GTK we don't depend on there being system headers.
336 if toolkit == "gtk":
337     LOCAL_INCLUDES += ["/third_party/cups/include"]
339 if toolkit == "windows":
340     IPDL_SOURCES = [
341         "headless/HeadlessWidgetTypes.ipdlh",
342         "windows/PCompositorWidget.ipdl",
343         "windows/PlatformWidgetTypes.ipdlh",
344     ]
345 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
346     IPDL_SOURCES = [
347         "gtk/PCompositorWidget.ipdl",
348         "gtk/PlatformWidgetTypes.ipdlh",
349         "headless/HeadlessWidgetTypes.ipdlh",
350     ]
351 elif toolkit == "android":
352     IPDL_SOURCES = [
353         "android/PCompositorWidget.ipdl",
354         "android/PlatformWidgetTypes.ipdlh",
355         "headless/HeadlessWidgetTypes.ipdlh",
356     ]
357 else:
358     IPDL_SOURCES = [
359         "generic/PCompositorWidget.ipdl",
360         "generic/PlatformWidgetTypes.ipdlh",
361         "headless/HeadlessWidgetTypes.ipdlh",
362     ]
364 PREPROCESSED_IPDL_SOURCES += [
365     "LookAndFeelTypes.ipdlh",
368 LOCAL_INCLUDES += [
369     "/widget/%s" % toolkit,
371 FINAL_LIBRARY = "xul"
373 if CONFIG["MOZ_ENABLE_D3D10_LAYER"]:
374     DEFINES["MOZ_ENABLE_D3D10_LAYER"] = True
376 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
377     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
378 if CONFIG["MOZ_WAYLAND"]:
379     CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
381 REQUIRES_UNIFIED_BUILD = True