# Copyright 2019 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# import the ozone_platform_x11 variable
import("gni/angle.gni")
if (angle_enable_vulkan) {
  import("//build_overrides//vulkan_headers.gni")
}
if (angle_use_wayland) {
  import("//build_overrides/wayland.gni")
}
if (angle_enable_wgpu) {
  import("//build_overrides/dawn.gni")
  import("//build_overrides/tint.gni")
}
if (angle_has_build) {
  import("//build/config/linux/pkg_config.gni")
  import("//build/config/sanitizers/sanitizers.gni")
  import("//build/config/ui.gni")
  import("//testing/libfuzzer/fuzzer_test.gni")

  if (is_android) {
    # android/rules.gni can only be imported for Android targets
    import("//build/config/android/config.gni")
    import("//build/config/android/rules.gni")
    import("android/angle_apk.gni")
  }
} else {
  using_sanitizer = false
}

declare_args() {
  # Use the PCI lib to collect GPU information on Linux.
  use_libpci = (is_linux || is_chromeos) && (angle_use_x11 || use_ozone) &&
               angle_has_build

  # Enable using Vulkan to collect system info as a fallback.
  angle_enable_vulkan_system_info = false

  # Link in system libGL, to work with apitrace.  See doc/DebuggingTips.md.
  angle_link_glx = false

  # Don't build extra (test, samples etc) for Windows UWP. We don't have
  # infrastructure (e.g. windowing helper functions) in place to run them.
  # Also don't build them with MSVC, because tests and unused dependencies
  # often have problems building with it, e.g. for C++20.
  angle_build_all = !build_with_chromium && !angle_is_winuwp &&
                    !angle_is_msvc && angle_has_build && angle_build_tests

  # Enable generating current commit information using git
  angle_enable_commit_id = true

  # Abseil has trouble supporting MSVC, particularly regarding component builds.
  # http://crbug.com/1126524
  angle_enable_abseil = angle_has_build && is_clang

  # Adds run-time checks to filter out EVENT() messages when the debug annotator is disabled.
  angle_enable_annotator_run_time_checks = false

  # Enables non-conformant extensions and features
  angle_expose_non_conformant_extensions_and_versions = false

  # Optional feature that forces dirty state whenever we use a new context regardless of thread.
  angle_force_context_check_every_call = false

  # Allow shared library custom name extensions for setting soname such as libEGL.so.1
  angle_egl_extension = ""
  angle_glesv2_extension = ""

  # Enable share context lock. If it is false, the client need to use gl calls in a threadsafe way.
  angle_enable_share_context_lock =
      !build_with_chromium || build_angle_deqp_tests

  if (is_android) {
    # Use Android TLS slot to store current context.
    angle_use_android_tls_slot = !build_with_chromium
  }

  angle_enable_global_mutex_recursion =
      is_android && angle_enable_vulkan && !build_with_chromium

  # Potentially can be enabled for other platforms, but limiting to Android platform for now.
  # Chromium may have problems (requires verification), disabled for safety.
  angle_enable_global_mutex_load_time_allocate =
      is_android && !build_with_chromium

  angle_enable_context_mutex = true

  # Prefix where the artifacts should be installed on the system
  install_prefix = ""
}

declare_args() {
  # May need to enable to fix recursion when vkAcquireNextImageKHR() returns back to ANGLE from
  # eglClientWaitSyncKHR(). May happen if Android Presentation Engine uses
  # EGL_KHR_fence_sync instead of EGL_ANDROID_native_fence_sync for synchronization.
  # To check call: adb shell "dumpsys SurfaceFlinger | grep 'Sync configuration'"
  # The Android's "testDrawingHardwareBitmapNotLeaking" test may be used for testing.
  # Disable this option to save performance on platforms that does not require recursion.
  angle_enable_context_mutex_recursion = angle_enable_global_mutex_recursion
}

if (angle_build_all) {
  group("all") {
    testonly = true
    deps = [
      ":angle",
      ":angle_shader_translator",
      ":translator_fuzzer",
      ":xxhash_fuzzer",
      "$angle_root/samples:angle_samples",
      "$angle_root/src/tests:angle_tests",
    ]
    if (angle_enable_cl) {
      deps += [ "$angle_root/src/libOpenCL:angle_cl" ]
    }
    if (angle_enable_cl && angle_enable_vulkan) {
      # OpenCL through Vulkan in ANGLE requires clspv for online compiler
      deps += [ "$angle_clspv_dir:clspv" ]
    }
    if (angle_build_mesa) {
      deps += [ "$angle_root/third_party/mesa" ]
    }
  }
}

if (build_angle_end2end_tests_aosp) {
  group("angle_end2end_tests_aosp") {
    testonly = true
    deps = [ "src/tests:angle_end2end_tests" ]
  }
}

import("src/angle_program_serialize_data_version.gni")
import("src/compiler.gni")
import("src/libGLESv2.gni")

# This config is exported to dependent targets (and also applied to internal
# ones).
config("external_config") {
  include_dirs = [ "include" ]
}

# Prevent the GL headers from redeclaring ANGLE entry points.
config("no_gl_prototypes") {
  defines = [
    "GL_GLES_PROTOTYPES=0",
    "EGL_EGL_PROTOTYPES=0",
  ]
}

config("gl_prototypes") {
  defines = [
    "GL_GLES_PROTOTYPES=1",
    "EGL_EGL_PROTOTYPES=1",
    "GL_GLEXT_PROTOTYPES",
    "EGL_EGLEXT_PROTOTYPES",
  ]
}

