Bug 1756130 [wpt PR 32898] - [CSP] Enhance unsafe-eval test to check both realms...
[gecko.git] / widget / moz.build
blob988f55de4605cb5d601ea70fccc5a1029d8be29a
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     "nsIPrintSession.idl",
123     "nsIPrintSettings.idl",
124     "nsIPrintSettingsService.idl",
125     "nsIScreen.idl",
126     "nsIScreenManager.idl",
127     "nsISharePicker.idl",
128     "nsISound.idl",
129     "nsISystemStatusBar.idl",
130     "nsITransferable.idl",
131     "nsIUserIdleService.idl",
132     "nsIUserIdleServiceInternal.idl",
135 XPIDL_MODULE = "widget"
137 EXPORTS += [
138     "GfxDriverInfo.h",
139     "GfxInfoBase.h",
140     "GfxInfoCollector.h",
141     "InputData.h",
142     "nsBaseAppShell.h",
143     "nsBaseDragService.h",
144     "nsBaseFilePicker.h",
145     "nsBaseScreen.h",
146     "nsBaseWidget.h",
147     "nsIDeviceContextSpec.h",
148     "nsIPrintDialogService.h",
149     "nsIRollupListener.h",
150     "nsIWidget.h",
151     "nsIWidgetListener.h",
152     "nsPaper.h",
153     "nsPrinterListBase.h",
154     "nsUserIdleService.h",
155     "nsWidgetInitData.h",
156     "nsWidgetsCID.h",
157     "PuppetWidget.h",
160 EXPORTS.mozilla += [
161     "BasicEvents.h",
162     "ColorScheme.h",
163     "CommandList.h",
164     "ContentCache.h",
165     "ContentData.h",
166     "ContentEvents.h",
167     "EventClassList.h",
168     "EventForwards.h",
169     "EventMessageList.h",
170     "FontRange.h",
171     "LookAndFeel.h",
172     "MiscEvents.h",
173     "MouseEvents.h",
174     "NativeKeyBindingsType.h",
175     "SwipeTracker.h",
176     "TextEventDispatcher.h",
177     "TextEventDispatcherListener.h",
178     "TextEvents.h",
179     "TextRange.h",
180     "TouchEvents.h",
181     "VsyncDispatcher.h",
182     "WidgetUtils.h",
185 EXPORTS.mozilla.widget += [
186     "CompositorWidget.h",
187     "IconLoader.h",
188     "IMEData.h",
189     "InProcessCompositorWidget.h",
190     "MediaKeysEventSourceFactory.h",
191     "NativeMenu.h",
192     "NativeMenuSupport.h",
193     "nsAutoRollup.h",
194     "nsXPLookAndFeel.h",
195     "PuppetBidiKeyboard.h",
196     "RemoteLookAndFeel.h",
197     "Screen.h",
198     "ScreenManager.h",
199     "TextRecognition.h",
200     "ThemeChangeKind.h",
201     "WidgetMessageUtils.h",
202     "WindowOcclusionState.h",
205 UNIFIED_SOURCES += [
206     "CompositorWidget.cpp",
207     "ContentCache.cpp",
208     "ContentData.cpp",
209     "GfxDriverInfo.cpp",
210     "GfxInfoBase.cpp",
211     "GfxInfoCollector.cpp",
212     "IconLoader.cpp",
213     "IMEData.cpp",
214     "InProcessCompositorWidget.cpp",
215     "InputData.cpp",
216     "nsAutoRollup.cpp",
217     "nsBaseAppShell.cpp",
218     "nsBaseScreen.cpp",
219     "nsClipboardHelper.cpp",
220     "nsClipboardProxy.cpp",
221     "nsColorPickerProxy.cpp",
222     "nsContentProcessWidgetFactory.cpp",
223     "nsDragServiceProxy.cpp",
224     "nsFilePickerProxy.cpp",
225     "nsHTMLFormatConverter.cpp",
226     "nsIWidgetListener.cpp",
227     "nsPrimitiveHelpers.cpp",
228     "nsPrintSettingsImpl.cpp",
229     "nsSoundProxy.cpp",
230     "nsTransferable.cpp",
231     "nsUserIdleService.cpp",
232     "nsXPLookAndFeel.cpp",
233     "PuppetBidiKeyboard.cpp",
234     "PuppetWidget.cpp",
235     "RemoteLookAndFeel.cpp",
236     "Screen.cpp",
237     "ScrollbarDrawing.cpp",
238     "ScrollbarDrawingAndroid.cpp",
239     "ScrollbarDrawingCocoa.cpp",
240     "ScrollbarDrawingGTK.cpp",
241     "ScrollbarDrawingWin.cpp",
242     "ScrollbarDrawingWin11.cpp",
243     "SharedWidgetUtils.cpp",
244     "SwipeTracker.cpp",
245     "TextEventDispatcher.cpp",
246     "TextRecognition.cpp",
247     "Theme.cpp",
248     "ThemeCocoa.cpp",
249     "ThemeColors.cpp",
250     "ThemeDrawing.cpp",
251     "TouchResampler.cpp",
252     "VsyncDispatcher.cpp",
253     "WidgetEventImpl.cpp",
254     "WidgetUtils.cpp",
257 if CONFIG["OS_ARCH"] == "Linux":
258     EXPORTS.mozilla.widget += ["LSBUtils.h"]
259     SOURCES += ["LSBUtils.cpp"]
261 if CONFIG["NS_PRINTING"]:
262     EXPORTS += [
263         "nsDeviceContextSpecProxy.h",
264         "nsPrintSettingsService.h",
265     ]
266     UNIFIED_SOURCES += [
267         "nsDeviceContextSpecProxy.cpp",
268         "nsPaper.cpp",
269         "nsPaperMargin.cpp",
270         "nsPrinterBase.cpp",
271         "nsPrinterListBase.cpp",
272         "nsPrintSession.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"]:
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" and CONFIG["MOZ_X11"]:
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