Bug 1728955: part 6) Log result of Windows' `OleSetClipboardResult`. r=masayuki
[gecko.git] / gfx / gl / moz.build
blob7ac6b0753a9ed63c59994e650f3c4162d67765e9
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 gl_provider = "Null"
9 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
10     gl_provider = "WGL"
11 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
12     gl_provider = "CGL"
13 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
14     gl_provider = "EAGL"
15 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
16     if CONFIG["MOZ_EGL_XRENDER_COMPOSITE"]:
17         gl_provider = "EGL"
18     else:
19         gl_provider = "GLX"
20 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
21     gl_provider = "EGL"
23 if CONFIG["MOZ_GL_PROVIDER"]:
24     gl_provider = CONFIG["MOZ_GL_PROVIDER"]
26 EXPORTS += [
27     "AndroidSurfaceTexture.h",
28     "DecomposeIntoNoRepeatTriangles.h",
29     "ForceDiscreteGPUHelperCGL.h",
30     "GfxTexturesReporter.h",
31     "GLBlitHelper.h",
32     "GLConsts.h",
33     "GLContext.h",
34     "GLContextEGL.h",
35     "GLContextProvider.h",
36     "GLContextProviderImpl.h",
37     "GLContextSymbols.h",
38     "GLContextTypes.h",
39     "GLDefs.h",
40     "GLLibraryEGL.h",
41     "GLLibraryLoader.h",
42     "GLReadTexImageHelper.h",
43     "GLScreenBuffer.h",
44     "GLTextureImage.h",
45     "GLTypes.h",
46     "GLUploadHelpers.h",
47     "HeapCopyOfStackArray.h",
48     "MozFramebuffer.h",
49     "ScopedGLHelpers.h",
50     "SharedSurface.h",
51     "SharedSurfaceEGL.h",
52     "SharedSurfaceGL.h",
53     "SurfaceTypes.h",
56 # Win32 is a special snowflake, for ANGLE
57 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
58     REQUIRES_UNIFIED_BUILD = True
59     EXPORTS += [
60         "GLContextWGL.h",
61         "SharedSurfaceANGLE.h",  # Needs <windows.h> for `HANDLE`.
62         "SharedSurfaceD3D11Interop.h",
63         "WGLLibrary.h",
64     ]
65     UNIFIED_SOURCES += [
66         "GLBlitHelperD3D.cpp",
67         "GLContextProviderWGL.cpp",
68         "SharedSurfaceANGLE.cpp",
69         "SharedSurfaceD3D11Interop.cpp",
70     ]
72 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
73     EXPORTS += [
74         "AndroidNativeWindow.h",
75         "SharedSurfaceAndroidHardwareBuffer.h",
76     ]
77     UNIFIED_SOURCES += [
78         "SharedSurfaceAndroidHardwareBuffer.cpp",
79     ]
81 if gl_provider == "CGL":
82     # These files include Mac headers that are unfriendly to unified builds
83     SOURCES += [
84         "GLContextProviderCGL.mm",
85     ]
86     EXPORTS += [
87         "GLContextCGL.h",
88         "SharedSurfaceIO.h",
89     ]
90     # SharedSurfaceIO.cpp includes MacIOSurface.h which include Mac headers
91     # which define Size and Point types in root namespace with often conflict with
92     # our own types. While I haven't actually hit this issue in the present case,
93     # it's been an issue in gfx/layers so let's not risk it.
94     SOURCES += [
95         "SharedSurfaceIO.cpp",
96     ]
97     OS_LIBS += [
98         "-framework IOSurface",
99     ]
101 elif gl_provider == "EAGL":
102     # These files include ObjC headers that are unfriendly to unified builds
103     SOURCES += [
104         "GLContextProviderEAGL.mm",
105     ]
106     EXPORTS += [
107         "GLContextEAGL.h",
108     ]
110 elif gl_provider == "GLX":
111     # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
112     # as it includes X11 headers which cause conflicts.
113     SOURCES += [
114         "GLContextProviderGLX.cpp",
115         "GLContextProviderX11.cpp",
116     ]
117     EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
119 if CONFIG["MOZ_WAYLAND"]:
120     SOURCES += ["GLContextProviderWayland.cpp", "SharedSurfaceDMABUF.cpp"]
122 UNIFIED_SOURCES += [
123     "AndroidSurfaceTexture.cpp",
124     "DecomposeIntoNoRepeatTriangles.cpp",
125     "GfxTexturesReporter.cpp",
126     "GLBlitHelper.cpp",
127     "GLContext.cpp",
128     "GLContextFeatures.cpp",
129     "GLContextProviderEGL.cpp",
130     "GLDebugUtils.cpp",
131     "GLLibraryEGL.cpp",
132     "GLLibraryLoader.cpp",
133     "GLReadTexImageHelper.cpp",
134     "GLTextureImage.cpp",
135     "GLUploadHelpers.cpp",
136     "MozFramebuffer.cpp",
137     "ScopedGLHelpers.cpp",
138     "SharedSurface.cpp",
139     "SharedSurfaceEGL.cpp",
140     "SharedSurfaceGL.cpp",
142 SOURCES += [
143     "GLScreenBuffer.cpp",
146 include("/ipc/chromium/chromium-config.mozbuild")
148 FINAL_LIBRARY = "xul"
150 if CONFIG["MOZ_D3DCOMPILER_VISTA_DLL"]:
151     DEFINES["MOZ_D3DCOMPILER_VISTA_DLL"] = CONFIG["MOZ_D3DCOMPILER_VISTA_DLL"]
153 CXXFLAGS += CONFIG["TK_CFLAGS"]
154 CFLAGS += CONFIG["TK_CFLAGS"]
156 CXXFLAGS += ["-Werror=switch"]
158 if CONFIG["MOZ_WAYLAND"]:
159     CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
160     CFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
162 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
163 LOCAL_INCLUDES += [
164     "/gfx/cairo/cairo/src",
167 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
168     CXXFLAGS += ["-Wno-error=shadow"]