# This config is applied to internal Angle targets (not pushed to dependents).
config("internal_config") {
  include_dirs = [
    "include",
    "src",
  ]

  defines = []

  if (is_win) {
    defines += [ "ANGLE_IS_WIN" ]
    if (angle_is_winuwp) {
      defines += [ "ANGLE_IS_WINUWP" ]
    }
    if (angle_is_winappsdk) {
      defines += [ "ANGLE_IS_WINAPPSDK" ]
    }
  } else if (is_linux || is_chromeos) {
    defines += [ "ANGLE_IS_LINUX" ]
  }

  if (angle_enable_share_context_lock) {
    defines += [ "ANGLE_ENABLE_SHARE_CONTEXT_LOCK=1" ]
  }

  if (is_android) {
    if (angle_use_android_tls_slot) {
      defines += [ "ANGLE_USE_ANDROID_TLS_SLOT=1" ]
    }
  }

  if (angle_enable_global_mutex_recursion) {
    defines += [ "ANGLE_ENABLE_GLOBAL_MUTEX_RECURSION=1" ]
  }

  if (angle_enable_global_mutex_load_time_allocate) {
    defines += [ "ANGLE_ENABLE_GLOBAL_MUTEX_LOAD_TIME_ALLOCATE=1" ]
  }

  if (angle_enable_context_mutex && angle_enable_share_context_lock &&
      !angle_force_context_check_every_call) {
    defines += [ "ANGLE_ENABLE_CONTEXT_MUTEX=1" ]
  }

  if (angle_enable_context_mutex_recursion) {
    defines += [ "ANGLE_ENABLE_CONTEXT_MUTEX_RECURSION=1" ]
  }

  # Enables debug/trace-related functionality, including logging every GLES/EGL API command to the
  # "angle_debug.txt" file on desktop.  Enables debug markers for AGI, but must also set
  # angle_enable_annotator_run_time_checks to improve performance.
  if (angle_enable_trace) {
    defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ]
  }

  # When used with angle_enable_trace, enables logging every GLES/EGL API command to Android logcat
  # Enables debug markers for AGI regardless of run-time checks.
  if (angle_enable_trace_android_logcat) {
    defines += [ "ANGLE_ENABLE_TRACE_ANDROID_LOGCAT=1" ]
  }

  # When used with angle_enable_trace, enables logging every GLES/EGL API command to the terminal
  if (angle_enable_trace_events) {
    defines += [ "ANGLE_ENABLE_TRACE_EVENTS=1" ]
  }

  # Output `INFO`-level logs and up.
  if (angle_always_log_info) {
    defines += [ "ANGLE_ALWAYS_LOG_INFO" ]
  }

  # Enables pipeline cache graph dump functionality.
  # The dump path must have appropriate permissions for this to work.
  if (angle_dump_pipeline_cache_graph) {
    defines += [ "ANGLE_DUMP_PIPELINE_CACHE_GRAPH=1" ]
  }

  # Checks that unwind backtrace support for Android is enabled only for debug mode.
  assert(is_debug || !angle_enable_unwind_backtrace_support)

  if (is_chromeos) {
    defines += [ "ANGLE_PLATFORM_CHROMEOS" ]
  }

  if (is_ggp) {
    defines += [ "__ggp__" ]
  }

  if (angle_use_vulkan_null_display) {
    defines += [ "ANGLE_USE_VULKAN_NULL_DISPLAY" ]
  } else if (angle_use_vulkan_display) {
    defines += [ "ANGLE_USE_VULKAN_DISPLAY" ]
    if (!angle_use_x11) {
      defines += [ "EGL_NO_X11" ]
    }

    # These two are needed here to correctly select OSWindow::New
    if (angle_use_x11) {
      defines += [ "ANGLE_USE_X11" ]
    }
    if (angle_use_wayland) {
      defines += [ "ANGLE_USE_WAYLAND" ]
    }

    if (angle_vulkan_display_mode == "simple") {
      defines += [ "ANGLE_VULKAN_DISPLAY_MODE_SIMPLE" ]
    } else if (angle_vulkan_display_mode == "headless") {
      defines += [ "ANGLE_VULKAN_DISPLAY_MODE_HEADLESS" ]
    } else if (angle_vulkan_display_mode == "offscreen") {
      defines += [ "ANGLE_VULKAN_DISPLAY_MODE_OFFSCREEN" ]
    } else {
      assert(false)
    }
  }

  if (is_lsan) {
    defines += [ "ANGLE_WITH_LSAN" ]
  }

  if (angle_has_astc_encoder) {
    defines += [ "ANGLE_HAS_ASTCENC" ]
  }

  if (angle_test_enable_system_egl) {
    defines += [ "ANGLE_TEST_ENABLE_SYSTEM_EGL" ]
  }

  if (angle_debug_layers_enabled) {
    defines += [ "ANGLE_DEBUG_LAYERS_ENABLED" ]
  }

  if (angle_build_mesa) {
    defines += [ "ANGLE_HAS_MESA" ]
  }

  if (angle_standalone || build_with_chromium) {
    defines += [ "ANGLE_OUTSIDE_WEBKIT" ]
  }

  if (is_win && build_with_chromium) {
    defines += [ "ANGLE_WINDOWS_NO_FUTEX=1" ]
  }

  if (angle_enable_cl) {
    defines += [ "ANGLE_ENABLE_CL" ]
  }
}

config("constructor_and_destructor_warnings") {
  if (is_clang) {
    cflags = [
      "-Wexit-time-destructors",
      "-Wglobal-constructors",
    ]
  }
}

config("extra_warnings") {
  cflags = []

  is_gcc = !is_clang && !is_win

  # Avoid failing builds for warnings enabled by Skia build.
  if (defined(is_skia_standalone)) {
    cflags += [ "-w" ]
  }

  # Enable more default warnings on Windows.
  if (is_win) {
    cflags += [
      "/we4244",  # Conversion: possible loss of data.
      "/we4312",  # Conversion: greater size.
      "/we4456",  # Variable shadowing.
      "/we4458",  # declaration hides class member.
      "/we4715",  # not all control paths return a value
      "/we4800",  # forcing value to bool.
      "/we4838",  # narrowing conversion.
    ]
  }
  if (is_clang) {
    cflags += [
      "-Wbad-function-cast",
      "-Wconditional-uninitialized",
      "-Wextra-semi-stmt",
      "-Wfloat-conversion",
      "-Winconsistent-missing-destructor-override",
      "-Wmissing-field-initializers",
      "-Wnewline-eof",
      "-Wnon-virtual-dtor",
      "-Wredundant-parens",
      "-Wreturn-std-move",
      "-Wshadow",
      "-Wshadow-field",
      "-Wtautological-type-limit-compare",
      "-Wundefined-reinterpret-cast",
      "-Wunneeded-internal-declaration",
      "-Wunused-but-set-variable",
      "-Wsuggest-destructor-override",
      "-Wsuggest-override",

      # The below warnings are used by WebKit. We enable them to make rolling
      # ANGLE in WebKit easier.
      "-Wparentheses",
      "-Wrange-loop-analysis",
      "-Wstrict-prototypes",
      "-Wunreachable-code-aggressive",
      "-Wshorten-64-to-32",
    ]
  }

  if (is_gcc) {
    cflags_cc = [ "-Wdeprecated-copy" ]
  }

  if (angle_is_winuwp) {
    cflags += [
      "/wd4091",  # keyword ignored on left of type when no variable is declared
      "/wd4447",  # 'main' signature found without threading model.
    ]
  }
}

# This config adds build-ids to the associated library.
# -Wl is a special option that indicates that clang should pass the associated
# option --build-id to the linker. This will cause a build-id section to be added
# to the associated library. The build-id makes it possible for a debugger to
# find the right symbol file to use.
config("build_id_config") {
  ldflags = [ "-Wl,--build-id" ]
}

_use_copy_compiler_dll = angle_has_build && is_win

if (_use_copy_compiler_dll) {
  copy("copy_compiler_dll") {
    sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ]
    outputs = [ "$root_out_dir/{{source_file_part}}" ]
  }
}

# Holds the shared includes so we only need to list them once.
config("includes_config") {
  include_dirs = [ "include" ]
}

