Merge mozilla-central to autoland. CLOSED TREE
[gecko.git] / widget / moz.build
blob557db5e2888177ae7e101431a657c41fc09331e9
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 XPCOM_MANIFESTS += [
55     "components.conf",
58 if toolkit in ("android", "cocoa", "gtk", "uikit", "windows"):
59     DIRS += [toolkit]
61 if toolkit == "cocoa":
62     XPIDL_SOURCES += [
63         "nsIMacDockSupport.idl",
64         "nsIMacFinderProgress.idl",
65         "nsIMacSharingService.idl",
66         "nsIMacUserActivityUpdater.idl",
67         "nsIMacWebAppUtils.idl",
68         "nsIStandaloneNativeMenu.idl",
69         "nsITaskbarProgress.idl",
70         "nsITouchBarHelper.idl",
71         "nsITouchBarInput.idl",
72         "nsITouchBarUpdater.idl",
73     ]
74 elif toolkit == "gtk":
75     XPIDL_SOURCES += [
76         "nsIApplicationChooser.idl",
77         "nsIGtkTaskbarProgress.idl",
78         "nsITaskbarProgress.idl",
79     ]
80 elif toolkit == "windows":
81     XPIDL_SOURCES += [
82         "nsIJumpListBuilder.idl",
83         "nsILegacyJumpListBuilder.idl",
84         "nsILegacyJumpListItem.idl",
85         "nsIPrintSettingsWin.idl",
86         "nsITaskbarOverlayIconController.idl",
87         "nsITaskbarPreview.idl",
88         "nsITaskbarPreviewButton.idl",
89         "nsITaskbarPreviewController.idl",
90         "nsITaskbarProgress.idl",
91         "nsITaskbarTabPreview.idl",
92         "nsITaskbarWindowPreview.idl",
93         "nsIWindowsUIUtils.idl",
94         "nsIWinTaskbar.idl",
95     ]
97 if CONFIG["NS_PRINTING"]:
98     # Needs to go before the XPIDL_MODULE line.
99     XPIDL_SOURCES += [
100         "nsIPrintDialogService.idl",
101     ]
103 TEST_DIRS += ["tests", "tests/gtest"]
105 DIRS += ["headless"]
107 # Don't build the DSO under the 'build' directory as windows does.
109 # The DSOs get built in the toolkit dir itself.  Do this so that
110 # multiple implementations of widget can be built on the same
111 # source tree.
114 XPIDL_SOURCES += [
115     "nsIAppShell.idl",
116     "nsIBaseWindow.idl",
117     "nsIBidiKeyboard.idl",
118     "nsIClipboard.idl",
119     "nsIClipboardHelper.idl",
120     "nsIClipboardOwner.idl",
121     "nsIColorPicker.idl",
122     "nsIDisplayInfo.idl",
123     "nsIDragService.idl",
124     "nsIDragSession.idl",
125     "nsIFilePicker.idl",
126     "nsIFormatConverter.idl",
127     "nsIGfxInfo.idl",
128     "nsIGfxInfoDebug.idl",
129     "nsIPaper.idl",
130     "nsIPaperMargin.idl",
131     "nsIPrinter.idl",
132     "nsIPrinterList.idl",
133     "nsIPrintSettings.idl",
134     "nsIPrintSettingsService.idl",
135     "nsIScreen.idl",
136     "nsIScreenManager.idl",
137     "nsISharePicker.idl",
138     "nsISound.idl",
139     "nsISystemStatusBar.idl",
140     "nsITransferable.idl",
141     "nsIUserIdleService.idl",
142     "nsIUserIdleServiceInternal.idl",
145 XPIDL_MODULE = "widget"
147 EXPORTS += [
148     "GfxDriverInfo.h",
149     "GfxInfoBase.h",
150     "GfxInfoCollector.h",
151     "InputData.h",
152     "nsBaseAppShell.h",
153     "nsBaseClipboard.h",
154     "nsBaseDragService.h",
155     "nsBaseFilePicker.h",
156     "nsBaseWidget.h",
157     "nsIDeviceContextSpec.h",
158     "nsIRollupListener.h",
159     "nsIWidget.h",
160     "nsIWidgetListener.h",
161     "nsPaper.h",
162     "nsPrinterListBase.h",
163     "nsUserIdleService.h",
164     "nsWidgetsCID.h",
165     "PuppetWidget.h",
168 EXPORTS.mozilla += [
169     "BasicEvents.h",
170     "ClipboardReadRequestChild.h",
171     "ClipboardReadRequestParent.h",
172     "ClipboardWriteRequestChild.h",
173     "ClipboardWriteRequestParent.h",
174     "ColorScheme.h",
175     "CommandList.h",
176     "ContentCache.h",
177     "ContentData.h",
178     "ContentEvents.h",
179     "DimensionRequest.h",
180     "EventClassList.h",
181     "EventForwards.h",
182     "EventMessageList.h",
183     "FontRange.h",
184     "LookAndFeel.h",
185     "MiscEvents.h",
186     "MouseEvents.h",
187     "NativeKeyBindingsType.h",
188     "SwipeTracker.h",
189     "TextEventDispatcher.h",
190     "TextEventDispatcherListener.h",
191     "TextEvents.h",
192     "TextRange.h",
193     "TouchEvents.h",
194     "VsyncDispatcher.h",
195     "WidgetUtils.h",
196     "WindowButtonType.h",
199 EXPORTS.mozilla.widget += [
200     "CompositorWidget.h",
201     "IconLoader.h",
202     "IMEData.h",
203     "InitData.h",
204     "InProcessCompositorWidget.h",
205     "MediaKeysEventSourceFactory.h",
206     "NativeMenu.h",
207     "NativeMenuSupport.h",
208     "nsAutoRollup.h",
209     "nsXPLookAndFeel.h",
210     "PuppetBidiKeyboard.h",
211     "RemoteLookAndFeel.h",
212     "Screen.h",
213     "ScreenManager.h",
214     "TextRecognition.h",
215     "ThemeChangeKind.h",
216     "WidgetMessageUtils.h",
217     "WindowOcclusionState.h",
220 UNIFIED_SOURCES += [
221     "ClipboardReadRequestParent.cpp",
222     "ClipboardWriteRequestChild.cpp",
223     "ClipboardWriteRequestParent.cpp",
224     "CompositorWidget.cpp",
225     "ContentCache.cpp",
226     "ContentData.cpp",
227     "DimensionRequest.cpp",
228     "GfxDriverInfo.cpp",
229     "GfxInfoBase.cpp",
230     "GfxInfoCollector.cpp",
231     "IconLoader.cpp",
232     "IMEData.cpp",
233     "InProcessCompositorWidget.cpp",
234     "InputData.cpp",
235     "nsAutoRollup.cpp",
236     "nsBaseAppShell.cpp",
237     "nsBaseClipboard.cpp",
238     "nsClipboardHelper.cpp",
239     "nsClipboardProxy.cpp",
240     "nsColorPickerProxy.cpp",
241     "nsDragServiceProxy.cpp",
242     "nsFilePickerProxy.cpp",
243     "nsHTMLFormatConverter.cpp",
244     "nsIBaseWindow.cpp",
245     "nsIDeviceContextSpec.cpp",
246     "nsIWidgetListener.cpp",
247     "nsPrimitiveHelpers.cpp",
248     "nsPrintSettingsImpl.cpp",
249     "nsTransferable.cpp",
250     "nsUserIdleService.cpp",
251     "nsXPLookAndFeel.cpp",
252     "PuppetBidiKeyboard.cpp",
253     "PuppetWidget.cpp",
254     "RemoteLookAndFeel.cpp",
255     "Screen.cpp",
256     "ScrollbarDrawing.cpp",
257     "ScrollbarDrawingAndroid.cpp",
258     "ScrollbarDrawingCocoa.cpp",
259     "ScrollbarDrawingGTK.cpp",
260     "ScrollbarDrawingWin.cpp",
261     "ScrollbarDrawingWin11.cpp",
262     "SharedWidgetUtils.cpp",
263     "SwipeTracker.cpp",
264     "TextEventDispatcher.cpp",
265     "TextRecognition.cpp",
266     "Theme.cpp",
267     "ThemeCocoa.cpp",
268     "ThemeColors.cpp",
269     "ThemeDrawing.cpp",
270     "TouchResampler.cpp",
271     "VsyncDispatcher.cpp",
272     "WidgetEventImpl.cpp",
273     "WidgetUtils.cpp",
276 if CONFIG["OS_ARCH"] == "Linux":
277     EXPORTS.mozilla.widget += ["LSBUtils.h"]
278     SOURCES += ["LSBUtils.cpp"]
280 if CONFIG["NS_PRINTING"]:
281     EXPORTS += [
282         "nsDeviceContextSpecProxy.h",
283         "nsPrintSettingsService.h",
284     ]
285     UNIFIED_SOURCES += [
286         "nsDeviceContextSpecProxy.cpp",
287         "nsPaper.cpp",
288         "nsPaperMargin.cpp",
289         "nsPrinterBase.cpp",
290         "nsPrinterListBase.cpp",
291         "nsPrintSettingsService.cpp",
292     ]
294     if toolkit in ("cocoa", "gtk"):
295         UNIFIED_SOURCES += [
296             "nsCUPSShim.cpp",
297             "nsPrinterCUPS.cpp",
298             "nsPrinterListCUPS.cpp",
299         ]
301 # nsBaseWidget.cpp needs to be built separately because of name clashes in the OS X headers
302 # nsBaseDragService.cpp moved out of UNIFIED to fix xgill crash (bug 1259850) after moving widget/ContentHelper -> apz/util/TouchActionHelper
303 SOURCES += [
304     "nsBaseDragService.cpp",
305     "nsBaseWidget.cpp",
306     "ScreenManager.cpp",
309 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
310     EXPORTS.mozilla += [
311         "WidgetTraceEvent.h",
312     ]
314 EXPORTS.ipc = [
315     "nsGUIEventIPC.h",
318 if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]:
319     DIRS += ["x11"]
321 if toolkit in {"gtk", "cocoa", "windows", "android", "uikit"}:
322     UNIFIED_SOURCES += [
323         "nsBaseFilePicker.cpp",
324     ]
326 if toolkit in ("gtk", "windows", "cocoa", "uikit", "android"):
327     UNIFIED_SOURCES += [
328         "nsNativeTheme.cpp",
329     ]
331 DEFINES["MOZ_CROSS_PROCESS_IME"] = True
333 include("/ipc/chromium/chromium-config.mozbuild")
335 LOCAL_INCLUDES += [
336     "/dom/base",
337     "/dom/ipc",
338     "/gfx/2d",
339     "/layout/base",
340     "/layout/forms",
341     "/layout/generic",
342     "/layout/painting",
343     "/layout/xul",
344     "/layout/xul/tree/",
345     "/view",
346     "/widget",
347     "/widget/headless",
350 # We use the CUPS headers on Cocoa and GTK, but on GTK we don't depend on there being system headers.
351 if toolkit == "gtk":
352     LOCAL_INCLUDES += ["/third_party/cups/include"]
354 if toolkit == "windows":
355     IPDL_SOURCES = [
356         "headless/HeadlessWidgetTypes.ipdlh",
357         "windows/PCompositorWidget.ipdl",
358         "windows/PlatformWidgetTypes.ipdlh",
359     ]
360 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
361     IPDL_SOURCES = [
362         "gtk/PCompositorWidget.ipdl",
363         "gtk/PlatformWidgetTypes.ipdlh",
364         "headless/HeadlessWidgetTypes.ipdlh",
365     ]
366 elif toolkit == "android":
367     IPDL_SOURCES = [
368         "android/PCompositorWidget.ipdl",
369         "android/PlatformWidgetTypes.ipdlh",
370         "headless/HeadlessWidgetTypes.ipdlh",
371     ]
372 else:
373     IPDL_SOURCES = [
374         "generic/PCompositorWidget.ipdl",
375         "generic/PlatformWidgetTypes.ipdlh",
376         "headless/HeadlessWidgetTypes.ipdlh",
377     ]
379 IPDL_SOURCES += [
380     "LookAndFeelTypes.ipdlh",
381     "PClipboardReadRequest.ipdl",
382     "PClipboardWriteRequest.ipdl",
385 LOCAL_INCLUDES += [
386     "/widget/%s" % toolkit,
388 FINAL_LIBRARY = "xul"
390 if CONFIG["MOZ_ENABLE_D3D10_LAYER"]:
391     DEFINES["MOZ_ENABLE_D3D10_LAYER"] = True
393 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
394     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
395 if CONFIG["MOZ_WAYLAND"]:
396     CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]