• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2020 The ANGLE Project Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4#
5# This file houses the build configuration for the ANGLE GL back-ends.
6
7import("../../../../gni/angle.gni")
8
9if (angle_has_build && ozone_platform_gbm) {
10  import("//build/config/linux/pkg_config.gni")
11}
12
13assert(angle_enable_gl)
14
15declare_args() {
16  angle_enable_gl_null = true
17}
18
19_gl_backend_sources = [
20  "BlitGL.cpp",
21  "BlitGL.h",
22  "BufferGL.cpp",
23  "BufferGL.h",
24  "ClearMultiviewGL.cpp",
25  "ClearMultiviewGL.h",
26  "CompilerGL.cpp",
27  "CompilerGL.h",
28  "ContextGL.cpp",
29  "ContextGL.h",
30  "DispatchTableGL_autogen.cpp",
31  "DispatchTableGL_autogen.h",
32  "DisplayGL.cpp",
33  "DisplayGL.h",
34  "FenceNVGL.cpp",
35  "FenceNVGL.h",
36  "FramebufferGL.cpp",
37  "FramebufferGL.h",
38  "FunctionsGL.cpp",
39  "FunctionsGL.h",
40  "ImageGL.cpp",
41  "ImageGL.h",
42  "MemoryObjectGL.cpp",
43  "MemoryObjectGL.h",
44  "ProgramGL.cpp",
45  "ProgramGL.h",
46  "ProgramPipelineGL.cpp",
47  "ProgramPipelineGL.h",
48  "QueryGL.cpp",
49  "QueryGL.h",
50  "RenderbufferGL.cpp",
51  "RenderbufferGL.h",
52  "RendererGL.cpp",
53  "RendererGL.h",
54  "SamplerGL.cpp",
55  "SamplerGL.h",
56  "SemaphoreGL.cpp",
57  "SemaphoreGL.h",
58  "ShaderGL.cpp",
59  "ShaderGL.h",
60  "StateManagerGL.cpp",
61  "StateManagerGL.h",
62  "SurfaceGL.cpp",
63  "SurfaceGL.h",
64  "SyncGL.cpp",
65  "SyncGL.h",
66  "TextureGL.cpp",
67  "TextureGL.h",
68  "TransformFeedbackGL.cpp",
69  "TransformFeedbackGL.h",
70  "VertexArrayGL.cpp",
71  "VertexArrayGL.h",
72  "formatutilsgl.cpp",
73  "formatutilsgl.h",
74  "functionsgl_enums.h",
75  "functionsgl_typedefs.h",
76  "renderergl_utils.cpp",
77  "renderergl_utils.h",
78]
79
80if (is_win) {
81  _gl_backend_sources += [
82    "../../../third_party/khronos/GL/wglext.h",
83    "wgl/ContextWGL.cpp",
84    "wgl/ContextWGL.h",
85    "wgl/D3DTextureSurfaceWGL.cpp",
86    "wgl/D3DTextureSurfaceWGL.h",
87    "wgl/DXGISwapChainWindowSurfaceWGL.cpp",
88    "wgl/DXGISwapChainWindowSurfaceWGL.h",
89    "wgl/DisplayWGL.cpp",
90    "wgl/DisplayWGL.h",
91    "wgl/FunctionsWGL.cpp",
92    "wgl/FunctionsWGL.h",
93    "wgl/PbufferSurfaceWGL.cpp",
94    "wgl/PbufferSurfaceWGL.h",
95    "wgl/RendererWGL.cpp",
96    "wgl/RendererWGL.h",
97    "wgl/SurfaceWGL.h",
98    "wgl/WindowSurfaceWGL.cpp",
99    "wgl/WindowSurfaceWGL.h",
100    "wgl/functionswgl_typedefs.h",
101    "wgl/wgl_utils.cpp",
102    "wgl/wgl_utils.h",
103  ]
104}
105
106if (angle_use_x11) {
107  _gl_backend_sources += [
108    "glx/DisplayGLX.cpp",
109    "glx/DisplayGLX.h",
110    "glx/FunctionsGLX.cpp",
111    "glx/FunctionsGLX.h",
112    "glx/PbufferSurfaceGLX.cpp",
113    "glx/PbufferSurfaceGLX.h",
114    "glx/PixmapSurfaceGLX.cpp",
115    "glx/PixmapSurfaceGLX.h",
116    "glx/RendererGLX.cpp",
117    "glx/RendererGLX.h",
118    "glx/SurfaceGLX.h",
119    "glx/WindowSurfaceGLX.cpp",
120    "glx/WindowSurfaceGLX.h",
121    "glx/functionsglx_typedefs.h",
122    "glx/glx_utils.cpp",
123    "glx/glx_utils.h",
124    "glx/platform_glx.h",
125  ]
126}
127
128if (is_android || is_linux || is_chromeos) {
129  _gl_backend_sources += [
130    "egl/ContextEGL.cpp",
131    "egl/ContextEGL.h",
132    "egl/DisplayEGL.cpp",
133    "egl/DisplayEGL.h",
134    "egl/DmaBufImageSiblingEGL.cpp",
135    "egl/DmaBufImageSiblingEGL.h",
136    "egl/ExternalImageSiblingEGL.h",
137    "egl/FunctionsEGL.cpp",
138    "egl/FunctionsEGL.h",
139    "egl/FunctionsEGLDL.cpp",
140    "egl/FunctionsEGLDL.h",
141    "egl/ImageEGL.cpp",
142    "egl/ImageEGL.h",
143    "egl/PbufferSurfaceEGL.cpp",
144    "egl/PbufferSurfaceEGL.h",
145    "egl/RendererEGL.cpp",
146    "egl/RendererEGL.h",
147    "egl/SurfaceEGL.cpp",
148    "egl/SurfaceEGL.h",
149    "egl/SyncEGL.cpp",
150    "egl/SyncEGL.h",
151    "egl/WindowSurfaceEGL.cpp",
152    "egl/WindowSurfaceEGL.h",
153    "egl/egl_utils.cpp",
154    "egl/egl_utils.h",
155    "egl/functionsegl_typedefs.h",
156  ]
157}
158
159if (ozone_platform_gbm) {
160  _gl_backend_sources += [
161    "egl/gbm/DisplayGbm.cpp",
162    "egl/gbm/DisplayGbm.h",
163    "egl/gbm/SurfaceGbm.cpp",
164    "egl/gbm/SurfaceGbm.h",
165  ]
166
167  pkg_config("libdrm") {
168    packages = [ "libdrm" ]
169  }
170}
171
172if (is_android) {
173  _gl_backend_sources += [
174    "egl/android/DisplayAndroid.cpp",
175    "egl/android/DisplayAndroid.h",
176    "egl/android/NativeBufferImageSiblingAndroid.cpp",
177    "egl/android/NativeBufferImageSiblingAndroid.h",
178  ]
179}
180
181if (angle_enable_cgl) {
182  _gl_backend_sources += [
183    "cgl/ContextCGL.cpp",
184    "cgl/ContextCGL.h",
185    "cgl/DeviceCGL.cpp",
186    "cgl/DeviceCGL.h",
187    "cgl/DisplayCGL.h",
188    "cgl/DisplayCGL.mm",
189    "cgl/IOSurfaceSurfaceCGL.cpp",
190    "cgl/IOSurfaceSurfaceCGL.h",
191    "cgl/PbufferSurfaceCGL.cpp",
192    "cgl/PbufferSurfaceCGL.h",
193    "cgl/RendererCGL.cpp",
194    "cgl/RendererCGL.h",
195    "cgl/WindowSurfaceCGL.h",
196    "cgl/WindowSurfaceCGL.mm",
197  ]
198}
199
200if (angle_enable_eagl) {
201  _gl_backend_sources += [
202    "eagl/ContextEAGL.cpp",
203    "eagl/ContextEAGL.h",
204    "eagl/DeviceEAGL.cpp",
205    "eagl/DeviceEAGL.h",
206    "eagl/DisplayEAGL.h",
207    "eagl/DisplayEAGL.mm",
208    "eagl/FunctionsEAGL.h",
209    "eagl/FunctionsEAGL.mm",
210    "eagl/IOSurfaceSurfaceEAGL.h",
211    "eagl/IOSurfaceSurfaceEAGL.mm",
212    "eagl/PbufferSurfaceEAGL.cpp",
213    "eagl/PbufferSurfaceEAGL.h",
214    "eagl/RendererEAGL.cpp",
215    "eagl/RendererEAGL.h",
216    "eagl/WindowSurfaceEAGL.h",
217    "eagl/WindowSurfaceEAGL.mm",
218  ]
219}
220
221if (angle_enable_gl_null) {
222  _gl_backend_sources += [
223    "null_functions.cpp",
224    "null_functions.h",
225  ]
226}
227
228config("angle_gl_backend_config") {
229  defines = [ "ANGLE_ENABLE_OPENGL" ]
230  if (angle_enable_gl_desktop) {
231    defines += [ "ANGLE_ENABLE_OPENGL_DESKTOP" ]
232  }
233  if (angle_enable_gl_null) {
234    defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
235  }
236  if (ozone_platform_gbm) {
237    defines += [ "ANGLE_USE_GBM" ]
238  }
239  if (is_apple) {
240    defines += [ "GL_SILENCE_DEPRECATION" ]
241  }
242  include_dirs = [ "../../../third_party/khronos" ]
243}
244
245angle_source_set("angle_gl_backend") {
246  sources = _gl_backend_sources
247
248  public_configs = [ ":angle_gl_backend_config" ]
249  public_deps = [ "$angle_root:libANGLE_headers" ]
250
251  deps = [
252    "$angle_root:angle_gpu_info_util",
253    "$angle_root:angle_image_util",
254  ]
255
256  if (is_win) {
257    deps += [ "$angle_root:angle_d3d_format_tables" ]
258  }
259
260  if (angle_use_x11) {
261    libs = [
262      "X11",
263      "Xi",
264      "Xext",
265    ]
266  }
267  if (is_android || is_linux || is_chromeos) {
268    deps += [ "$angle_root/src/common/linux:angle_dma_buf" ]
269  }
270  if (is_apple) {
271    frameworks = [
272      "IOSurface.framework",
273      "QuartzCore.framework",
274    ]
275    if (angle_enable_eagl) {
276      frameworks += [ "OpenGLES.framework" ]
277    } else if (angle_enable_cgl) {
278      frameworks += [ "OpenGL.framework" ]
279    }
280    if (is_mac) {
281      frameworks += [ "Cocoa.framework" ]
282    }
283  }
284  if (ozone_platform_gbm) {
285    public_configs += [ ":libdrm" ]
286    deps += [ "//third_party/minigbm" ]
287  }
288}
289