config("angle_uwp_env") {
  if (angle_is_winuwp && !angle_is_winappsdk) {
    defines = [ "WINAPI_FAMILY=WINAPI_FAMILY_PC_APP" ]
  }
}

angle_source_set("cl_includes") {
  sources = cl_includes
  public_configs = [ ":external_config" ]
}

angle_source_set("includes") {
  sources = libangle_includes
  public_configs = [ ":includes_config" ]
  if (angle_enable_cl) {
    public_deps = [ ":cl_includes" ]
  }
}

config("disable_unreachable_code_break_warning") {
  if (is_clang) {
    cflags = [ "-Wno-unreachable-code-break" ]
  }
}

angle_static_library("preprocessor") {
  sources = angle_preprocessor_sources

  # preprocessor_tab_autogen.cpp contains an instance of this.
  configs += [ ":disable_unreachable_code_break_warning" ]

  public_deps = [
    ":angle_common",
    ":angle_translator_headers",
  ]
}

config("angle_disable_pool_alloc") {
  defines = [ "ANGLE_DISABLE_POOL_ALLOC" ]
}

config("debug_annotations_config") {
  defines = []
  if (is_debug) {
    defines += [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
  }
  if (angle_enable_annotator_run_time_checks) {
    # When used with angle_enable_trace, enables debug markers for AGI with run-time checks to
    # filter out EVENT() messages when the debug annotator is disabled.
    defines += [ "ANGLE_ENABLE_ANNOTATOR_RUN_TIME_CHECKS" ]
  }
}

config("angle_asserts_config") {
  if (angle_assert_always_on) {
    defines = [ "ANGLE_ASSERT_ALWAYS_ON" ]
  }
}

config("angle_common_config") {
  include_dirs = [
    "src/common/base",
    "src/common/third_party/xxhash",
  ]
  libs = []
  if (is_android) {
    libs += [ "log" ]
  }

  if (is_win && !angle_is_winuwp && !build_with_chromium) {
    # Needed for futex support
    libs += [ "synchronization.lib" ]
  }

  defines = []
  if (angle_delegate_workers) {
    defines += [ "ANGLE_DELEGATE_WORKERS=1" ]
  }
}

# Silences the "indirect call of a function with wrong dynamic type" cfi error
config("angle_no_cfi_icall") {
  if (is_cfi && use_cfi_icall && current_toolchain == default_toolchain) {
    cflags = [ "-fno-sanitize=cfi-icall" ]
  }
}

# Silences the "cast from void* or another unrelated type to the wrong dynamic type" cfi error
config("angle_no_cfi_unrelated_cast") {
  if (is_cfi && use_cfi_cast && current_toolchain == default_toolchain) {
    cflags = [ "-fno-sanitize=cfi-unrelated-cast" ]
  }
}

angle_source_set("xxhash") {
  sources = xxhash_sources
  if (is_clang) {
    cflags_c = [ "-Wno-implicit-fallthrough" ]
  }
}

if (angle_has_build) {
  fuzzer_test("xxhash_fuzzer") {
    sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ]
    deps = [ ":xxhash" ]
  }
}

template("angle_common_lib") {
  angle_static_library(target_name) {
    sources = invoker.sources

    configs += [
      ":angle_common_config",
      ":debug_annotations_config",
    ]

    deps = [ ":xxhash" ]

    public_deps = [
      ":angle_abseil",
      ":includes",
    ]
    public_configs += [ ":angle_common_config" ]
    if (angle_has_build && use_fuzzing_engine) {
      all_dependent_configs = [ ":angle_disable_pool_alloc" ]
    }

    if (is_linux || is_chromeos) {
      libs = [ "dl" ]
    }

    if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
      # In API level 26 ANativeWindow APIs were moved from libandroid.so
      # into a separate library, libnativewindow.so
      if (ndk_api_level_at_least_26) {
        libs = [ "nativewindow" ]
      } else {
        libs = [ "android" ]
      }
    }

    if (angle_expose_non_conformant_extensions_and_versions) {
      defines = [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ]
    }

    if (using_sanitizer && !build_with_chromium) {
      data_deps =
          [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ]
    }

    if (is_apple) {
      frameworks = [ "Metal.framework" ]
    }
  }
}

angle_common_lib("angle_common") {
  sources = libangle_common_sources
  if (angle_enable_cl) {
    sources += libangle_common_cl_sources
  }
}

angle_common_lib("angle_common_shader_state") {
  sources = libangle_common_shader_state_sources
}

angle_source_set("angle_capture_common") {
  sources = [
    "src/common/frame_capture_utils.cpp",
    "src/common/frame_capture_utils.h",
    "src/common/frame_capture_utils_autogen.cpp",
    "src/common/frame_capture_utils_autogen.h",
  ]
  deps = [ ":angle_common" ]
  public_deps = [ ":angle_gl_enum_utils" ]
}

config("angle_image_util_config") {
  include_dirs = [
    "include",
    "src",
  ]
}

angle_source_set("angle_image_util_headers") {
  sources = libangle_image_util_headers
  public_deps = [ ":angle_common" ]
}

angle_static_library("angle_image_util") {
  sources = libangle_image_util_sources
  public_configs += [ ":angle_image_util_config" ]
  public_deps = [ ":angle_image_util_headers" ]

  if (angle_has_astc_encoder) {
    public_deps += [ "third_party/astc-encoder:astcenc" ]
    include_dirs = [ "third_party/astc-encoder/src/Source/" ]
  }
}

config("angle_gl_visibility_config") {
  if (is_win) {
    defines = [
      "GL_APICALL=",
      "GL_API=",
    ]
  } else {
    defines = [
      "GL_APICALL=__attribute__((visibility(\"default\")))",
      "GL_API=__attribute__((visibility(\"default\")))",
    ]
  }
}

config("angle_vulkan_wayland_config") {
  if (angle_enable_vulkan && angle_use_wayland &&
      defined(vulkan_wayland_include_dirs)) {
    include_dirs = vulkan_wayland_include_dirs
  }
}

config("angle_gpu_info_util_config") {
  include_dirs = [
    "include",
    "src",
  ]
}

