gfx/gl/moz.build

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:e55b569cd427
1 # -*- Mode: python; c-basic-offset: 4; 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/.
6
7 gl_provider = 'Null'
8
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_GTK']:
14 if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']:
15 gl_provider = 'EGL'
16 else:
17 gl_provider = 'GLX'
18 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
19 gl_provider = 'GLX'
20 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
21 gl_provider = 'EGL'
22 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
23 gl_provider = 'EGL'
24
25 if CONFIG['MOZ_GL_PROVIDER']:
26 gl_provider = CONFIG['MOZ_GL_PROVIDER']
27
28 EXPORTS += [
29 'DecomposeIntoNoRepeatTriangles.h',
30 'ForceDiscreteGPUHelperCGL.h',
31 'GfxTexturesReporter.h',
32 'GLBlitTextureImageHelper.h',
33 'GLConsts.h',
34 'GLContext.h',
35 'GLContextEGL.h',
36 'GLContextProvider.h',
37 'GLContextProviderImpl.h',
38 'GLContextSymbols.h',
39 'GLContextTypes.h',
40 'GLDefs.h',
41 'GLLibraryEGL.h',
42 'GLLibraryLoader.h',
43 'GLReadTexImageHelper.h',
44 'GLScreenBuffer.h',
45 'GLSharedHandleHelpers.h',
46 'GLTextureImage.h',
47 'GLTypes.h',
48 'GLUploadHelpers.h',
49 'ScopedGLHelpers.h',
50 'SharedSurface.h',
51 'SharedSurfaceEGL.h',
52 'SharedSurfaceGL.h',
53 'SurfaceFactory.h',
54 'SurfaceStream.h',
55 'SurfaceTypes.h',
56 'TextureGarbageBin.h',
57 'VBOArena.h',
58 ]
59
60 if CONFIG['MOZ_X11']:
61 EXPORTS += [
62 'GLContextGLX.h',
63 'GLXLibrary.h',
64 ]
65
66 # Win32 is a special snowflake, for ANGLE
67 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
68 EXPORTS += [
69 'GLContextWGL.h',
70 'SharedSurfaceANGLE.h',
71 'WGLLibrary.h',
72 ]
73 UNIFIED_SOURCES += [
74 'GLContextProviderEGL.cpp',
75 'SharedSurfaceANGLE.cpp',
76 ]
77 if CONFIG['MOZ_ENABLE_SKIA_GPU']:
78 EXPORTS += ['SkiaGLGlue.h']
79 UNIFIED_SOURCES += [
80 'SkiaGLGlue.cpp',
81 ]
82
83 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
84 UNIFIED_SOURCES += ['SharedSurfaceGralloc.cpp']
85 EXPORTS += ['SharedSurfaceGralloc.h']
86 LOCAL_INCLUDES += ['/widget/gonk']
87 CXXFLAGS += ['-I%s/%s' % (CONFIG['ANDROID_SOURCE'], 'hardware/libhardware/include')]
88
89 if gl_provider == 'CGL':
90 # These files include Mac headers that are unfriendly to unified builds
91 SOURCES += [
92 "GLContextProviderCGL.mm",
93 "TextureImageCGL.mm"
94 ]
95 EXPORTS += [
96 'GLContextCGL.h',
97 'SharedSurfaceIO.h',
98 ]
99 # SharedSurfaceIO.cpp includes MacIOSurface.h which include Mac headers
100 # which define Size and Point types in root namespace with often conflict with
101 # our own types. While I haven't actually hit this issue in the present case,
102 # it's been an issue in gfx/layers so let's not risk it.
103 SOURCES += [
104 'SharedSurfaceIO.cpp',
105 ]
106 elif gl_provider == 'GLX':
107 # GLContextProviderGLX.cpp needs to be kept out of UNIFIED_SOURCES
108 # as it includes X11 headers which cause conflicts.
109 SOURCES += [
110 'GLContextProviderGLX.cpp',
111 ]
112 else:
113 UNIFIED_SOURCES += [
114 'GLContextProvider%s.cpp' % gl_provider,
115 ]
116
117 UNIFIED_SOURCES += [
118 'DecomposeIntoNoRepeatTriangles.cpp',
119 'GfxTexturesReporter.cpp',
120 'GLBlitHelper.cpp',
121 'GLBlitTextureImageHelper.cpp',
122 'GLContext.cpp',
123 'GLContextFeatures.cpp',
124 'GLContextTypes.cpp',
125 'GLDebugUtils.cpp',
126 'GLLibraryEGL.cpp',
127 'GLLibraryLoader.cpp',
128 'GLReadTexImageHelper.cpp',
129 'GLScreenBuffer.cpp',
130 'GLSharedHandleHelpers.cpp',
131 'GLTextureImage.cpp',
132 'GLUploadHelpers.cpp',
133 'ScopedGLHelpers.cpp',
134 'SharedSurface.cpp',
135 'SharedSurfaceEGL.cpp',
136 'SharedSurfaceGL.cpp',
137 'SurfaceFactory.cpp',
138 'SurfaceStream.cpp',
139 'SurfaceTypes.cpp',
140 'TextureGarbageBin.cpp',
141 'TextureImageEGL.cpp',
142 'VBOArena.cpp',
143 ]
144
145 FAIL_ON_WARNINGS = True
146
147 MSVC_ENABLE_PGO = True
148
149 include('/ipc/chromium/chromium-config.mozbuild')
150
151 FINAL_LIBRARY = 'xul'
152
153 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows' and CONFIG['MOZ_WEBGL']:
154 DEFINES['MOZ_D3DCOMPILER_DLL'] = CONFIG['MOZ_D3DCOMPILER_DLL']
155
156 if CONFIG['MOZ_ANDROID_OMTC']:
157 DEFINES['MOZ_ANDROID_OMTC'] = True

mercurial