Backed out 2 changesets (bug 1881078, bug 1879806) for causing dt failures @ devtools...
[gecko.git] / gfx / gl / moz.build
blobf45e85b8f4777e0b097438be0ecb42eeef9a94bd
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     gl_provider = "Linux"
17 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
18     gl_provider = "EGL"
20 if CONFIG["MOZ_GL_PROVIDER"]:
21     gl_provider = CONFIG["MOZ_GL_PROVIDER"]
23 EXPORTS += [
24     "AndroidSurfaceTexture.h",
25     "AutoMappable.h",
26     "Colorspaces.h",
27     "ForceDiscreteGPUHelperCGL.h",
28     "GfxTexturesReporter.h",
29     "GLBlitHelper.h",
30     "GLConsts.h",
31     "GLContext.h",
32     "GLContextEGL.h",
33     "GLContextProvider.h",
34     "GLContextProviderImpl.h",
35     "GLContextSymbols.h",
36     "GLContextTypes.h",
37     "GLDefs.h",
38     "GLLibraryEGL.h",
39     "GLLibraryLoader.h",
40     "GLReadTexImageHelper.h",
41     "GLScreenBuffer.h",
42     "GLTextureImage.h",
43     "GLTypes.h",
44     "GLUploadHelpers.h",
45     "HeapCopyOfStackArray.h",
46     "MozFramebuffer.h",
47     "ScopedGLHelpers.h",
48     "SharedSurface.h",
49     "SharedSurfaceEGL.h",
50     "SharedSurfaceGL.h",
51     "SurfaceTypes.h",
54 # Win32 is a special snowflake, for ANGLE
55 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
56     EXPORTS += [
57         "GLContextWGL.h",
58         "SharedSurfaceANGLE.h",  # Needs <windows.h> for `HANDLE`.
59         "SharedSurfaceD3D11Interop.h",
60         "WGLLibrary.h",
61     ]
62     UNIFIED_SOURCES += [
63         "GLBlitHelperD3D.cpp",
64         "GLContextProviderWGL.cpp",
65         "SharedSurfaceANGLE.cpp",
66         "SharedSurfaceD3D11Interop.cpp",
67     ]
69 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
70     EXPORTS += [
71         "AndroidNativeWindow.h",
72         "SharedSurfaceAndroidHardwareBuffer.h",
73     ]
74     UNIFIED_SOURCES += [
75         "SharedSurfaceAndroidHardwareBuffer.cpp",
76     ]
78 if gl_provider == "CGL":
79     # These files include Mac headers that are unfriendly to unified builds
80     SOURCES += [
81         "GLContextProviderCGL.mm",
82     ]
83     EXPORTS += [
84         "GLContextCGL.h",
85         "SharedSurfaceIO.h",
86     ]
87     # SharedSurfaceIO.cpp includes MacIOSurface.h which include Mac headers
88     # which define Size and Point types in root namespace with often conflict with
89     # our own types. While I haven't actually hit this issue in the present case,
90     # it's been an issue in gfx/layers so let's not risk it.
91     SOURCES += [
92         "SharedSurfaceIO.cpp",
93     ]
94     OS_LIBS += [
95         "-framework IOSurface",
96     ]
98 elif gl_provider == "EAGL":
99     # These files include ObjC headers that are unfriendly to unified builds
100     SOURCES += [
101         "GLContextProviderEAGL.mm",
102     ]
103     EXPORTS += [
104         "GLContextEAGL.h",
105     ]
107 elif gl_provider == "Linux":
108     # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
109     # as it includes X11 headers which cause conflicts.
110     SOURCES += [
111         "GLContextProviderLinux.cpp",
112         "SharedSurfaceDMABUF.cpp",
113     ]
114     EXPORTS += ["GLContextGLX.h", "GLXLibrary.h"]
115     if CONFIG["MOZ_X11"]:
116         SOURCES += ["GLContextProviderGLX.cpp"]
118 UNIFIED_SOURCES += [
119     "AndroidSurfaceTexture.cpp",
120     "Colorspaces.cpp",
121     "GfxTexturesReporter.cpp",
122     "GLBlitHelper.cpp",
123     "GLContext.cpp",
124     "GLContextFeatures.cpp",
125     "GLContextProviderEGL.cpp",
126     "GLDebugUtils.cpp",
127     "GLLibraryEGL.cpp",
128     "GLLibraryLoader.cpp",
129     "GLReadTexImageHelper.cpp",
130     "GLTextureImage.cpp",
131     "GLUploadHelpers.cpp",
132     "MozFramebuffer.cpp",
133     "ScopedGLHelpers.cpp",
134     "SharedSurface.cpp",
135     "SharedSurfaceEGL.cpp",
136     "SharedSurfaceGL.cpp",
138 SOURCES += [
139     "GLScreenBuffer.cpp",
142 TEST_DIRS += [
143     "gtest",
146 include("/ipc/chromium/chromium-config.mozbuild")
148 FINAL_LIBRARY = "xul"
150 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
151     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
152     CFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
154 CXXFLAGS += ["-Werror=switch"]
156 if CONFIG["MOZ_WAYLAND"]:
157     CXXFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
158     CFLAGS += CONFIG["MOZ_WAYLAND_CFLAGS"]
160 LOCAL_INCLUDES += CONFIG["SKIA_INCLUDES"]
161 LOCAL_INCLUDES += [
162     "/gfx/cairo/cairo/src",