angle_static_library("angle_gpu_info_util") {
  public_configs += [
    ":angle_gpu_info_util_config",
    ":angle_backend_config",
  ]
  public_deps = [ ":angle_common" ]
  sources = libangle_gpu_info_util_sources
  deps = []
  libs = []
  defines = []

  if (angle_build_vulkan_system_info) {
    sources += libangle_gpu_info_util_vulkan_sources
    deps += [
      "$angle_vulkan_headers_dir:vulkan_headers",
      "src/common/vulkan:angle_libvulkan_loader",
      "src/common/vulkan:angle_vulkan_icd",
    ]
    configs += [ "$angle_root:angle_no_cfi_icall" ]
    if (angle_enable_vulkan_system_info) {
      defines += [ "ANGLE_USE_VULKAN_SYSTEM_INFO" ]
    }
  }

  if (is_android) {
    sources += libangle_gpu_info_util_android_sources
  }

  if (is_fuchsia) {
    sources += libangle_gpu_info_util_fuchsia_sources
    deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ]
  }

  if (is_win) {
    sources += libangle_gpu_info_util_win_sources
    if (!angle_is_winuwp) {
      libs += [ "setupapi.lib" ]
    }
    libs += [ "dxgi.lib" ]
  }

  if (is_linux || is_chromeos) {
    sources += libangle_gpu_info_util_linux_sources

    if (angle_use_x11 && angle_has_build) {
      sources += libangle_gpu_info_util_x11_sources
      deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
      defines += [ "GPU_INFO_USE_X11" ]
      libs += [
        "X11",
        "Xi",
        "Xext",
      ]
    }

    if (angle_use_wayland && angle_has_build) {
      public_deps += [ ":angle_wayland" ]
    }
  }

  if (use_libpci) {
    sources += libangle_gpu_info_util_libpci_sources
    defines += [ "GPU_INFO_USE_LIBPCI" ]
    libs += [ "pci" ]
  }

  if (is_apple) {
    frameworks = [
      "IOKit.framework",
      "CoreFoundation.framework",
      "CoreGraphics.framework",
    ]
    if (angle_enable_cgl) {
      frameworks += [ "OpenGL.framework" ]
    }
    if (is_mac || angle_enable_cgl) {
      sources += libangle_gpu_info_util_mac_sources
    }
    if (is_ios && !angle_enable_cgl) {
      sources += libangle_gpu_info_util_ios_sources
    }
  }
}

angle_source_set("angle_translator_headers") {
  sources = angle_translator_exported_headers
  public_deps = [ ":includes" ]
}

angle_static_library("translator") {
  sources = angle_translator_sources
  defines = []

  _needs_glsl_base = false
  _needs_glsl_and_vulkan_base = false
  _uses_spirv = false

  # Frontend support:
  sources += angle_translator_essl_symbol_table_sources

  # Backend support:
  if (angle_enable_null) {
    defines += [ "ANGLE_ENABLE_NULL" ]
  }

  if (angle_enable_essl || use_fuzzing_engine) {
    _needs_glsl_base = true
    sources += angle_translator_essl_sources
    defines += [ "ANGLE_ENABLE_ESSL" ]
  }

  if (angle_enable_glsl || use_fuzzing_engine) {
    _needs_glsl_base = true
    _needs_glsl_and_vulkan_base = true
    sources += angle_translator_glsl_sources
    defines += [ "ANGLE_ENABLE_GLSL" ]

    if (is_apple) {
      sources += angle_translator_glsl_apple_sources
    }
  }

  if (angle_enable_hlsl || use_fuzzing_engine) {
    sources += angle_translator_hlsl_sources
    defines += [ "ANGLE_ENABLE_HLSL" ]
  }

  if (angle_enable_vulkan || use_fuzzing_engine) {
    _needs_glsl_base = true
    _needs_glsl_and_vulkan_base = true
    _uses_spirv = true

    sources += angle_translator_lib_spirv_sources
  }

  if (angle_enable_vulkan || use_fuzzing_engine) {
    defines += [ "ANGLE_ENABLE_VULKAN" ]
  }

  if (angle_enable_metal) {
    sources += angle_translator_lib_msl_sources
    defines += [ "ANGLE_ENABLE_METAL" ]
  }

  if (angle_enable_wgpu) {
    sources += angle_translator_lib_wgsl_sources
    defines += [ "ANGLE_ENABLE_WGPU" ]
  }

  if (_needs_glsl_base) {
    sources += angle_translator_glsl_base_sources
  }
  if (_needs_glsl_and_vulkan_base) {
    sources += angle_translator_glsl_and_vulkan_base_sources
  }

  public_configs += [ ":external_config" ]

  deps = [
    ":angle_common_shader_state",
    ":includes",
    ":preprocessor",
    "$angle_root/src/common/spirv:angle_spirv_headers",
  ]

  if (_uses_spirv) {
    deps += [
      "$angle_root/src/common/spirv:angle_spirv_base",
      "$angle_root/src/common/spirv:angle_spirv_builder",
      "${angle_spirv_headers_dir}:spv_headers",
      "${angle_spirv_tools_dir}:spvtools_headers",
      "${angle_spirv_tools_dir}:spvtools_val",
    ]
  }

  public_deps = [
    ":angle_common",
    ":angle_translator_headers",
    ":angle_version_info",
  ]

  if (is_win) {
    # Necessary to suppress some system header xtree warnings in Release.
    # For some reason this warning doesn't get triggered in Chromium
    cflags = [ "/wd4718" ]
  }
}

angle_source_set("translator_fuzzer") {
  sources = [ "src/compiler/fuzz/translator_fuzzer.cpp" ]

  include_dirs = [
    "include",
    "src",
  ]

  deps = [ ":translator" ]
}

config("angle_program_version_id_config") {
  include_dirs = [ "$root_gen_dir/angle" ]
  visibility = [ ":angle_program_version_id" ]
}

action("angle_program_version_id") {
  response_file_contents =
      rebase_path(angle_code_affecting_program_serialize, root_build_dir)

  _program_version_header = "$root_gen_dir/angle/ANGLEShaderProgramVersion.h"
  script = "src/program_serialize_data_version.py"
  outputs = [ _program_version_header ]

  visibility = [ ":angle_version" ]

  inputs = angle_code_affecting_program_serialize
  deps = angle_dependencies_affecting_program_serialize

  args = [
    rebase_path(_program_version_header, root_build_dir),
    "{{response_file_name}}",
  ]

  public_configs = [ ":angle_program_version_id_config" ]
}

config("angle_commit_id_config") {
  include_dirs = [ "$root_gen_dir/angle" ]
  visibility = [ ":angle_commit_id" ]
}

action("angle_commit_id") {
  _commit_id_header = "$root_gen_dir/angle/angle_commit.h"
  script = "src/commit_id.py"
  outputs = [ _commit_id_header ]

  visibility = [ ":angle_version" ]

  # Add git as a dependency if it is available.
  if (angle_enable_commit_id &&
      exec_script("src/commit_id.py", [ "check" ], "value") == 1) {
    # commit id should depend on angle's HEAD revision
    git_dirs = exec_script("src/commit_id.py", [ "get_git_dirs" ], "list lines")
    inputs = [ git_dirs[0] + "/HEAD" ]
    branch = read_file(git_dirs[0] + "/HEAD", "string")
    result = string_split(branch)
    if (result[0] == "ref:") {
      _ref_file = result[1]

      # If git has packed the contents of .git/refs/heads/ in .git/packed-refs,
      # unpack the head before depending on it.
      exec_script("src/commit_id.py",
                  [
                    "unpack",
                    _ref_file,
                  ],
                  "")
      inputs += [ git_dirs[1] + "/" + _ref_file ]
    }
  }

  args = [
    "gen",
    rebase_path(_commit_id_header, root_build_dir),
  ]

  public_configs = [ ":angle_commit_id_config" ]
}

