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 } 35 if (angle_has_build && (is_linux || is_chromeos)) { 36 defines += [ "ANGLE_HAS_LIBDRM" ] 37 } 38 include_dirs = [ "../../../third_party/khronos" ] 39} 40 41angle_source_set("angle_gl_backend") { 42 sources = gl_backend_sources 43 44 public_configs = [ ":angle_gl_backend_config" ] 45 public_deps = [ "$angle_root:libANGLE_headers" ] 46 47 deps = [ 48 "$angle_root:angle_gpu_info_util", 49 "$angle_root:angle_image_util", 50 ] 51 52 if (angle_has_build && (is_linux || is_chromeos)) { 53 deps += [ "//build/config/linux/libdrm" ] 54 } 55 56 if (is_win) { 57 deps += [ "$angle_root:angle_d3d_format_tables" ] 58 } 59 60 if (angle_use_x11) { 61 libs = [ 62 "X11", 63 "Xi", 64 "Xext", 65 ] 66 } 67 if (is_android || is_linux || is_chromeos) { 68 deps += [ "$angle_root/src/common/linux:angle_dma_buf" ] 69 } 70 if (is_apple) { 71 frameworks = [ 72 "IOSurface.framework", 73 "QuartzCore.framework", 74 ] 75 if (angle_enable_cgl) { 76 frameworks += [ "OpenGL.framework" ] 77 } 78 if (is_mac) { 79 frameworks += [ "Cocoa.framework" ] 80 } 81 } 82} 83