Bug 1799258 - Share all-of-dcomp.h preamble, and deal with outdated mingw dcomp.h...
[gecko.git] / gfx / thebes / moz.build
blob9a87ea6aa0b082a8268b7e62638a409ef24e4f9a
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("*Text*"):
8     BUG_COMPONENT = ("Core", "Graphics: Text")
10 with Files("*DWrite*"):
11     BUG_COMPONENT = ("Core", "Graphics: Text")
13 XPIDL_SOURCES += [
14     "nsIFontLoadCompleteCallback.idl",
17 XPIDL_MODULE = "gfx"
19 EXPORTS += [
20     "COLRFonts.h",
21     "DrawMode.h",
22     "gfx2DGlue.h",
23     "gfxAlphaRecovery.h",
24     "gfxASurface.h",
25     "gfxBaseSharedMemorySurface.h",
26     "gfxBlur.h",
27     "gfxColor.h",
28     "gfxContext.h",
29     "gfxDrawable.h",
30     "gfxEnv.h",
31     "gfxFailure.h",
32     "gfxFont.h",
33     "gfxFontConstants.h",
34     "gfxFontEntry.h",
35     "gfxFontFeatures.h",
36     "gfxFontInfoLoader.h",
37     "gfxFontPrefLangList.h",
38     "gfxFontSrcPrincipal.h",
39     "gfxFontSrcURI.h",
40     "gfxFontUtils.h",
41     "gfxFontVariations.h",
42     "gfxGradientCache.h",
43     "gfxImageSurface.h",
44     "gfxLineSegment.h",
45     "gfxMathTable.h",
46     "gfxMatrix.h",
47     "gfxOTSUtils.h",
48     "gfxPattern.h",
49     "gfxPlatform.h",
50     "gfxPlatformFontList.h",
51     "gfxPlatformWorker.h",
52     "gfxPoint.h",
53     "gfxQuad.h",
54     "gfxQuaternion.h",
55     "gfxRect.h",
56     "gfxSharedImageSurface.h",
57     "gfxSkipChars.h",
58     "gfxSVGGlyphs.h",
59     "gfxTextRun.h",
60     "gfxTypes.h",
61     "gfxUserFontSet.h",
62     "gfxUtils.h",
63     "SharedFontList.h",
64     "SoftwareVsyncSource.h",
65     "ThebesRLBoxTypes.h",
66     "VsyncSource.h",
69 EXPORTS.mozilla.gfx += [
70     "AllOfDcomp.h",
71     "D3D11Checks.h",
72     "DeviceManagerDx.h",
73     "DisplayConfigWindows.h",
74     "PrintPromise.h",
75     "PrintTarget.h",
76     "PrintTargetThebes.h",
77     "ThebesRLBox.h",
80 EXPORTS.mozilla.gfx += ["SkMemoryReporter.h"]
82 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
83     EXPORTS += [
84         "gfxAndroidPlatform.h",
85         "gfxFT2FontBase.h",
86         "gfxFT2Fonts.h",
87     ]
88     EXPORTS.mozilla.gfx += [
89         "PrintTargetPDF.h",
90     ]
91     SOURCES += [
92         "gfxAndroidPlatform.cpp",
93         "gfxFT2FontBase.cpp",
94         "gfxFT2FontList.cpp",
95         "gfxFT2Fonts.cpp",
96         "gfxFT2Utils.cpp",
97         "PrintTargetPDF.cpp",
98     ]
99 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
100     EXPORTS += [
101         "gfxMacUtils.h",
102         "gfxPlatformMac.h",
103         "gfxQuartzNativeDrawing.h",
104         "gfxQuartzSurface.h",
105     ]
106     EXPORTS.mozilla.gfx += [
107         "PrintTargetCG.h",
108     ]
109     SOURCES += [
110         "gfxCoreTextShaper.cpp",
111         "gfxMacFont.cpp",
112         "gfxMacUtils.cpp",
113         "gfxPlatformMac.cpp",
114         "gfxQuartzNativeDrawing.cpp",
115         "gfxQuartzSurface.cpp",
116         "PrintTargetCG.mm",
117     ]
118 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
119     EXPORTS += [
120         "gfxFT2FontBase.h",
121         "gfxPlatformGtk.h",
122     ]
123     EXPORTS.mozilla.gfx += [
124         "PrintTargetPDF.h",
125     ]
126     SOURCES += [
127         "gfxFcPlatformFontList.cpp",
128         "gfxFT2FontBase.cpp",
129         "gfxFT2Utils.cpp",
130         "gfxPlatformGtk.cpp",
131         "PrintTargetPDF.cpp",
132     ]
134     if CONFIG["MOZ_X11"]:
135         EXPORTS += [
136             "gfxXlibSurface.h",
137         ]
138         EXPORTS.mozilla.gfx += [
139             "XlibDisplay.h",
140         ]
141         SOURCES += [
142             "gfxXlibSurface.cpp",
143             "XlibDisplay.cpp",
144         ]
146 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
147     REQUIRES_UNIFIED_BUILD = True
148     EXPORTS += [
149         "gfxDWriteCommon.h",
150         "gfxDWriteFonts.h",
151         "gfxGDIFont.h",
152         "gfxGDIFontList.h",
153         "gfxWindowsNativeDrawing.h",
154         "gfxWindowsPlatform.h",
155         "gfxWindowsSurface.h",
156     ]
157     EXPORTS.mozilla.gfx += [
158         "PrintTargetPDF.h",
159         "PrintTargetWindows.h",
160     ]
161     SOURCES += [
162         "DisplayConfigWindows.cpp",
163         "gfxDWriteCommon.cpp",
164         "gfxDWriteFonts.cpp",
165         "gfxGDIFont.cpp",
166         "gfxGDIFontList.cpp",
167         "gfxWindowsNativeDrawing.cpp",
168         "gfxWindowsPlatform.cpp",
169         "gfxWindowsSurface.cpp",
170         "PrintTargetPDF.cpp",
171         "PrintTargetWindows.cpp",
172     ]
173     UNIFIED_SOURCES += [
174         "gfxDWriteFontList.cpp",
175     ]
177 # Are we targeting x86 or x64?  If so, build gfxAlphaRecoverySSE2.cpp.
178 if CONFIG["INTEL_ARCHITECTURE"]:
179     SOURCES += ["gfxAlphaRecoverySSE2.cpp"]
180     # The file uses SSE2 intrinsics, so it needs special compile flags on some
181     # compilers.
182     SOURCES["gfxAlphaRecoverySSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
184 SOURCES += [
185     # Includes mac system header conflicting with point/size,
186     # and includes glxXlibSurface.h which drags in Xrender.h
187     "gfxASurface.cpp",
188     # on X11, gfxDrawable.cpp includes X headers for an old workaround which
189     # we could consider removing soon (affects Ubuntus older than 10.04 LTS)
190     # which currently prevent it from joining UNIFIED_SOURCES.
191     "gfxDrawable.cpp",
192     # gfxFontUtils.cpp and gfxPlatform.cpp include mac system header conflicting with point/size
193     "gfxFontUtils.cpp",
194     "gfxPlatform.cpp",
195     "PrintTarget.cpp",
196     "PrintTargetThebes.cpp",
199 UNIFIED_SOURCES += [
200     "CJKCompatSVS.cpp",
201     "COLRFonts.cpp",
202     "gfxAlphaRecovery.cpp",
203     "gfxBaseSharedMemorySurface.cpp",
204     "gfxBlur.cpp",
205     "gfxContext.cpp",
206     "gfxFont.cpp",
207     "gfxFontEntry.cpp",
208     "gfxFontFeatures.cpp",
209     "gfxFontInfoLoader.cpp",
210     "gfxFontMissingGlyphs.cpp",
211     "gfxFontSrcPrincipal.cpp",
212     "gfxFontSrcURI.cpp",
213     "gfxGlyphExtents.cpp",
214     "gfxGradientCache.cpp",
215     "gfxGraphiteShaper.cpp",
216     "gfxHarfBuzzShaper.cpp",
217     "gfxImageSurface.cpp",
218     "gfxMathTable.cpp",
219     "gfxPattern.cpp",
220     "gfxPlatformFontList.cpp",
221     "gfxPlatformWorker.cpp",
222     "gfxScriptItemizer.cpp",
223     "gfxSkipChars.cpp",
224     "gfxSVGGlyphs.cpp",
225     "gfxTextRun.cpp",
226     "gfxUserFontSet.cpp",
227     "gfxUtils.cpp",
228     "SharedFontList.cpp",
229     "SoftwareVsyncSource.cpp",
230     "VsyncSource.cpp",
233 UNIFIED_SOURCES += [
234     "SkMemoryReporter.cpp",
237 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
238     UNIFIED_SOURCES += [
239         "gfxMacPlatformFontList.mm",
240     ]
241 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
242     UNIFIED_SOURCES += [
243         "D3D11Checks.cpp",
244     ]
245     SOURCES += [
246         "DeviceManagerDx.cpp",
247     ]
249 if CONFIG["MOZ_ENABLE_SKIA_PDF"]:
250     EXPORTS.mozilla.gfx += [
251         "PrintTargetSkPDF.h",
252     ]
253     SOURCES += [
254         "PrintTargetSkPDF.cpp",
255     ]
257 # We use ICU for normalization functions:
258 USE_LIBS += [
259     "icu",
262 include("/ipc/chromium/chromium-config.mozbuild")
264 FINAL_LIBRARY = "xul"
266 LOCAL_INCLUDES += [
267     "!/security/rlbox",
268     "/dom/base",
269     "/dom/media/platforms/apple",
270     "/dom/xml",
271     "/gfx/cairo/cairo/src",
272     "/widget/gtk",
275 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android", "gtk"):
276     DEFINES["MOZ_ENABLE_FREETYPE"] = True
278 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
279     for var in ("MOZ_ENABLE_D3D10_LAYER",):
280         if CONFIG[var]:
281             DEFINES[var] = True
283 if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("android"):
284     CXXFLAGS += CONFIG["CAIRO_FT_CFLAGS"]
286 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
287     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
288     CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
289     CXXFLAGS += CONFIG["MOZ_PANGO_CFLAGS"]
291 if CONFIG["MOZ_WAYLAND"]:
292     CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
294 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
296 DEFINES["GRAPHITE2_STATIC"] = True
298 CXXFLAGS += ["-Werror=switch"]
300 include("/tools/fuzzing/libfuzzer-config.mozbuild")