angle_source_set("angle_version") {
  sources = [ "src/common/angle_version.h" ]
  public_deps = [
    ":angle_commit_id",
    ":angle_program_version_id",
  ]
  visibility = [ ":angle_version_info" ]

  # The version headers are used directly in Windows .RC files.
  if (is_win) {
    visibility += [
      ":libEGL",
      ":libGL",
      ":libGLESv1_CM",
      ":libGLESv2",
      ":libGLESv2_capture_complement",
    ]
    if (angle_enable_vulkan) {
      visibility += [
        ":libEGL_vulkan_secondaries",
        ":libGLESv2_vulkan_secondaries",
      ]
    }
  }
}

angle_source_set("angle_version_info") {
  sources = [
    "src/common/angle_version_info.cpp",
    "src/common/angle_version_info.h",
  ]
  deps = [
    ":angle_translator_headers",
    ":angle_version",
  ]
}

config("angle_backend_config") {
  defines = []

  if (angle_force_context_check_every_call) {
    defines += [ "ANGLE_FORCE_CONTEXT_CHECK_EVERY_CALL=1" ]
  }

  if (angle_expose_non_conformant_extensions_and_versions) {
    defines += [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ]
  }

  configs = []

  if (angle_enable_d3d11) {
    configs += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend_config" ]
  }

  if (angle_enable_d3d9) {
    configs += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend_config" ]
  }

  if (angle_enable_gl) {
    configs += [ "src/libANGLE/renderer/gl:angle_gl_backend_config" ]
  }

  if (angle_enable_null) {
    configs += [ "src/libANGLE/renderer/null:angle_null_backend_config" ]
  }

  if (angle_enable_wgpu) {
    configs += [ "src/libANGLE/renderer/wgpu:angle_wgpu_backend_config" ]
  }

  if (angle_enable_metal) {
    configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ]
  }

  if (angle_enable_vulkan) {
    configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
  }

  if (angle_enable_cl_passthrough) {
    configs += [ "src/libANGLE/renderer/cl:angle_cl_backend_config" ]
  }

  if (angle_is_winuwp) {
    configs += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp_config" ]
  }
}

config("libANGLE_config") {
  cflags = []
  defines = []
  libs = []
  ldflags = []
  defines += [ "LIBANGLE_IMPLEMENTATION" ]

  if (is_win) {
    cflags += [ "/wd4530" ]  # C++ exception handler used, but unwind semantics
                             # are not enabled.
  }

  if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
    # In API level 26 ANativeWindow APIs were moved from libandroid.so
    # into a separate library, libnativewindow.so
    if (ndk_api_level_at_least_26) {
      libs += [ "nativewindow" ]
    } else {
      libs += [ "android" ]
    }
  }

  if (angle_use_x11) {
    defines += [ "ANGLE_USE_X11" ]
  }

  if (angle_use_wayland) {
    defines += [ "ANGLE_USE_WAYLAND" ]
  }

  if (angle_enable_overlay) {
    defines += [ "ANGLE_ENABLE_OVERLAY=1" ]
  }
  if (angle_enable_perf_counter_output) {
    defines += [ "ANGLE_ENABLE_PERF_COUNTER_OUTPUT=1" ]
  }

  if (!is_android) {
    # b/283233503
    # Only export the ANGLE platform methods on Android, the EGL loader depends on them for
    # detecting ANGLE. Normally, users are expected to load them through eglGetProcAddress.
    defines += [ "ANGLE_PLATFORM_EXPORT=" ]
  }
}

angle_source_set("libANGLE_headers") {
  sources = libangle_headers
  if (angle_enable_cl) {
    sources += libangle_cl_headers
  }
  public_deps = [
    ":angle_common",
    ":angle_translator_headers",
  ]
  public_configs += [ ":libANGLE_config" ]
}

if ((is_win && angle_enable_gl) || angle_enable_d3d11 || angle_enable_d3d9) {
  angle_source_set("angle_d3d_format_tables") {
    sources = [
      "src/libANGLE/renderer/dxgi_format_map.h",
      "src/libANGLE/renderer/dxgi_format_map_autogen.cpp",
      "src/libANGLE/renderer/dxgi_support_table.h",
      "src/libANGLE/renderer/dxgi_support_table_autogen.cpp",
    ]

    if (!angle_is_winuwp) {
      sources += [
        "src/libANGLE/renderer/d3d_format.cpp",
        "src/libANGLE/renderer/d3d_format.h",
      ]
    }

    public_deps = [ ":libANGLE_headers" ]
    configs += [ ":angle_backend_config" ]
  }
}

# Vulkan gets mixed in later depending on secondary command buffer configs
angle_source_set("libANGLE_no_vulkan") {
  sources = libangle_sources
  if (angle_enable_cl) {
    sources += libangle_cl_sources
  }
  defines = []

  include_dirs = []
  libs = []
  if (angle_link_glx) {
    libs += [ "GL" ]
    defines += [ "ANGLE_LINK_GLX" ]
  }
  public_deps = [
    ":angle_common",
    ":angle_common_shader_state",
    ":angle_gpu_info_util",
    ":angle_image_util",
    ":angle_version_info",
    ":libANGLE_headers",
    ":translator",
  ]
  deps = [
    ":angle_compression",
    ":includes",
  ]

  if (is_win && !angle_is_winuwp) {
    libs += [
      "gdi32.lib",
      "user32.lib",
    ]
  }

  if (angle_enable_d3d11) {
    public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend" ]
  }

  if (angle_enable_d3d9) {
    public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend" ]
  }

  if (angle_enable_gl) {
    public_deps += [ "src/libANGLE/renderer/gl:angle_gl_backend" ]
  }

  if (angle_enable_null) {
    public_deps += [ "src/libANGLE/renderer/null:angle_null_backend" ]
  }

  if (angle_enable_wgpu) {
    public_deps += [ "src/libANGLE/renderer/wgpu:angle_wgpu_backend" ]
  }

  if (angle_is_winuwp) {
    public_deps += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp" ]
  }

  if (angle_enable_d3d11) {
    libs += [ "dxguid.lib" ]
  }

  if (angle_enable_metal) {
    public_deps += [ "src/libANGLE/renderer/metal:angle_metal_backend" ]
  }

  if (angle_enable_cl_passthrough) {
    public_deps += [ "src/libANGLE/renderer/cl:angle_cl_backend" ]
  }

  # Enable extra Chromium style warnings for libANGLE.
  if (is_clang && angle_has_build && !is_nacl) {
    suppressed_configs -= [ "//build/config/clang:find_bad_constructs" ]
  }

  if (is_apple) {
    sources += libangle_mac_sources
  }

  if (is_ios) {
    sources += [ "src/libANGLE/renderer/driver_utils_ios.mm" ]
  }

  if (is_debug) {
    defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
  }

  configs += [ ":debug_annotations_config" ]
  public_configs += [
    ":libANGLE_config",
    ":angle_backend_config",
  ]

  if (_use_copy_compiler_dll) {
    data_deps = [ ":copy_compiler_dll" ]
  }
}

