• 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")
8import("gl_backend.gni")
9
10if (angle_has_build && ozone_platform_gbm) {
11  import("//build/config/linux/pkg_config.gni")
12}
13
14assert(angle_enable_gl)
15
16config("angle_gl_backend_config") {
17  defines = [ "ANGLE_ENABLE_OPENGL" ]
18  if (angle_enable_gl_desktop_backend) {
19    defines += [ "ANGLE_ENABLE_GL_DESKTOP_BACKEND" ]
20  }
21  if (angle_enable_gl_null) {
22    defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
23  }
24  if (ozone_platform_gbm) {
25    defines += [ "ANGLE_USE_GBM" ]
26  }
27  if (is_apple) {
28    if (angle_enable_cgl) {
29      defines += [
30        "GL_SILENCE_DEPRECATION",
31        "ANGLE_ENABLE_CGL",
32      ]
33    }
34    if (angle_enable_eagl) {
35      defines += [
36        "GLES_SILENCE_DEPRECATION",
37        "ANGLE_ENABLE_EAGL",
38      ]
39    }
40  }
41  if (angle_has_build && (is_linux || is_chromeos)) {
42    defines += [ "ANGLE_HAS_LIBDRM" ]
43  }
44  include_dirs = [ "../../../third_party/khronos" ]
45}
46
47angle_source_set("angle_gl_backend") {
48  sources = gl_backend_sources
49
50  public_configs = [ ":angle_gl_backend_config" ]
51  public_deps = [ "$angle_root:libANGLE_headers" ]
52
53  deps = [
54    "$angle_root:angle_gpu_info_util",
55    "$angle_root:angle_image_util",
56  ]
57
58  if (angle_has_build && (is_linux || is_chromeos)) {
59    deps += [ "//build/config/linux/libdrm" ]
60  }
61
62  if (is_win) {
63    deps += [ "$angle_root:angle_d3d_format_tables" ]
64  }
65
66  if (angle_use_x11) {
67    libs = [
68      "X11",
69      "Xi",
70      "Xext",
71    ]
72  }
73  if (is_android || is_linux || is_chromeos) {
74    deps += [ "$angle_root/src/common/linux:angle_dma_buf" ]
75  }
76  if (is_apple) {
77    frameworks = [
78      "IOSurface.framework",
79      "QuartzCore.framework",
80    ]
81    if (angle_enable_eagl) {
82      frameworks += [ "OpenGLES.framework" ]
83    } else if (angle_enable_cgl) {
84      frameworks += [ "OpenGL.framework" ]
85    }
86    if (is_mac) {
87      frameworks += [ "Cocoa.framework" ]
88    }
89  }
90}
91