config("angle_frame_capture_disabled") {
  defines = [ "ANGLE_CAPTURE_ENABLED=0" ]
}

angle_source_set("angle_frame_capture_mock") {
  public_deps = [ ":libANGLE_headers" ]
  public_configs = [ ":angle_frame_capture_disabled" ]
  sources = [
    "src/common/frame_capture_utils.h",
    "src/common/frame_capture_utils_autogen.h",
    "src/common/gl_enum_utils_autogen.h",
    "src/libANGLE/capture/FrameCapture.h",
    "src/libANGLE/capture/FrameCapture_mock.cpp",
    "src/libANGLE/capture/serialize.h",
    "src/libANGLE/capture/serialize_mock.cpp",
  ]
}

angle_source_set("angle_gl_enum_utils") {
  deps = [ ":angle_common" ]
  sources = [
    "src/common/gl_enum_utils.cpp",
    "src/common/gl_enum_utils.h",
    "src/common/gl_enum_utils_autogen.cpp",
    "src/common/gl_enum_utils_autogen.h",
  ]
}

if (angle_use_wayland) {
  config("angle_wayland_config") {
    if ("$wayland_gn_dir" == "") {
      libs = [
        "wayland-client",
        "wayland-egl",
      ]
    }

    include_dirs = [
      "$wayland_dir/egl",
      "$wayland_dir/src",
    ]
  }

  group("angle_wayland") {
    public_configs = [ ":angle_wayland_config" ]

    if ("$wayland_gn_dir" != "") {
      # Use third-party targets
      public_deps = [
        "$wayland_gn_dir:wayland_client",
        "$wayland_gn_dir:wayland_egl",
      ]
    }
  }
}

if (!defined(angle_abseil_cpp_dir)) {
  angle_abseil_cpp_dir = "//third_party/abseil-cpp"
}

config("angle_abseil_config") {
  if (angle_enable_abseil) {
    defines = [ "ANGLE_USE_ABSEIL" ]

    configs = [
      "$angle_abseil_cpp_dir:absl_define_config",
      "$angle_abseil_cpp_dir:absl_include_config",
    ]
  }
}

group("angle_abseil") {
  if (angle_enable_abseil) {
    # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
    # we can be more specific when building standalone non-component ANGLE.
    # Also build the combined target when building Dawn to avoid multiply defined globals.
    if (build_with_chromium || angle_enable_wgpu || is_component_build) {
      public_deps = [ "$angle_abseil_cpp_dir:absl" ]
    } else {
      public_deps = [
        "$angle_abseil_cpp_dir/absl/container:flat_hash_map",
        "$angle_abseil_cpp_dir/absl/container:flat_hash_set",
      ]
    }

    public_configs = [ ":angle_abseil_config" ]
  }
}

config("angle_compression_config") {
  include_dirs = [ "//third_party/zlib/google" ]
}

group("angle_compression") {
  public_configs = [
    ":angle_compression_config",
    "//third_party/zlib:zlib_config",
  ]
  public_deps =
      [ "$angle_zlib_compression_utils_dir:compression_utils_portable" ]
}

if (angle_has_rapidjson) {
  config("angle_rapidjson_config") {
    defines = [ "ANGLE_HAS_RAPIDJSON" ]
  }
  angle_source_set("angle_json_serializer") {
    public_deps = [
      ":angle_common",
      "$angle_root/third_party/rapidjson",
    ]
    sources = [
      "src/common/serializer/JsonSerializer.cpp",
      "src/common/serializer/JsonSerializer.h",
    ]
    public_configs = [ ":angle_rapidjson_config" ]
  }
}

assert(angle_has_frame_capture || !angle_with_capture_by_default)
if (angle_has_frame_capture) {
  config("angle_frame_capture_enabled") {
    defines = [ "ANGLE_CAPTURE_ENABLED=1" ]
  }
}

template("libANGLE_template") {
  angle_source_set("${target_name}") {
    public_deps = invoker.public_deps + [ ":libANGLE_no_vulkan" ]
    public_configs = [ ":angle_frame_capture_disabled" ]

    # gl_enum_utils defaults included in with_capture build
    deps = [ ":angle_frame_capture_mock" ]
    if (angle_enable_trace || is_debug) {
      deps += [ ":angle_gl_enum_utils" ]
    }
  }

  if (angle_has_frame_capture) {
    angle_source_set("${target_name}_with_capture") {
      public_deps = invoker.public_deps + [
                      ":angle_gl_enum_utils",
                      ":libANGLE_no_vulkan",
                    ]
      deps = [
        ":angle_capture_common",
        ":angle_compression",
      ]
      public_configs = [ ":angle_frame_capture_enabled" ]
      sources = libangle_capture_sources

      if (angle_has_rapidjson) {
        public_deps += [ ":angle_json_serializer" ]
        sources += [ "src/libANGLE/capture/serialize.cpp" ]
      } else {
        sources += [ "src/libANGLE/capture/serialize_mock.cpp" ]
      }
    }
  }
}

libANGLE_template("libANGLE") {
  public_deps = []
  if (angle_enable_vulkan) {
    public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ]
  }
}

if (angle_enable_vulkan) {
  libANGLE_template("libANGLE_vulkan_secondaries") {
    public_deps =
        [ "src/libANGLE/renderer/vulkan:angle_vulkan_secondaries_backend" ]
  }
}

config("shared_library_public_config") {
  if (is_mac && !is_component_build) {
    # Executable targets that depend on the shared libraries below need to have
    # the rpath setup in non-component build configurations.
    ldflags = [
      "-rpath",
      "@executable_path/",
    ]
    if (build_with_chromium) {
      ldflags += [
        # Path for loading shared libraries for unbundled binaries.
        # From //build/config/mac/BUILD.gn, this is only added for
        # component builds. However, since ANGLE always dynamically
        # links to libvulkan, it should be re-added for non-component
        # builds. (anglebug.com/42263076)
        "-Wl,-rpath,@loader_path/.",
      ]
    }
  }

  if (angle_is_winuwp && !angle_is_winappsdk) {
    ldflags = [
      "/APPCONTAINER",

      # Disable warning about invalid subsystem number.
      # A default appropriate subsystem is selected automatically.
      "/IGNORE:4010",
    ]
  }
}

_angle_glesv2_library_name = "libGLESv2${angle_libs_suffix}"
_angle_glesv2_vulkan_secondaries_library_name =
    "libGLESv2_vulkan_secondaries${angle_libs_suffix}"

config("library_name_config") {
  _egllib = "libEGL${angle_libs_suffix}"
  _vk2egllib = "libEGL_vulkan_secondaries${angle_libs_suffix}"
  defines = [
    "ANGLE_EGL_LIBRARY_NAME=\"${_egllib}\"",
    "ANGLE_GLESV2_LIBRARY_NAME=\"${_angle_glesv2_library_name}\"",
    "ANGLE_MESA_EGL_LIBRARY_NAME=\"mesa/src/egl/libEGL\"",
    "ANGLE_MESA_GLESV2_LIBRARY_NAME=\"mesa/src/mapi/es2api/libGLESv2\"",
    "ANGLE_VULKAN_SECONDARIES_EGL_LIBRARY_NAME=\"${_vk2egllib}\"",
    "ANGLE_VULKAN_SECONDARIES_GLESV2_LIBRARY_NAME=\"${_angle_glesv2_vulkan_secondaries_library_name}\"",
  ]
}

# This config controls export definitions on ANGLE API calls.
config("angle_static_config") {
  defines = [
    "ANGLE_EXPORT=",
    "ANGLE_STATIC=1",
    "ANGLE_UTIL_EXPORT=",
    "EGLAPI=",
    "GL_APICALL=",
    "GL_API=",
  ]
}

set_defaults("angle_libGLESv2") {
  sources = []
  output_name = "libGLESv2"
}

template("angle_libGLESv2") {
  angle_shared_library(target_name) {
    sources = invoker.sources + libglesv2_sources
    deps = invoker.deps + [ ":includes" ]
    defines = [ "LIBGLESV2_IMPLEMENTATION" ]

    output_name = "${invoker.output_name}${angle_libs_suffix}"
    if (angle_glesv2_extension != "") {
      output_extension = angle_glesv2_extension
    }

    configs += [
      ":angle_gl_visibility_config",
      ":debug_annotations_config",
      ":gl_prototypes",
    ]

    if (angle_enable_cl) {
      sources += libglesv2_cl_sources
    }

    if (is_win) {
      sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ]
      sources += [ "src/libGLESv2/libGLESv2.rc" ]
      deps += [ ":angle_version" ]
    }
  }
}

angle_libGLESv2("libGLESv2") {
  if (angle_with_capture_by_default) {
    deps = [ ":libANGLE_with_capture" ]
  } else {
    deps = [ ":libANGLE" ]
  }
}

if (angle_enable_vulkan) {
  angle_libGLESv2("libGLESv2_vulkan_secondaries") {
    output_name = "libGLESv2_vulkan_secondaries"
    if (angle_with_capture_by_default) {
      deps = [ ":libANGLE_vulkan_secondaries_with_capture" ]
    } else {
      deps = [ ":libANGLE_vulkan_secondaries" ]
    }
  }
}

# Output capture lib when `angle_with_capture_by_default` disabled, vice versa.
if (angle_has_frame_capture) {
  angle_libGLESv2("libGLESv2_capture_complement") {
    if (angle_with_capture_by_default) {
      deps = [ ":libANGLE" ]
      output_name += "_no_capture"
    } else {
      deps = [ ":libANGLE_with_capture" ]
      output_name += "_with_capture"
    }
  }
}

angle_static_library("libGLESv2_static") {
  sources = libglesv2_sources
  if (angle_enable_cl) {
    sources += libglesv2_cl_sources
  }
  configs += [ ":debug_annotations_config" ]

  public_configs += [ ":angle_static_config" ]
  deps = [ ":includes" ]
  public_deps = [ ":libANGLE" ]
}

angle_shared_library("libGLESv1_CM") {
  sources = libglesv1_cm_sources
  output_name = "libGLESv1_CM${angle_libs_suffix}"

  configs += [
    ":angle_gl_visibility_config",
    ":debug_annotations_config",
    ":gl_prototypes",
  ]

  defines = []

  deps = [
    ":includes",
    ":libGLESv2",
  ]

  if (is_win) {
    sources += [ "src/libGLESv1_CM/libGLESv1_CM.def" ]
    deps += [ ":angle_version" ]
  }
}

config("libEGL_egl_loader_config") {
  defines = [ "ANGLE_USE_EGL_LOADER" ]
}

angle_source_set("libEGL_egl_loader") {
  sources = [
    "src/libEGL/egl_loader_autogen.cpp",
    "src/libEGL/egl_loader_autogen.h",
  ]

  public_configs += [
    ":libEGL_egl_loader_config",
    ":gl_prototypes",
  ]

  deps = [ ":includes" ]
}

set_defaults("libEGL_template") {
  sources = []
  deps = []
  public_configs = []
}

template("libEGL_template") {
  target(invoker.target_type, target_name) {
    forward_variables_from(invoker, "*")
    sources += libegl_sources
    configs += [
      ":debug_annotations_config",
      ":library_name_config",
    ]
    deps += [ ":includes" ]
  }
}

template("libEGL_shared_template") {
  libEGL_template(target_name) {
    target_type = "angle_shared_library"
    output_name = "${invoker.output_name}${angle_libs_suffix}"
    if (angle_egl_extension != "") {
      output_extension = angle_egl_extension
    }

    defines = invoker.defines + [ "LIBEGL_IMPLEMENTATION" ]
    if (is_win) {
      defines += [ "EGLAPI=" ]
    } else {
      defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
    }

    deps = [
      ":angle_common",
      ":libEGL_egl_loader",
    ]

    sources += invoker.sources

    if (is_win) {
      sources += [ "src/libEGL/libEGL.rc" ]
      deps += [ ":angle_version" ]
    }

    data_deps = [ ":${invoker.gles_library}" ]
  }
}

libEGL_shared_template("libEGL") {
  defines = [ "ANGLE_DISPATCH_LIBRARY=\"${_angle_glesv2_library_name}\"" ]
  output_name = "libEGL"
  gles_library = "libGLESv2"
  sources = []
  if (is_win) {
    sources += [ "src/libEGL/libEGL_autogen.def" ]
  }
}

if (angle_enable_vulkan) {
  libEGL_shared_template("libEGL_vulkan_secondaries") {
    defines = [ "ANGLE_DISPATCH_LIBRARY=\"${_angle_glesv2_vulkan_secondaries_library_name}\"" ]
    output_name = "libEGL_vulkan_secondaries"
    gles_library = "libGLESv2_vulkan_secondaries"
    sources = []
    if (is_win) {
      sources += [ "src/libEGL/libEGL_vulkan_secondaries_autogen.def" ]
    }
  }
}

libEGL_template("libEGL_static") {
  target_type = "angle_static_library"
  public_configs = [ ":angle_static_config" ]
  deps = [ ":libGLESv2_static" ]
}

# Convenience targets for some of the samples so they can be built
# with Chromium's toolchain.
angle_executable("angle_shader_translator") {
  testonly = true

  sources = [ "samples/shader_translator/shader_translator.cpp" ]

  deps = [ ":translator" ]

  defines = []

  if (angle_enable_vulkan) {
    deps += [
      "${angle_spirv_tools_dir}:spvtools_headers",
      "${angle_spirv_tools_dir}:spvtools_val",
    ]

    defines += [ "ANGLE_ENABLE_VULKAN" ]
  }
}

if (angle_standalone || build_with_chromium || build_angle_end2end_tests_aosp) {
  config("angle_feature_support_config") {
    include_dirs = [
      "include",
      "src",
    ]
    defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
    if (is_debug) {
      defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
    }
  }

  angle_shared_library("libfeature_support") {
    output_name = "libfeature_support${angle_libs_suffix}"

    if (is_android) {
      libs = [ "log" ]
    }

    configs += [
      ":angle_feature_support_config",
      "${angle_jsoncpp_dir}:jsoncpp_config",
    ]

    if (is_apple && !is_component_build) {
      ldflags = [
        "-install_name",
        "@rpath/${target_name}.dylib",
      ]
    }

    sources = [
      "src/feature_support_util/feature_support_util.cpp",
      "src/feature_support_util/feature_support_util.h",
    ]

    deps = [
      ":angle_gpu_info_util",
      "${angle_jsoncpp_dir}:jsoncpp",
    ]
  }
}

if (angle_enable_cgl) {
  config("supports_automatic_graphics_switching") {
    # For discussion about config, inputs, etc, see:
    # https://bugs.chromium.org/p/chromium/issues/detail?id=781858
    _plist_file = "util/osx/supports_automatic_graphics_switching.plist"
    inputs = [ _plist_file ]
    ldflags = [
      "-sectcreate",
      "__TEXT",
      "__info_plist",
      rebase_path(_plist_file, root_build_dir),
    ]
  }
}

if (is_android && symbol_level != 0 &&
    (angle_standalone || build_with_chromium)) {
  action_foreach("compressed_symbols") {
    sources = []
    foreach(_library, angle_libraries) {
      sources += [ "$root_out_dir/$_library$angle_libs_suffix$shlib_extension" ]
    }
    if (angle_enable_vulkan_validation_layers) {
      foreach(_layer, vulkan_validation_layers) {
        sources += [ "$root_out_dir/lib$_layer$shlib_extension" ]
      }
    }

    if (angle_enable_vulkan_api_dump_layer &&
        current_toolchain == default_toolchain) {
      sources += [ "$root_out_dir/libVkLayer_lunarg_api_dump$shlib_extension" ]
    }

    script = rebase_path("${root_build_dir}/android/compress_symbols.py",
                         root_build_dir)

    deps = []
    foreach(_library, angle_libraries) {
      deps += [ ":$_library" ]
    }

    if (angle_enable_vulkan_validation_layers) {
      foreach(_layer, vulkan_validation_layers) {
        deps += [ "$angle_vulkan_validation_layers_dir:${_layer}" ]
      }
    }

    if (angle_enable_vulkan_api_dump_layer &&
        current_toolchain == default_toolchain) {
      deps += [ "$angle_lunarg_vulkantools_dir:VkLayer_lunarg_api_dump" ]
    }

    outputs = [ "$root_out_dir/lib.compressed/{{source_file_part}}" ]

    android_nm = "${android_tool_prefix}nm"
    android_strip = "${android_tool_prefix}strip"

    args = [
      "--objcopy",
      rebase_path(android_objcopy, root_build_dir),
      "--nm",
      rebase_path(android_nm, root_build_dir),
      "--strip",
      rebase_path(android_strip, root_build_dir),
      "--unstrippedsofile",
      "{{source_dir}}/lib.unstripped/{{source_file_part}}",
      "--output",
      "{{source_dir}}/lib.compressed/{{source_file_part}}",
    ]
  }
}

if ((angle_standalone || build_with_chromium) && is_android &&
    current_toolchain == default_toolchain) {
  apk_version_code = "0"
  if (angle_enable_commit_id) {
    apk_version_code =
        exec_script("src/commit_id.py", [ "position" ], "trim string")
  }

  # Package ANGLE libraries for normal use on Android
  angle_apk("angle_chromium_apk") {
    package_name = "org.chromium.angle"
    apk_name = "AngleLibraries"
    version_name = "ANGLE Developer Build"
    version_code = apk_version_code
  }

  # Package ANGLE libraries for AGI use on Android
  angle_apk("angle_agi_chromium_apk") {
    package_name = "org.chromium.angle.agi"
    apk_name = "AngleAgiLibraries"
    version_name = "ANGLE AGI Build"
    version_code = apk_version_code
  }

  group("angle_apks") {
    deps = [
      ":angle_agi_chromium_apk",
      ":angle_chromium_apk",
    ]
  }
}

if (install_prefix != "") {
  template("install_target") {
    install_deps = []

    foreach(_lib, invoker.libs) {
      install_deps += [ ":install_${_lib}" ]

      source = "${root_build_dir}/${_lib}${angle_libs_suffix}${shlib_extension}"

      action("install_${_lib}") {
        deps = [ ":${_lib}" ]
        script = "scripts/install_target.py"
        sources = [ source ]

        outputs = [ "${target_gen_dir}/install_${_lib}.stamp" ]
        args = [
          "--name",
          _lib,
          "--prefix",
          "$install_prefix",
          "--libs",
          rebase_path(source),
        ]
      }
    }

    install_deps += [ ":install_includes" ]
    action("install_includes") {
      script = "scripts/install_target.py"
      configs = invoker.configs

      outputs = [ "${target_gen_dir}/install_${target_name}.stamp" ]
      args = [
        "--prefix",
        "$install_prefix",
        "{{include_dirs}}",
      ]
    }

    group("install_${target_name}") {
      deps = install_deps
    }
  }

  install_target("angle") {
    libs = [
      "libEGL",
      "libGLESv1_CM",
      "libGLESv2",
    ]
    configs = [ ":includes_config" ]
  }
}

group("angle") {
  data_deps = [
    ":libEGL",
    ":libGLESv1_CM",
    ":libGLESv2",
  ]
  if (angle_enable_vulkan) {
    data_deps += [
      ":libEGL_vulkan_secondaries",
      ":libGLESv2_vulkan_secondaries",
    ]
  }
  if (is_ios) {
    # Need to bundle the libraries inside the .app.
    deps = data_deps
  }
}

group("angle_static") {
  public_deps = [
    ":libEGL_static",
    ":libGLESv2_static",
    ":preprocessor",
    ":translator",
  ]
}

# GN evaluates each .gn file once per toolchain, so restricting to default
# toolchain will ensure write_file() is called only once.
if (!build_with_chromium && angle_has_build &&
    current_toolchain == default_toolchain) {
  import("//build/gn_logs.gni")

  # Write debug logs to gn_logs.txt.
  _lines = [
             "Generated during 'gn gen' by //BUILD.gn.",
             "",
           ] + build_gn_logs

  write_file("$root_build_dir/gn_logs.txt", _lines)
}
