2019-01-28 17:55:20 +03:00
|
|
|
# Copyright 2019 The ANGLE Project Authors. All rights reserved.
|
2014-06-23 23:13:02 +04:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2021-09-09 15:34:23 +03:00
|
|
|
# import the ozone_platform_x11 variable
|
2017-08-29 05:53:24 +03:00
|
|
|
import("gni/angle.gni")
|
2022-03-30 15:16:02 +03:00
|
|
|
if (angle_enable_vulkan) {
|
|
|
|
import("//build_overrides//vulkan_headers.gni")
|
|
|
|
}
|
2022-06-15 21:01:17 +03:00
|
|
|
if (angle_use_wayland) {
|
|
|
|
import("//build_overrides/wayland.gni")
|
|
|
|
}
|
2019-10-04 22:17:49 +03:00
|
|
|
if (angle_has_build) {
|
|
|
|
import("//build/config/linux/pkg_config.gni")
|
2021-11-11 18:18:36 +03:00
|
|
|
import("//build/config/sanitizers/sanitizers.gni")
|
2019-10-04 22:17:49 +03:00
|
|
|
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")
|
|
|
|
}
|
2021-11-19 17:41:58 +03:00
|
|
|
} else {
|
|
|
|
using_sanitizer = false
|
2018-04-13 02:06:48 +03:00
|
|
|
}
|
2015-05-26 18:32:58 +03:00
|
|
|
|
2017-03-20 20:06:19 +03:00
|
|
|
declare_args() {
|
|
|
|
# Use the PCI lib to collect GPU information on Linux.
|
2022-03-29 00:27:16 +03:00
|
|
|
use_libpci = (is_linux || is_chromeos) && (angle_use_x11 || use_ozone) &&
|
|
|
|
angle_has_build
|
2017-12-12 07:58:53 +03:00
|
|
|
|
2021-09-07 22:49:07 +03:00
|
|
|
# Enable using Vulkan to collect system info as a fallback.
|
|
|
|
angle_enable_vulkan_system_info = false
|
|
|
|
|
2017-12-12 07:58:53 +03:00
|
|
|
# Link in system libGL, to work with apitrace. See doc/DebuggingTips.md.
|
|
|
|
angle_link_glx = false
|
2019-07-31 00:22:17 +03:00
|
|
|
|
2019-09-19 00:46:23 +03:00
|
|
|
# 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.
|
2022-05-24 16:58:36 +03:00
|
|
|
angle_build_all = !build_with_chromium && !angle_is_winuwp &&
|
|
|
|
angle_has_build && angle_build_tests
|
2020-03-06 17:32:18 +03:00
|
|
|
|
|
|
|
# Enable generating current commit information using git
|
|
|
|
angle_enable_commit_id = true
|
2020-07-24 20:58:45 +03:00
|
|
|
|
|
|
|
# Abseil has trouble supporting MSVC, particularly regarding component builds.
|
|
|
|
# http://crbug.com/1126524
|
|
|
|
angle_enable_abseil = angle_has_build && is_clang
|
2020-11-05 03:57:27 +03:00
|
|
|
|
|
|
|
# Adds run-time checks to filter out EVENT() messages when the debug annotator is disabled.
|
|
|
|
angle_enable_annotator_run_time_checks = false
|
2021-03-06 03:40:27 +03:00
|
|
|
|
|
|
|
# Enables non-conformant extensions and features
|
|
|
|
angle_expose_non_conformant_extensions_and_versions = false
|
2021-04-07 19:33:31 +03:00
|
|
|
|
|
|
|
# Optional feature that forces dirty state whenever we use a new context regardless of thread.
|
|
|
|
angle_force_context_check_every_call = false
|
2021-11-09 01:01:34 +03:00
|
|
|
|
|
|
|
# Allow shared library custom name extensions for setting soname such as libEGL.so.1
|
|
|
|
angle_egl_extension = ""
|
|
|
|
angle_glesv2_extension = ""
|
2022-07-21 16:53:37 +03:00
|
|
|
|
|
|
|
# Enable share context lock. If it is false, the client need to use gl calls in a threadsafe way.
|
2022-07-24 21:49:44 +03:00
|
|
|
# Chromium only uses share contexts on the GPU thread.
|
|
|
|
# angle_deqp_tests contains threading related tests.
|
|
|
|
angle_enable_share_context_lock =
|
|
|
|
!build_with_chromium || build_angle_deqp_tests
|
2022-08-12 17:55:49 +03:00
|
|
|
|
|
|
|
if (is_android) {
|
|
|
|
# Use Android TLS slot to store current context.
|
|
|
|
angle_use_android_tls_slot = !build_with_chromium
|
|
|
|
}
|
2017-03-20 20:06:19 +03:00
|
|
|
}
|
|
|
|
|
2019-12-03 22:08:36 +03:00
|
|
|
if (angle_build_all) {
|
2017-08-29 05:53:24 +03:00
|
|
|
group("all") {
|
|
|
|
testonly = true
|
|
|
|
deps = [
|
2019-12-03 22:08:36 +03:00
|
|
|
":angle",
|
2017-08-29 05:53:24 +03:00
|
|
|
":angle_shader_translator",
|
|
|
|
":translator_fuzzer",
|
2019-02-07 17:09:41 +03:00
|
|
|
":xxhash_fuzzer",
|
2019-12-03 22:08:36 +03:00
|
|
|
"$angle_root/samples:angle_samples",
|
|
|
|
"$angle_root/src/tests:angle_tests",
|
2017-08-29 05:53:24 +03:00
|
|
|
]
|
2021-04-21 23:43:46 +03:00
|
|
|
if (angle_enable_cl) {
|
|
|
|
deps += [ "$angle_root/src/libOpenCL:angle_cl" ]
|
|
|
|
}
|
2017-08-29 05:53:24 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Revert "Enhance ANGLE for Android Developer Options"
This reverts commit fdbdb2b247ffa4cf66bc2cd3a5bb45a056bd88a3.
Reason for revert:
I didn't mean to land this quite yet, since we are still working on the Android side of things. It seems doing CQ+2 merges it while I was trying for just a dry run while replying to Jamie's comments with updates (after checking with Boulder folks, I want CQ+1 next time).
Once the Android changes are ready, I'll work on getting this landed again.
Original change's description:
> Enhance ANGLE for Android Developer Options
>
> Update ANGLE Developer Options
>
> Update ANGLE developer options to allow selecting the OpenGL driver
> (default, ANGLE, native) for each app as well as forcing ANGLE for all
> apps.
>
> Bug: angleproject:2962
> Test: Verify the default/ANGLE/native values are saved and applied and
> used by the loader.
>
> Change-Id: I6041e7e49ca5cc65f90fc8ae6f1b084e4639d769
> Reviewed-on: https://chromium-review.googlesource.com/c/1330315
> Commit-Queue: Tim Van Patten <timvp@google.com>
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
TBR=ynovikov@chromium.org,geofflang@chromium.org,jmadill@chromium.org,cnorthrop@google.com,tobine@google.com,courtneygo@google.com,ianelliott@google.com,timvp@google.com
Change-Id: If3a4e917973c56b858244a0ca7f1b164143524f5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:2962
Reviewed-on: https://chromium-review.googlesource.com/c/1354099
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
2018-11-28 19:08:11 +03:00
|
|
|
import("src/compiler.gni")
|
2018-11-02 02:47:10 +03:00
|
|
|
import("src/libGLESv2.gni")
|
2014-07-17 01:19:18 +04:00
|
|
|
|
2014-07-23 04:00:17 +04:00
|
|
|
# This config is exported to dependent targets (and also applied to internal
|
|
|
|
# ones).
|
|
|
|
config("external_config") {
|
2016-01-04 19:25:00 +03:00
|
|
|
include_dirs = [ "include" ]
|
2014-07-23 04:00:17 +04:00
|
|
|
}
|
|
|
|
|
2018-12-17 21:13:49 +03:00
|
|
|
# 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",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2014-06-23 23:13:02 +04:00
|
|
|
# This config is applied to internal Angle targets (not pushed to dependents).
|
|
|
|
config("internal_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
2017-01-03 19:03:23 +03:00
|
|
|
|
2022-06-03 19:22:41 +03:00
|
|
|
# Handle breaking changes in VulkanMemoryAllocator.
|
|
|
|
angle_vma_version_define = "ANGLE_VMA_VERSION="
|
|
|
|
if (defined(angle_vma_version)) {
|
|
|
|
angle_vma_version_define += angle_vma_version
|
|
|
|
} else {
|
|
|
|
# Default to 2.3.0. This can be bumped and include guards removed when all
|
|
|
|
# clients have migrated to 3.x.
|
|
|
|
angle_vma_version_define += 2003000
|
|
|
|
}
|
|
|
|
|
|
|
|
defines = [ angle_vma_version_define ]
|
2017-04-12 16:53:01 +03:00
|
|
|
|
2020-06-22 05:27:06 +03:00
|
|
|
if (is_win) {
|
|
|
|
defines += [ "ANGLE_IS_WIN" ]
|
2021-05-05 18:51:00 +03:00
|
|
|
if (angle_is_winuwp) {
|
|
|
|
defines += [ "ANGLE_IS_WINUWP" ]
|
|
|
|
}
|
2020-09-10 20:40:34 +03:00
|
|
|
} else if (is_linux || is_chromeos) {
|
2020-06-22 05:27:06 +03:00
|
|
|
defines += [ "ANGLE_IS_LINUX" ]
|
|
|
|
}
|
|
|
|
|
2022-07-21 16:53:37 +03:00
|
|
|
if (angle_enable_share_context_lock) {
|
|
|
|
defines += [ "ANGLE_ENABLE_SHARE_CONTEXT_LOCK=1" ]
|
|
|
|
}
|
|
|
|
|
2022-08-12 17:55:49 +03:00
|
|
|
if (is_android) {
|
|
|
|
if (angle_use_android_tls_slot) {
|
|
|
|
defines += [ "ANGLE_USE_ANDROID_TLS_SLOT=1" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-04 05:26:00 +03:00
|
|
|
# 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.
|
2018-05-03 20:10:44 +03:00
|
|
|
if (angle_enable_trace) {
|
|
|
|
defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ]
|
|
|
|
}
|
2019-10-17 17:18:16 +03:00
|
|
|
|
2020-11-04 05:26:00 +03:00
|
|
|
# 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" ]
|
|
|
|
}
|
|
|
|
|
2022-03-24 20:32:10 +03:00
|
|
|
# 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" ]
|
|
|
|
}
|
|
|
|
|
2019-10-17 17:18:16 +03:00
|
|
|
if (is_chromeos) {
|
|
|
|
defines += [ "ANGLE_PLATFORM_CHROMEOS" ]
|
|
|
|
}
|
2020-01-25 06:41:35 +03:00
|
|
|
|
|
|
|
if (is_ggp) {
|
|
|
|
defines += [ "__ggp__" ]
|
|
|
|
}
|
2020-10-12 11:40:13 +03:00
|
|
|
|
2021-07-08 04:51:35 +03:00
|
|
|
if (angle_use_vulkan_null_display) {
|
|
|
|
defines += [ "ANGLE_USE_VULKAN_NULL_DISPLAY" ]
|
|
|
|
} else if (angle_use_vulkan_display) {
|
2021-07-23 18:18:18 +03:00
|
|
|
defines += [ "ANGLE_USE_VULKAN_DISPLAY" ]
|
|
|
|
if (!angle_use_x11) {
|
|
|
|
defines += [ "EGL_NO_X11" ]
|
|
|
|
}
|
2021-12-09 18:52:35 +03:00
|
|
|
|
|
|
|
# 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" ]
|
|
|
|
}
|
|
|
|
|
2020-10-12 11:40:13 +03:00
|
|
|
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" ]
|
|
|
|
}
|
|
|
|
}
|
2020-12-04 22:07:24 +03:00
|
|
|
|
|
|
|
if (is_lsan) {
|
|
|
|
defines += [ "ANGLE_WITH_LSAN" ]
|
|
|
|
}
|
2022-06-03 15:29:23 +03:00
|
|
|
|
|
|
|
if (angle_has_astc_encoder) {
|
|
|
|
defines += [ "ANGLE_HAS_ASTCENC" ]
|
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2019-10-21 15:39:14 +03:00
|
|
|
config("constructor_and_destructor_warnings") {
|
|
|
|
if (is_clang) {
|
|
|
|
cflags = [
|
|
|
|
"-Wexit-time-destructors",
|
|
|
|
"-Wglobal-constructors",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-18 17:10:29 +03:00
|
|
|
config("extra_warnings") {
|
2017-10-11 06:53:20 +03:00
|
|
|
cflags = []
|
2017-08-29 05:53:24 +03:00
|
|
|
|
2021-02-12 11:36:18 +03:00
|
|
|
is_gcc = !is_clang && !is_win
|
|
|
|
|
2021-01-27 00:13:04 +03:00
|
|
|
# Avoid failing builds for warnings enabled by Skia build.
|
|
|
|
if (defined(is_skia_standalone)) {
|
|
|
|
cflags += [ "-w" ]
|
|
|
|
}
|
|
|
|
|
2016-07-18 17:10:29 +03:00
|
|
|
# Enable more default warnings on Windows.
|
|
|
|
if (is_win) {
|
2017-10-11 06:53:20 +03:00
|
|
|
cflags += [
|
2016-07-18 17:10:29 +03:00
|
|
|
"/we4244", # Conversion: possible loss of data.
|
2020-08-29 00:44:13 +03:00
|
|
|
"/we4312", # Conversion: greater size.
|
2016-07-18 17:10:29 +03:00
|
|
|
"/we4456", # Variable shadowing.
|
2016-09-22 20:53:47 +03:00
|
|
|
"/we4458", # declaration hides class member.
|
2019-04-12 21:10:17 +03:00
|
|
|
"/we4715", # not all control paths return a value
|
2017-11-28 21:26:34 +03:00
|
|
|
"/we4800", # forcing value to bool.
|
|
|
|
"/we4838", # narrowing conversion.
|
2016-07-18 17:10:29 +03:00
|
|
|
]
|
|
|
|
}
|
2017-10-11 06:53:20 +03:00
|
|
|
if (is_clang) {
|
2019-01-22 02:09:15 +03:00
|
|
|
cflags += [
|
2020-08-28 21:45:14 +03:00
|
|
|
"-Wbad-function-cast",
|
2019-10-24 19:55:11 +03:00
|
|
|
"-Wconditional-uninitialized",
|
2019-09-02 20:55:59 +03:00
|
|
|
"-Wextra-semi-stmt",
|
2019-07-23 00:26:17 +03:00
|
|
|
"-Wfloat-conversion",
|
2019-10-24 19:55:11 +03:00
|
|
|
"-Winconsistent-missing-destructor-override",
|
2019-10-24 19:55:09 +03:00
|
|
|
"-Wmissing-field-initializers",
|
2020-06-16 19:29:16 +03:00
|
|
|
"-Wnewline-eof",
|
2018-05-09 16:41:39 +03:00
|
|
|
"-Wnon-virtual-dtor",
|
2019-10-24 19:55:09 +03:00
|
|
|
"-Wredundant-parens",
|
2021-02-18 00:46:43 +03:00
|
|
|
"-Wreturn-std-move",
|
2021-07-08 15:28:04 +03:00
|
|
|
"-Wshadow",
|
2019-10-24 19:55:08 +03:00
|
|
|
"-Wshadow-field",
|
2019-10-24 19:55:07 +03:00
|
|
|
"-Wtautological-type-limit-compare",
|
2019-10-24 19:55:10 +03:00
|
|
|
"-Wundefined-reinterpret-cast",
|
2019-02-01 22:16:32 +03:00
|
|
|
"-Wunneeded-internal-declaration",
|
2021-07-31 21:41:29 +03:00
|
|
|
"-Wunused-but-set-variable",
|
2021-11-03 19:59:19 +03:00
|
|
|
"-Wsuggest-destructor-override",
|
|
|
|
"-Wsuggest-override",
|
2019-08-08 03:05:35 +03:00
|
|
|
|
|
|
|
# The below warnings are used by WebKit. We enable them to make rolling
|
|
|
|
# ANGLE in WebKit easier.
|
|
|
|
"-Wparentheses",
|
|
|
|
"-Wrange-loop-analysis",
|
|
|
|
"-Wstrict-prototypes",
|
2021-07-31 21:41:29 +03:00
|
|
|
"-Wunreachable-code-aggressive",
|
2019-08-07 03:17:19 +03:00
|
|
|
"-Wshorten-64-to-32",
|
2018-01-31 18:47:14 +03:00
|
|
|
]
|
2017-10-11 06:53:20 +03:00
|
|
|
}
|
2019-09-19 00:46:23 +03:00
|
|
|
|
2021-02-12 11:36:18 +03:00
|
|
|
if (is_gcc) {
|
|
|
|
cflags_cc = [ "-Wdeprecated-copy" ]
|
|
|
|
}
|
|
|
|
|
2019-09-19 00:46:23 +03:00
|
|
|
if (angle_is_winuwp) {
|
2021-10-06 19:28:42 +03:00
|
|
|
cflags += [
|
|
|
|
"/wd4091", # keyword ignored on left of type when no variable is declared
|
|
|
|
"/wd4447", # 'main' signature found without threading model.
|
|
|
|
]
|
2019-09-19 00:46:23 +03:00
|
|
|
}
|
2016-07-18 17:10:29 +03:00
|
|
|
}
|
|
|
|
|
2018-05-15 22:35:15 +03:00
|
|
|
# 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" ]
|
|
|
|
}
|
|
|
|
|
2019-10-04 22:17:49 +03:00
|
|
|
_use_copy_compiler_dll = angle_has_build && is_win && target_cpu != "arm64"
|
|
|
|
|
2018-12-01 04:01:01 +03:00
|
|
|
# Windows ARM64 is available since 10.0.16299 so no need to copy
|
|
|
|
# d3dcompiler_47.dll because this file is available as inbox.
|
2019-10-04 22:17:49 +03:00
|
|
|
if (_use_copy_compiler_dll) {
|
2019-02-22 18:24:44 +03:00
|
|
|
# We also ship an older DLL for compatiblity with Windows 7 machines without
|
|
|
|
# the UCRT. This DLL isn't available in the standard SDK distribution.
|
|
|
|
_old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll"
|
|
|
|
_has_old_compiler =
|
|
|
|
exec_script("scripts/file_exists.py", [ _old_compiler ], "value")
|
|
|
|
|
2015-02-25 16:34:49 +03:00
|
|
|
copy("copy_compiler_dll") {
|
2020-02-05 08:31:47 +03:00
|
|
|
sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ]
|
2019-02-22 18:24:44 +03:00
|
|
|
|
|
|
|
if (_has_old_compiler) {
|
|
|
|
sources += [ _old_compiler ]
|
|
|
|
}
|
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
outputs = [ "$root_out_dir/{{source_file_part}}" ]
|
2015-02-25 16:34:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-05 18:07:41 +03:00
|
|
|
# Holds the shared includes so we only need to list them once.
|
2019-02-07 23:26:10 +03:00
|
|
|
config("includes_config") {
|
|
|
|
include_dirs = [ "include" ]
|
|
|
|
}
|
|
|
|
|
2021-01-11 01:29:44 +03:00
|
|
|
config("angle_uwp_env") {
|
|
|
|
if (angle_is_winuwp) {
|
|
|
|
defines = [ "WINAPI_FAMILY=WINAPI_FAMILY_PC_APP" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-21 23:43:46 +03:00
|
|
|
angle_source_set("cl_includes") {
|
|
|
|
sources = cl_includes
|
2021-04-28 20:26:00 +03:00
|
|
|
public_configs = [ ":external_config" ]
|
2021-04-21 23:43:46 +03:00
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_source_set("includes") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_includes
|
2020-08-30 01:25:18 +03:00
|
|
|
public_configs = [ ":includes_config" ]
|
2021-04-21 23:43:46 +03:00
|
|
|
if (angle_enable_cl) {
|
|
|
|
public_deps = [ ":cl_includes" ]
|
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2021-06-30 04:13:39 +03:00
|
|
|
config("disable_unreachable_code_break_warning") {
|
|
|
|
if (is_clang) {
|
|
|
|
cflags = [ "-Wno-unreachable-code-break" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_static_library("preprocessor") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = angle_preprocessor_sources
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2021-06-30 04:13:39 +03:00
|
|
|
# preprocessor_tab_autogen.cpp contains an instance of this.
|
|
|
|
configs += [ ":disable_unreachable_code_break_warning" ]
|
|
|
|
|
2016-09-21 00:15:59 +03:00
|
|
|
public_deps = [
|
|
|
|
":angle_common",
|
2019-10-03 23:22:52 +03:00
|
|
|
":angle_translator_headers",
|
2016-09-21 00:15:59 +03:00
|
|
|
]
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2019-01-17 20:25:54 +03:00
|
|
|
config("angle_disable_pool_alloc") {
|
|
|
|
defines = [ "ANGLE_DISABLE_POOL_ALLOC" ]
|
2014-08-07 20:31:38 +04:00
|
|
|
}
|
|
|
|
|
2015-06-17 01:03:14 +03:00
|
|
|
config("debug_annotations_config") {
|
2021-09-10 17:58:39 +03:00
|
|
|
defines = []
|
2019-03-06 19:32:40 +03:00
|
|
|
if (is_debug) {
|
2021-09-10 17:58:39 +03:00
|
|
|
defines += [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
|
2015-06-17 01:03:14 +03:00
|
|
|
}
|
2020-11-05 03:57:27 +03:00
|
|
|
if (angle_enable_annotator_run_time_checks) {
|
2020-11-04 05:26:00 +03:00
|
|
|
# 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.
|
2021-09-10 17:58:39 +03:00
|
|
|
defines += [ "ANGLE_ENABLE_ANNOTATOR_RUN_TIME_CHECKS" ]
|
2020-11-05 03:57:27 +03:00
|
|
|
}
|
2015-06-17 01:03:14 +03:00
|
|
|
}
|
|
|
|
|
2021-07-19 17:30:57 +03:00
|
|
|
config("angle_asserts_config") {
|
|
|
|
if (angle_assert_always_on) {
|
|
|
|
defines = [ "ANGLE_ASSERT_ALWAYS_ON" ]
|
2016-05-27 15:35:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-02 20:04:10 +03:00
|
|
|
config("angle_common_config") {
|
2017-06-07 21:59:51 +03:00
|
|
|
include_dirs = [ "src/common/third_party/base" ]
|
2018-01-28 02:27:07 +03:00
|
|
|
if (is_android) {
|
|
|
|
libs = [ "log" ]
|
|
|
|
}
|
2016-06-02 20:04:10 +03:00
|
|
|
}
|
|
|
|
|
2020-08-18 18:26:50 +03:00
|
|
|
# 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" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-01 22:16:32 +03:00
|
|
|
angle_source_set("xxhash") {
|
|
|
|
sources = xxhash_sources
|
2020-08-28 21:45:17 +03:00
|
|
|
if (is_clang) {
|
|
|
|
cflags_c = [ "-Wno-implicit-fallthrough" ]
|
|
|
|
}
|
2019-02-01 22:16:32 +03:00
|
|
|
}
|
|
|
|
|
2019-10-04 22:17:49 +03:00
|
|
|
if (angle_has_build) {
|
|
|
|
fuzzer_test("xxhash_fuzzer") {
|
2020-02-05 08:31:47 +03:00
|
|
|
sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ]
|
|
|
|
deps = [ ":xxhash" ]
|
2019-10-04 22:17:49 +03:00
|
|
|
}
|
2019-02-07 17:09:41 +03:00
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_static_library("angle_common") {
|
2018-12-17 21:13:49 +03:00
|
|
|
sources = libangle_common_sources
|
2021-04-27 21:31:31 +03:00
|
|
|
if (angle_enable_cl) {
|
|
|
|
sources += libangle_common_cl_sources
|
|
|
|
}
|
2018-12-16 22:53:23 +03:00
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
configs += [
|
2016-06-02 20:04:10 +03:00
|
|
|
":angle_common_config",
|
2015-06-17 01:03:14 +03:00
|
|
|
":debug_annotations_config",
|
2015-01-14 22:31:02 +03:00
|
|
|
]
|
2016-04-06 23:39:52 +03:00
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
deps = [ ":xxhash" ]
|
2019-02-01 22:16:32 +03:00
|
|
|
|
2016-05-20 00:59:55 +03:00
|
|
|
public_deps = [
|
2020-07-24 20:58:45 +03:00
|
|
|
":angle_abseil",
|
2018-02-21 16:28:01 +03:00
|
|
|
":includes",
|
2016-05-20 00:59:55 +03:00
|
|
|
]
|
2019-01-16 02:33:42 +03:00
|
|
|
public_configs += [ ":angle_common_config" ]
|
2019-10-04 22:17:49 +03:00
|
|
|
if (angle_has_build && use_fuzzing_engine) {
|
2019-10-17 14:56:53 +03:00
|
|
|
all_dependent_configs = [ ":angle_disable_pool_alloc" ]
|
2019-01-17 20:25:54 +03:00
|
|
|
}
|
2020-10-24 03:50:33 +03:00
|
|
|
|
2020-11-23 23:47:09 +03:00
|
|
|
if (is_linux || is_chromeos) {
|
|
|
|
libs = [ "dl" ]
|
|
|
|
}
|
|
|
|
|
2020-10-24 03:50:33 +03:00
|
|
|
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" ]
|
|
|
|
}
|
|
|
|
}
|
2021-03-06 03:40:27 +03:00
|
|
|
|
|
|
|
if (angle_expose_non_conformant_extensions_and_versions) {
|
|
|
|
defines = [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ]
|
|
|
|
}
|
2021-11-11 18:18:36 +03:00
|
|
|
|
2021-11-19 17:41:58 +03:00
|
|
|
if (using_sanitizer && !build_with_chromium) {
|
2021-11-11 18:18:36 +03:00
|
|
|
data_deps = [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ]
|
|
|
|
}
|
2022-07-22 02:40:59 +03:00
|
|
|
|
|
|
|
if (is_apple) {
|
|
|
|
frameworks = [ "Metal.framework" ]
|
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
|
|
|
|
2016-06-13 22:06:31 +03:00
|
|
|
config("angle_image_util_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-10-03 23:22:52 +03:00
|
|
|
angle_source_set("angle_image_util_headers") {
|
|
|
|
sources = libangle_image_util_headers
|
2020-02-05 08:31:47 +03:00
|
|
|
public_deps = [ ":angle_common" ]
|
2019-10-03 23:22:52 +03:00
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_static_library("angle_image_util") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_image_util_sources
|
2019-01-16 02:33:42 +03:00
|
|
|
public_configs += [ ":angle_image_util_config" ]
|
2020-02-05 08:31:47 +03:00
|
|
|
public_deps = [ ":angle_image_util_headers" ]
|
2022-06-03 15:29:23 +03:00
|
|
|
|
|
|
|
if (angle_has_astc_encoder) {
|
|
|
|
public_deps += [ "third_party/astc-encoder:astcenc" ]
|
|
|
|
include_dirs = [ "third_party/astc-encoder/src/Source/" ]
|
|
|
|
}
|
2016-06-13 22:06:31 +03:00
|
|
|
}
|
|
|
|
|
2018-10-09 04:25:19 +03:00
|
|
|
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\")))",
|
|
|
|
]
|
2018-10-09 01:43:43 +03:00
|
|
|
}
|
2018-08-30 02:04:15 +03:00
|
|
|
}
|
|
|
|
|
2022-03-30 15:16:02 +03:00
|
|
|
config("angle_vulkan_wayland_config") {
|
|
|
|
if (angle_enable_vulkan && angle_use_wayland &&
|
|
|
|
defined(vulkan_wayland_include_dirs)) {
|
|
|
|
include_dirs = vulkan_wayland_include_dirs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-08 18:43:47 +03:00
|
|
|
config("angle_gpu_info_util_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_static_library("angle_gpu_info_util") {
|
2019-04-25 17:49:05 +03:00
|
|
|
public_configs += [
|
|
|
|
":angle_gpu_info_util_config",
|
|
|
|
":angle_backend_config",
|
|
|
|
]
|
2020-02-05 08:31:47 +03:00
|
|
|
public_deps = [ ":angle_common" ]
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_gpu_info_util_sources
|
2017-02-08 18:43:47 +03:00
|
|
|
deps = []
|
|
|
|
libs = []
|
|
|
|
defines = []
|
|
|
|
|
2021-11-11 19:43:30 +03:00
|
|
|
if (angle_build_vulkan_system_info) {
|
2020-01-25 01:27:01 +03:00
|
|
|
sources += libangle_gpu_info_util_vulkan_sources
|
2021-07-16 20:24:34 +03:00
|
|
|
deps += [
|
|
|
|
"$angle_vulkan_headers_dir:vulkan_headers",
|
2021-11-11 19:43:30 +03:00
|
|
|
"src/common/vulkan:angle_libvulkan_loader",
|
|
|
|
"src/common/vulkan:angle_vulkan_icd",
|
2021-07-16 20:24:34 +03:00
|
|
|
]
|
2021-09-07 22:49:07 +03:00
|
|
|
if (angle_enable_vulkan_system_info) {
|
2021-11-11 19:43:30 +03:00
|
|
|
defines += [ "ANGLE_USE_VULKAN_SYSTEM_INFO" ]
|
2021-09-07 22:49:07 +03:00
|
|
|
}
|
2020-01-25 01:27:01 +03:00
|
|
|
}
|
|
|
|
|
2018-06-23 00:42:09 +03:00
|
|
|
if (is_android) {
|
2020-01-25 01:27:01 +03:00
|
|
|
sources += libangle_gpu_info_util_android_sources
|
|
|
|
}
|
|
|
|
|
|
|
|
if (is_fuchsia) {
|
|
|
|
sources += libangle_gpu_info_util_fuchsia_sources
|
2020-06-16 21:27:04 +03:00
|
|
|
deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ]
|
2018-06-23 00:42:09 +03:00
|
|
|
}
|
|
|
|
|
2017-03-24 21:58:59 +03:00
|
|
|
if (is_win) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_win_sources
|
2019-09-19 00:46:23 +03:00
|
|
|
if (!angle_is_winuwp) {
|
|
|
|
libs += [ "setupapi.lib" ]
|
|
|
|
}
|
2019-04-25 17:49:05 +03:00
|
|
|
libs += [ "dxgi.lib" ]
|
2017-03-24 21:58:59 +03:00
|
|
|
}
|
|
|
|
|
2020-09-10 20:40:34 +03:00
|
|
|
if (is_linux || is_chromeos) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_linux_sources
|
2017-02-08 18:43:47 +03:00
|
|
|
|
2020-08-26 19:59:19 +03:00
|
|
|
if (angle_use_x11 && angle_has_build) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_x11_sources
|
2017-02-08 18:43:47 +03:00
|
|
|
deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
|
|
|
|
defines += [ "GPU_INFO_USE_X11" ]
|
|
|
|
libs += [
|
|
|
|
"X11",
|
|
|
|
"Xi",
|
|
|
|
"Xext",
|
|
|
|
]
|
|
|
|
}
|
2021-12-09 18:52:35 +03:00
|
|
|
|
|
|
|
if (angle_use_wayland && angle_has_build) {
|
|
|
|
public_deps += [ ":angle_wayland" ]
|
|
|
|
}
|
2017-02-08 18:43:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (use_libpci) {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources += libangle_gpu_info_util_libpci_sources
|
2017-02-08 18:43:47 +03:00
|
|
|
defines += [ "GPU_INFO_USE_LIBPCI" ]
|
|
|
|
libs += [ "pci" ]
|
|
|
|
}
|
2017-02-16 18:58:46 +03:00
|
|
|
|
2021-01-12 07:11:56 +03:00
|
|
|
if (is_apple) {
|
2020-07-02 18:19:14 +03:00
|
|
|
frameworks = [
|
2017-02-16 18:58:46 +03:00
|
|
|
"IOKit.framework",
|
|
|
|
"CoreFoundation.framework",
|
2017-10-11 18:38:55 +03:00
|
|
|
"CoreGraphics.framework",
|
2017-02-16 18:58:46 +03:00
|
|
|
]
|
2020-12-03 03:26:03 +03:00
|
|
|
if (angle_enable_eagl) {
|
|
|
|
frameworks += [ "OpenGLES.framework" ]
|
|
|
|
} else 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
|
|
|
|
}
|
2017-02-16 18:58:46 +03:00
|
|
|
}
|
2017-02-08 18:43:47 +03:00
|
|
|
}
|
|
|
|
|
2019-10-03 23:22:52 +03:00
|
|
|
angle_source_set("angle_translator_headers") {
|
|
|
|
sources = angle_translator_exported_headers
|
2020-02-05 08:31:47 +03:00
|
|
|
public_deps = [ ":includes" ]
|
2019-10-03 23:22:52 +03:00
|
|
|
}
|
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
template("translator_lib") {
|
|
|
|
angle_static_library(target_name) {
|
|
|
|
sources = angle_translator_sources
|
|
|
|
defines = []
|
|
|
|
|
|
|
|
_needs_glsl_base = false
|
|
|
|
_needs_glsl_and_vulkan_base = false
|
|
|
|
_uses_spirv = false
|
|
|
|
|
2021-08-08 05:05:27 +03:00
|
|
|
# Frontend support:
|
|
|
|
if (angle_enable_desktop_glsl) {
|
|
|
|
sources += angle_translator_glsl_symbol_table_sources
|
|
|
|
} else {
|
|
|
|
sources += angle_translator_essl_symbol_table_sources
|
|
|
|
}
|
|
|
|
|
|
|
|
# Backend support:
|
2021-03-31 18:11:26 +03:00
|
|
|
if (angle_enable_essl || use_fuzzing_engine) {
|
|
|
|
_needs_glsl_base = true
|
|
|
|
sources += angle_translator_essl_sources
|
|
|
|
defines += [ "ANGLE_ENABLE_ESSL" ]
|
|
|
|
}
|
2020-12-25 07:56:39 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
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" ]
|
|
|
|
}
|
2015-12-11 20:30:15 +03:00
|
|
|
|
2021-07-23 05:31:29 +03:00
|
|
|
if (angle_enable_apple_translator_workarounds) {
|
|
|
|
sources += angle_translator_apple_sources
|
|
|
|
defines += [ "ANGLE_ENABLE_APPLE_WORKAROUNDS" ]
|
|
|
|
}
|
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
if (angle_enable_hlsl || use_fuzzing_engine) {
|
|
|
|
sources += angle_translator_hlsl_sources
|
|
|
|
defines += [ "ANGLE_ENABLE_HLSL" ]
|
2020-12-25 07:56:39 +03:00
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
if (!invoker.gl_d3d_only) {
|
2022-04-26 19:05:07 +03:00
|
|
|
if (angle_enable_vulkan || use_fuzzing_engine ||
|
|
|
|
angle_enable_msl_through_spirv) {
|
2021-03-31 18:11:26 +03:00
|
|
|
_needs_glsl_base = true
|
|
|
|
_needs_glsl_and_vulkan_base = true
|
|
|
|
_uses_spirv = true
|
2017-01-14 01:29:51 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
# This translator is needed by metal backend also.
|
|
|
|
sources += angle_translator_lib_vulkan_sources
|
|
|
|
}
|
2020-12-25 07:56:39 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
if (angle_enable_vulkan || use_fuzzing_engine) {
|
|
|
|
defines += [ "ANGLE_ENABLE_VULKAN" ]
|
|
|
|
}
|
2019-10-09 19:44:01 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
if (angle_enable_metal) {
|
|
|
|
sources += angle_translator_lib_metal_sources
|
2022-04-26 19:05:07 +03:00
|
|
|
defines += [ "ANGLE_ENABLE_METAL" ]
|
|
|
|
if (angle_enable_msl_through_spirv) {
|
|
|
|
defines += [ "ANGLE_ENABLE_METAL_SPIRV" ]
|
|
|
|
}
|
2021-03-31 18:11:26 +03:00
|
|
|
}
|
|
|
|
}
|
2017-01-14 01:29:51 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
if (_needs_glsl_base) {
|
|
|
|
sources += angle_translator_glsl_base_sources
|
|
|
|
}
|
|
|
|
if (_needs_glsl_and_vulkan_base) {
|
|
|
|
sources += angle_translator_glsl_and_vulkan_base_sources
|
|
|
|
}
|
2019-10-09 19:44:01 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
public_configs += [ ":external_config" ]
|
2019-10-25 19:53:40 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":preprocessor",
|
2021-04-07 22:23:32 +03:00
|
|
|
"$angle_root/src/common/spirv:angle_spirv_headers",
|
2021-03-31 18:11:26 +03:00
|
|
|
]
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
if (_uses_spirv) {
|
|
|
|
deps += [
|
|
|
|
"$angle_root/src/common/spirv:angle_spirv_base",
|
2021-04-07 22:24:12 +03:00
|
|
|
"$angle_root/src/common/spirv:angle_spirv_builder",
|
|
|
|
"${angle_spirv_headers_dir}:spv_headers",
|
2021-03-31 18:11:26 +03:00
|
|
|
"${angle_spirv_tools_dir}:spvtools_headers",
|
|
|
|
"${angle_spirv_tools_dir}:spvtools_val",
|
|
|
|
]
|
2021-08-24 00:25:15 +03:00
|
|
|
|
|
|
|
if (angle_enable_spirv_gen_through_glslang) {
|
|
|
|
defines += [ "ANGLE_ENABLE_SPIRV_GENERATION_THROUGH_GLSLANG" ]
|
|
|
|
sources += [ "src/compiler/translator/glslang_wrapper.cpp" ]
|
|
|
|
deps += [
|
|
|
|
"${angle_glslang_dir}:glslang_default_resource_limits_sources",
|
|
|
|
"${angle_glslang_dir}:glslang_lib_sources",
|
|
|
|
]
|
|
|
|
}
|
2021-03-31 18:11:26 +03:00
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
public_deps = [
|
|
|
|
":angle_common",
|
|
|
|
":angle_translator_headers",
|
2021-02-26 08:00:57 +03:00
|
|
|
]
|
2021-03-31 18:11:26 +03:00
|
|
|
|
|
|
|
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" ]
|
|
|
|
}
|
2021-02-26 08:00:57 +03:00
|
|
|
}
|
2021-03-31 18:11:26 +03:00
|
|
|
}
|
2021-02-26 08:00:57 +03:00
|
|
|
|
2021-03-31 18:11:26 +03:00
|
|
|
translator_lib("translator") {
|
|
|
|
gl_d3d_only = false
|
|
|
|
}
|
2016-07-18 20:47:12 +03:00
|
|
|
|
2021-05-04 18:46:36 +03:00
|
|
|
if (angle_enable_essl || angle_enable_glsl || angle_enable_hlsl) {
|
|
|
|
translator_lib("translator_gl_d3d_only") {
|
|
|
|
gl_d3d_only = true
|
|
|
|
}
|
2014-06-23 23:13:02 +04:00
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_source_set("translator_fuzzer") {
|
2020-02-05 08:31:47 +03:00
|
|
|
sources = [ "src/compiler/fuzz/translator_fuzzer.cpp" ]
|
2016-06-16 17:24:50 +03:00
|
|
|
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
deps = [ ":translator" ]
|
2016-06-16 17:24:50 +03:00
|
|
|
}
|
|
|
|
|
2020-09-23 06:10:04 +03:00
|
|
|
config("angle_commit_id_config") {
|
2014-06-23 23:13:02 +04:00
|
|
|
include_dirs = [ "$root_gen_dir/angle" ]
|
2020-09-23 06:10:04 +03:00
|
|
|
visibility = [ ":angle_commit_id" ]
|
2018-12-17 22:04:10 +03:00
|
|
|
}
|
|
|
|
|
2020-09-23 06:10:04 +03:00
|
|
|
action("angle_commit_id") {
|
2021-10-08 20:00:19 +03:00
|
|
|
_commit_id_header = "$root_gen_dir/angle/angle_commit.h"
|
2020-02-24 22:13:40 +03:00
|
|
|
script = "src/commit_id.py"
|
2021-10-08 20:00:19 +03:00
|
|
|
outputs = [ _commit_id_header ]
|
|
|
|
|
|
|
|
visibility = [ ":angle_version" ]
|
2014-06-23 23:13:02 +04:00
|
|
|
|
2020-02-24 22:13:40 +03:00
|
|
|
# Add git as a dependency if it is available.
|
2020-03-06 19:02:31 +03:00
|
|
|
if (angle_enable_commit_id &&
|
|
|
|
exec_script("src/commit_id.py", [ "check" ], "value") == 1) {
|
2020-03-02 17:41:22 +03:00
|
|
|
# commit id should depend on angle's HEAD revision
|
|
|
|
inputs = [ ".git/HEAD" ]
|
2020-08-16 06:50:59 +03:00
|
|
|
branch = read_file(".git/HEAD", "string")
|
|
|
|
result = string_split(branch)
|
|
|
|
if (result[0] == "ref:") {
|
2021-07-02 05:55:59 +03:00
|
|
|
_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/" + _ref_file ]
|
2020-08-16 06:50:59 +03:00
|
|
|
}
|
2020-02-26 03:33:21 +03:00
|
|
|
}
|
2020-02-24 22:13:40 +03:00
|
|
|
|
|
|
|
args = [
|
|
|
|
"gen",
|
2021-10-08 20:00:19 +03:00
|
|
|
rebase_path(_commit_id_header, root_build_dir),
|
2020-02-24 22:13:40 +03:00
|
|
|
]
|
|
|
|
|
2020-09-23 06:10:04 +03:00
|
|
|
public_configs = [ ":angle_commit_id_config" ]
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_source_set("angle_version") {
|
2021-05-26 21:29:01 +03:00
|
|
|
sources = [ "src/common/angle_version.h" ]
|
2020-09-23 06:10:04 +03:00
|
|
|
public_deps = [ ":angle_commit_id" ]
|
2021-10-08 20:00:19 +03:00
|
|
|
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",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
angle_source_set("angle_version_info") {
|
|
|
|
sources = [
|
|
|
|
"src/common/angle_version_info.cpp",
|
|
|
|
"src/common/angle_version_info.h",
|
|
|
|
]
|
|
|
|
deps = [ ":angle_version" ]
|
2018-12-17 21:13:49 +03:00
|
|
|
}
|
|
|
|
|
2019-04-25 17:49:05 +03:00
|
|
|
config("angle_backend_config") {
|
2015-01-14 22:31:02 +03:00
|
|
|
defines = []
|
2019-04-25 17:49:05 +03:00
|
|
|
|
2020-06-05 02:53:36 +03:00
|
|
|
if (angle_delegate_workers) {
|
|
|
|
defines += [ "ANGLE_DELEGATE_WORKERS" ]
|
|
|
|
}
|
2019-10-03 23:22:52 +03:00
|
|
|
|
2021-04-07 19:33:31 +03:00
|
|
|
if (angle_force_context_check_every_call) {
|
|
|
|
defines += [ "ANGLE_FORCE_CONTEXT_CHECK_EVERY_CALL=1" ]
|
|
|
|
}
|
|
|
|
|
2021-04-09 03:49:05 +03:00
|
|
|
if (angle_expose_non_conformant_extensions_and_versions) {
|
|
|
|
defines += [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ]
|
|
|
|
}
|
|
|
|
|
2022-03-04 04:29:12 +03:00
|
|
|
if (angle_use_spirv_gen_through_glslang) {
|
|
|
|
defines += [ "ANGLE_USE_SPIRV_GENERATION_THROUGH_GLSLANG" ]
|
|
|
|
}
|
|
|
|
|
2019-10-25 19:53:40 +03:00
|
|
|
configs = []
|
|
|
|
|
2020-09-11 20:50:09 +03:00
|
|
|
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" ]
|
|
|
|
}
|
|
|
|
|
2020-09-11 19:30:04 +03:00
|
|
|
if (angle_enable_gl) {
|
|
|
|
configs += [ "src/libANGLE/renderer/gl:angle_gl_backend_config" ]
|
|
|
|
}
|
|
|
|
|
2020-09-11 18:54:35 +03:00
|
|
|
if (angle_enable_null) {
|
|
|
|
configs += [ "src/libANGLE/renderer/null:angle_null_backend_config" ]
|
|
|
|
}
|
|
|
|
|
2019-10-09 19:44:01 +03:00
|
|
|
if (angle_enable_metal) {
|
2019-10-25 19:53:40 +03:00
|
|
|
configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ]
|
2019-10-09 19:44:01 +03:00
|
|
|
}
|
|
|
|
|
2019-10-03 23:22:52 +03:00
|
|
|
if (angle_enable_vulkan) {
|
2019-10-25 19:53:40 +03:00
|
|
|
configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
|
2019-10-03 23:22:52 +03:00
|
|
|
}
|
2021-01-11 01:29:44 +03:00
|
|
|
|
2021-04-27 13:36:11 +03:00
|
|
|
if (angle_enable_cl_passthrough) {
|
|
|
|
configs += [ "src/libANGLE/renderer/cl:angle_cl_backend_config" ]
|
|
|
|
}
|
|
|
|
|
2021-01-11 01:29:44 +03:00
|
|
|
if (angle_is_winuwp) {
|
|
|
|
configs += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp_config" ]
|
|
|
|
}
|
2019-04-25 17:49:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
config("libANGLE_config") {
|
|
|
|
cflags = []
|
|
|
|
defines = []
|
|
|
|
libs = []
|
|
|
|
ldflags = []
|
2017-01-03 19:03:23 +03:00
|
|
|
defines += [ "LIBANGLE_IMPLEMENTATION" ]
|
2015-09-02 17:30:55 +03:00
|
|
|
|
2015-02-12 21:39:56 +03:00
|
|
|
if (is_win) {
|
2020-02-05 08:31:47 +03:00
|
|
|
cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics
|
|
|
|
# are not enabled.
|
2015-02-12 21:39:56 +03:00
|
|
|
}
|
2018-11-28 18:09:39 +03:00
|
|
|
|
|
|
|
if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
|
2019-02-12 20:41:01 +03:00
|
|
|
# In API level 26 ANativeWindow APIs were moved from libandroid.so
|
|
|
|
# into a separate library, libnativewindow.so
|
|
|
|
if (ndk_api_level_at_least_26) {
|
2018-11-28 18:09:39 +03:00
|
|
|
libs += [ "nativewindow" ]
|
|
|
|
} else {
|
|
|
|
libs += [ "android" ]
|
|
|
|
}
|
|
|
|
}
|
2019-08-22 03:03:49 +03:00
|
|
|
|
2019-11-15 20:26:39 +03:00
|
|
|
if (angle_use_x11) {
|
2019-08-22 03:03:49 +03:00
|
|
|
defines += [ "ANGLE_USE_X11" ]
|
|
|
|
}
|
2020-01-28 18:05:36 +03:00
|
|
|
|
2021-12-09 18:52:35 +03:00
|
|
|
if (angle_use_wayland) {
|
|
|
|
defines += [ "ANGLE_USE_WAYLAND" ]
|
|
|
|
}
|
|
|
|
|
2020-01-28 18:05:36 +03:00
|
|
|
if (angle_enable_overlay) {
|
|
|
|
defines += [ "ANGLE_ENABLE_OVERLAY=1" ]
|
|
|
|
}
|
2020-09-24 20:39:49 +03:00
|
|
|
if (angle_enable_perf_counter_output) {
|
|
|
|
defines += [ "ANGLE_ENABLE_PERF_COUNTER_OUTPUT=1" ]
|
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2014-11-19 22:20:15 +03:00
|
|
|
|
2019-10-03 23:22:52 +03:00
|
|
|
angle_source_set("libANGLE_headers") {
|
|
|
|
sources = libangle_headers
|
2021-04-21 23:43:46 +03:00
|
|
|
if (angle_enable_cl) {
|
|
|
|
sources += libangle_cl_headers
|
|
|
|
}
|
2019-10-03 23:22:52 +03:00
|
|
|
public_deps = [
|
|
|
|
":angle_common",
|
|
|
|
":angle_translator_headers",
|
|
|
|
]
|
2020-01-28 18:05:36 +03:00
|
|
|
public_configs += [ ":libANGLE_config" ]
|
2018-02-06 17:54:02 +03:00
|
|
|
}
|
|
|
|
|
2019-10-28 18:48:46 +03:00
|
|
|
# Don't even try to build glslang if Metal and Vulkan are disabled.
|
|
|
|
if (angle_enable_vulkan || angle_enable_metal) {
|
|
|
|
angle_source_set("angle_glslang_wrapper") {
|
|
|
|
sources = [
|
2022-01-06 02:28:11 +03:00
|
|
|
"src/libANGLE/renderer/ShaderInterfaceVariableInfoMap.cpp",
|
|
|
|
"src/libANGLE/renderer/ShaderInterfaceVariableInfoMap.h",
|
2019-10-28 18:48:46 +03:00
|
|
|
"src/libANGLE/renderer/glslang_wrapper_utils.cpp",
|
|
|
|
"src/libANGLE/renderer/glslang_wrapper_utils.h",
|
|
|
|
]
|
|
|
|
deps = [
|
|
|
|
":libANGLE_headers",
|
2021-02-26 00:26:53 +03:00
|
|
|
"$angle_root/src/common/spirv:angle_spirv_base",
|
2021-01-21 08:36:14 +03:00
|
|
|
"$angle_root/src/common/spirv:angle_spirv_builder",
|
2021-04-07 22:23:32 +03:00
|
|
|
"$angle_root/src/common/spirv:angle_spirv_headers",
|
2021-01-21 08:36:14 +03:00
|
|
|
"$angle_root/src/common/spirv:angle_spirv_parser",
|
2020-01-14 22:12:31 +03:00
|
|
|
"${angle_spirv_headers_dir}:spv_headers",
|
2019-10-28 18:48:46 +03:00
|
|
|
]
|
|
|
|
}
|
2019-10-14 09:49:49 +03:00
|
|
|
}
|
|
|
|
|
2021-09-14 17:29:14 +03:00
|
|
|
if ((is_win && angle_enable_gl) || angle_enable_d3d11 || angle_enable_d3d9) {
|
2020-09-11 19:36:05 +03:00
|
|
|
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" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-31 00:22:17 +03:00
|
|
|
angle_source_set("libANGLE_base") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libangle_sources
|
2021-04-21 23:43:46 +03:00
|
|
|
if (angle_enable_cl) {
|
|
|
|
sources += libangle_cl_sources
|
|
|
|
}
|
2022-07-21 19:38:47 +03:00
|
|
|
defines = []
|
|
|
|
if (angle_enable_gl_desktop_frontend) {
|
|
|
|
defines += [ "ANGLE_ENABLE_GL_DESKTOP_FRONTEND" ]
|
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
|
2017-06-07 21:59:51 +03:00
|
|
|
include_dirs = []
|
2015-01-14 22:31:02 +03:00
|
|
|
libs = []
|
2017-12-12 07:58:53 +03:00
|
|
|
if (angle_link_glx) {
|
|
|
|
libs += [ "GL" ]
|
|
|
|
defines += [ "ANGLE_LINK_GLX" ]
|
|
|
|
}
|
2016-06-02 20:04:10 +03:00
|
|
|
public_deps = [
|
2016-03-01 00:37:04 +03:00
|
|
|
":angle_common",
|
2018-12-17 22:04:10 +03:00
|
|
|
":angle_gpu_info_util",
|
2021-10-08 20:00:19 +03:00
|
|
|
":angle_version_info",
|
2019-10-03 23:22:52 +03:00
|
|
|
":libANGLE_headers",
|
2018-12-17 22:04:10 +03:00
|
|
|
":translator",
|
2016-06-02 20:04:10 +03:00
|
|
|
]
|
|
|
|
deps = [
|
2020-06-03 03:01:24 +03:00
|
|
|
":angle_compression",
|
2017-02-15 21:57:16 +03:00
|
|
|
":angle_image_util",
|
2016-03-01 00:37:04 +03:00
|
|
|
":includes",
|
|
|
|
]
|
|
|
|
|
2021-01-11 01:29:44 +03:00
|
|
|
if (is_win && !angle_is_winuwp) {
|
2019-10-24 19:55:12 +03:00
|
|
|
libs += [
|
|
|
|
"gdi32.lib",
|
|
|
|
"user32.lib",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-09-11 20:50:09 +03:00
|
|
|
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" ]
|
|
|
|
}
|
|
|
|
|
2020-09-11 19:30:04 +03:00
|
|
|
if (angle_enable_gl) {
|
|
|
|
public_deps += [ "src/libANGLE/renderer/gl:angle_gl_backend" ]
|
|
|
|
}
|
|
|
|
|
2020-09-11 18:54:35 +03:00
|
|
|
if (angle_enable_null) {
|
|
|
|
public_deps += [ "src/libANGLE/renderer/null:angle_null_backend" ]
|
|
|
|
}
|
|
|
|
|
2019-10-03 23:22:52 +03:00
|
|
|
if (angle_enable_vulkan) {
|
|
|
|
public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ]
|
|
|
|
}
|
|
|
|
|
2021-01-11 01:29:44 +03:00
|
|
|
if (angle_is_winuwp) {
|
|
|
|
public_deps += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
if (angle_enable_d3d11) {
|
|
|
|
libs += [ "dxguid.lib" ]
|
|
|
|
}
|
|
|
|
|
2019-10-09 19:44:01 +03:00
|
|
|
if (angle_enable_metal) {
|
|
|
|
public_deps += [ "src/libANGLE/renderer/metal:angle_metal_backend" ]
|
|
|
|
}
|
|
|
|
|
2021-04-27 13:36:11 +03:00
|
|
|
if (angle_enable_cl_passthrough) {
|
|
|
|
public_deps += [ "src/libANGLE/renderer/cl:angle_cl_backend" ]
|
|
|
|
}
|
|
|
|
|
2019-01-16 03:06:47 +03:00
|
|
|
# Enable extra Chromium style warnings for libANGLE.
|
2021-11-09 18:26:10 +03:00
|
|
|
if (is_clang && angle_has_build) {
|
2019-01-16 03:06:47 +03:00
|
|
|
suppressed_configs -= [ "//build/config/clang:find_bad_constructs" ]
|
|
|
|
}
|
|
|
|
|
2021-01-12 07:11:56 +03:00
|
|
|
if (is_apple) {
|
2019-07-09 22:39:39 +03:00
|
|
|
sources += libangle_mac_sources
|
|
|
|
}
|
|
|
|
|
2021-04-27 02:56:15 +03:00
|
|
|
if (is_ios) {
|
|
|
|
sources += [ "src/libANGLE/renderer/driver_utils_ios.mm" ]
|
|
|
|
}
|
|
|
|
|
2015-01-14 22:31:02 +03:00
|
|
|
if (is_debug) {
|
2016-01-04 19:25:00 +03:00
|
|
|
defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2015-01-07 21:22:02 +03:00
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
configs += [ ":debug_annotations_config" ]
|
2019-04-25 17:49:05 +03:00
|
|
|
public_configs += [
|
|
|
|
":libANGLE_config",
|
|
|
|
":angle_backend_config",
|
|
|
|
]
|
2017-01-03 19:03:23 +03:00
|
|
|
|
2018-12-01 04:01:01 +03:00
|
|
|
# Windows ARM64 is available since 10.0.16299 so no need to copy
|
|
|
|
# d3dcompiler_47.dll because this file is available as inbox.
|
2019-10-04 22:17:49 +03:00
|
|
|
if (_use_copy_compiler_dll) {
|
2020-02-05 08:31:47 +03:00
|
|
|
data_deps = [ ":copy_compiler_dll" ]
|
2015-01-14 01:52:17 +03:00
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
2015-01-13 19:13:56 +03:00
|
|
|
|
2019-07-31 00:22:17 +03:00
|
|
|
config("angle_frame_capture_disabled") {
|
|
|
|
defines = [ "ANGLE_CAPTURE_ENABLED=0" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
angle_source_set("libANGLE") {
|
2020-02-05 08:31:47 +03:00
|
|
|
public_deps = [ ":libANGLE_base" ]
|
2019-07-31 00:22:17 +03:00
|
|
|
public_configs = [ ":angle_frame_capture_disabled" ]
|
2021-04-02 20:17:00 +03:00
|
|
|
sources = [
|
|
|
|
"src/libANGLE/capture/FrameCapture_mock.cpp",
|
|
|
|
"src/libANGLE/capture/frame_capture_utils_mock.cpp",
|
|
|
|
]
|
2019-08-09 19:03:24 +03:00
|
|
|
|
|
|
|
# gl_enum_utils defaults included in with_capture build
|
2020-08-30 01:25:18 +03:00
|
|
|
deps = []
|
2019-08-09 19:03:24 +03:00
|
|
|
if (angle_enable_trace || is_debug) {
|
2019-10-28 19:12:53 +03:00
|
|
|
deps += [ ":angle_gl_enum_utils" ]
|
2019-08-09 19:03:24 +03:00
|
|
|
}
|
2019-07-31 00:22:17 +03:00
|
|
|
}
|
|
|
|
|
2019-10-28 19:12:53 +03:00
|
|
|
angle_source_set("angle_gl_enum_utils") {
|
2021-08-15 22:20:32 +03:00
|
|
|
deps = [ ":angle_common" ]
|
2019-10-28 19:12:53 +03:00
|
|
|
sources = [
|
2021-02-10 19:20:16 +03:00
|
|
|
"src/libANGLE/capture/gl_enum_utils.cpp",
|
2021-08-15 22:20:32 +03:00
|
|
|
"src/libANGLE/capture/gl_enum_utils.h",
|
2021-02-10 19:20:16 +03:00
|
|
|
"src/libANGLE/capture/gl_enum_utils_autogen.cpp",
|
2021-08-15 22:20:32 +03:00
|
|
|
"src/libANGLE/capture/gl_enum_utils_autogen.h",
|
2019-10-28 19:12:53 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2021-12-09 18:52:35 +03:00
|
|
|
if (angle_use_wayland) {
|
|
|
|
config("angle_wayland_config") {
|
2022-06-09 11:50:41 +03:00
|
|
|
if (use_system_libwayland) {
|
2021-12-09 18:52:35 +03:00
|
|
|
libs = [
|
|
|
|
"wayland-client",
|
|
|
|
"wayland-egl",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
include_dirs = [
|
2022-06-09 11:50:41 +03:00
|
|
|
"$wayland_dir/egl",
|
|
|
|
"$wayland_dir/src",
|
2021-12-09 18:52:35 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
group("angle_wayland") {
|
|
|
|
public_configs = [ ":angle_wayland_config" ]
|
|
|
|
|
2022-06-09 11:50:41 +03:00
|
|
|
if (!use_system_libwayland) {
|
|
|
|
# Use third-party targets
|
2021-12-09 18:52:35 +03:00
|
|
|
public_deps = [
|
2022-06-09 11:50:41 +03:00
|
|
|
"$wayland_gn_dir:wayland_client",
|
|
|
|
"$wayland_gn_dir:wayland_egl",
|
2021-12-09 18:52:35 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-24 20:58:45 +03:00
|
|
|
if (!defined(angle_abseil_cpp_dir)) {
|
|
|
|
angle_abseil_cpp_dir = "//third_party/abseil-cpp"
|
|
|
|
}
|
|
|
|
|
|
|
|
config("angle_abseil_config") {
|
2020-09-28 19:15:46 +03:00
|
|
|
if (angle_enable_abseil) {
|
|
|
|
defines = [ "ANGLE_USE_ABSEIL" ]
|
2020-07-24 20:58:45 +03:00
|
|
|
|
2020-09-28 19:15:46 +03:00
|
|
|
configs = [
|
|
|
|
"$angle_abseil_cpp_dir:absl_define_config",
|
|
|
|
"$angle_abseil_cpp_dir:absl_include_config",
|
|
|
|
]
|
|
|
|
}
|
2020-07-24 20:58:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
group("angle_abseil") {
|
2020-09-28 19:15:46 +03:00
|
|
|
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 ANGLE.
|
2020-10-08 23:45:51 +03:00
|
|
|
if (build_with_chromium || is_component_build) {
|
2020-09-28 19:15:46 +03:00
|
|
|
public_deps = [ "$angle_abseil_cpp_dir:absl" ]
|
|
|
|
} else {
|
2021-07-29 22:54:26 +03:00
|
|
|
public_deps = [
|
|
|
|
"$angle_abseil_cpp_dir/absl/container:flat_hash_map",
|
|
|
|
"$angle_abseil_cpp_dir/absl/container:flat_hash_set",
|
|
|
|
]
|
2020-09-28 19:15:46 +03:00
|
|
|
}
|
2020-07-24 20:58:45 +03:00
|
|
|
|
2020-09-28 19:15:46 +03:00
|
|
|
public_configs = [ ":angle_abseil_config" ]
|
|
|
|
}
|
2020-07-24 20:58:45 +03:00
|
|
|
}
|
|
|
|
|
2020-03-16 05:11:03 +03:00
|
|
|
config("angle_compression_config") {
|
|
|
|
include_dirs = [ "//third_party/zlib/google" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
group("angle_compression") {
|
|
|
|
public_configs = [
|
|
|
|
":angle_compression_config",
|
|
|
|
"//third_party/zlib:zlib_config",
|
|
|
|
]
|
2020-08-26 19:59:18 +03:00
|
|
|
public_deps =
|
|
|
|
[ "$angle_zlib_compression_utils_dir:compression_utils_portable" ]
|
2020-03-16 05:11:03 +03:00
|
|
|
}
|
|
|
|
|
2021-06-18 23:25:40 +03:00
|
|
|
if (angle_has_rapidjson) {
|
2021-04-02 20:17:00 +03:00
|
|
|
config("angle_rapidjson_config") {
|
|
|
|
defines = [ "ANGLE_HAS_RAPIDJSON" ]
|
|
|
|
}
|
|
|
|
angle_source_set("angle_json_serializer") {
|
|
|
|
public_deps = [
|
2021-09-22 20:39:55 +03:00
|
|
|
":angle_common",
|
2021-04-02 20:17:00 +03:00
|
|
|
"$angle_root/third_party/rapidjson",
|
|
|
|
]
|
|
|
|
sources = [
|
2021-09-14 21:40:49 +03:00
|
|
|
"src/common/serializer/JsonSerializer.cpp",
|
|
|
|
"src/common/serializer/JsonSerializer.h",
|
2021-04-02 20:17:00 +03:00
|
|
|
]
|
|
|
|
public_configs = [ ":angle_rapidjson_config" ]
|
2021-03-31 10:34:00 +03:00
|
|
|
}
|
2021-03-15 13:25:39 +03:00
|
|
|
}
|
|
|
|
|
2021-09-10 00:26:56 +03:00
|
|
|
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" ]
|
|
|
|
}
|
2021-04-02 20:17:00 +03:00
|
|
|
|
2021-09-10 00:26:56 +03:00
|
|
|
angle_source_set("libANGLE_with_capture") {
|
|
|
|
public_deps = [ ":libANGLE_base" ]
|
|
|
|
deps = [ ":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/frame_capture_utils.cpp" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "src/libANGLE/capture/frame_capture_utils_mock.cpp" ]
|
|
|
|
}
|
2021-04-02 20:17:00 +03:00
|
|
|
}
|
2019-07-05 18:13:30 +03:00
|
|
|
}
|
|
|
|
|
2022-05-24 16:58:36 +03:00
|
|
|
if (angle_build_tests) {
|
|
|
|
# Used by a few targets that compile traces.
|
|
|
|
config("angle_trace_fixture_config") {
|
|
|
|
include_dirs = [ "src/libANGLE/capture" ]
|
|
|
|
}
|
2022-05-16 12:58:59 +03:00
|
|
|
|
2022-05-24 16:58:36 +03:00
|
|
|
angle_source_set("angle_trace_fixture") {
|
|
|
|
testonly = true
|
|
|
|
defines = [ "ANGLE_REPLAY_IMPLEMENTATION" ]
|
|
|
|
suppressed_configs += [ "$angle_root:constructor_and_destructor_warnings" ]
|
|
|
|
sources = [
|
|
|
|
"src/libANGLE/capture/trace_fixture.cpp",
|
|
|
|
"src/libANGLE/capture/trace_fixture.h",
|
|
|
|
]
|
|
|
|
public_deps = [
|
|
|
|
":includes",
|
|
|
|
"util:angle_trace_loader",
|
|
|
|
]
|
|
|
|
include_dirs = [ "." ]
|
|
|
|
public_configs = [ ":angle_trace_fixture_config" ]
|
|
|
|
if (is_ios) {
|
|
|
|
# shared libraries are hidden inside ios_framework_bundle, but we include headers from them
|
|
|
|
check_includes = false
|
|
|
|
}
|
2022-05-16 12:58:59 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-21 18:47:03 +03:00
|
|
|
config("shared_library_public_config") {
|
2020-12-08 23:24:35 +03:00
|
|
|
if (is_mac && !is_component_build) {
|
2016-06-21 18:47:03 +03:00
|
|
|
# Executable targets that depend on the shared libraries below need to have
|
|
|
|
# the rpath setup in non-component build configurations.
|
2016-07-18 20:47:12 +03:00
|
|
|
ldflags = [
|
|
|
|
"-rpath",
|
|
|
|
"@executable_path/",
|
|
|
|
]
|
2020-03-05 21:48:47 +03:00
|
|
|
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/4455)
|
|
|
|
"-Wl,-rpath,@loader_path/.",
|
|
|
|
]
|
|
|
|
}
|
2016-06-21 18:47:03 +03:00
|
|
|
}
|
2019-11-29 21:59:03 +03:00
|
|
|
|
|
|
|
if (angle_is_winuwp) {
|
|
|
|
ldflags = [
|
|
|
|
"/APPCONTAINER",
|
|
|
|
|
|
|
|
# Disable warning about invalid subsystem number.
|
|
|
|
# A default appropriate subsystem is selected automatically.
|
|
|
|
"/IGNORE:4010",
|
|
|
|
]
|
|
|
|
}
|
2016-06-21 18:47:03 +03:00
|
|
|
}
|
|
|
|
|
2018-12-17 21:13:49 +03:00
|
|
|
config("library_name_config") {
|
2020-02-27 03:09:31 +03:00
|
|
|
if (is_component_build && is_android) {
|
|
|
|
defines = [
|
|
|
|
"ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}.cr\"",
|
|
|
|
"ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}.cr\"",
|
|
|
|
]
|
2022-07-21 19:38:47 +03:00
|
|
|
} else if (angle_expose_wgl_entry_points) {
|
|
|
|
defines = [
|
|
|
|
"ANGLE_EGL_LIBRARY_NAME=\"libEGL\"",
|
|
|
|
"ANGLE_GLESV2_LIBRARY_NAME=\"opengl32\"",
|
|
|
|
]
|
2020-02-27 03:09:31 +03:00
|
|
|
} else {
|
|
|
|
defines = [
|
|
|
|
"ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"",
|
|
|
|
"ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"",
|
|
|
|
]
|
|
|
|
}
|
2018-12-17 21:13:49 +03:00
|
|
|
}
|
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
# This config controls export definitions on ANGLE API calls.
|
|
|
|
config("angle_static") {
|
|
|
|
defines = [
|
|
|
|
"ANGLE_EXPORT=",
|
2021-02-17 03:13:44 +03:00
|
|
|
"ANGLE_STATIC=1",
|
2018-12-29 18:29:33 +03:00
|
|
|
"ANGLE_UTIL_EXPORT=",
|
2017-01-03 19:03:23 +03:00
|
|
|
"EGLAPI=",
|
|
|
|
"GL_APICALL=",
|
2018-01-13 01:17:27 +03:00
|
|
|
"GL_API=",
|
2017-01-03 19:03:23 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2019-07-31 00:22:17 +03:00
|
|
|
set_defaults("angle_libGLESv2") {
|
|
|
|
sources = []
|
|
|
|
output_name = "libGLESv2"
|
|
|
|
}
|
|
|
|
|
2019-07-05 18:13:30 +03:00
|
|
|
template("angle_libGLESv2") {
|
|
|
|
angle_shared_library(target_name) {
|
2022-07-21 19:38:47 +03:00
|
|
|
sources = invoker.sources + libglesv2_sources
|
|
|
|
deps = invoker.deps + [ ":includes" ]
|
|
|
|
defines = [ "LIBGLESV2_IMPLEMENTATION" ]
|
2021-10-19 17:07:07 +03:00
|
|
|
|
2019-07-31 00:22:17 +03:00
|
|
|
output_name = "${invoker.output_name}${angle_libs_suffix}"
|
2021-11-09 01:01:34 +03:00
|
|
|
if (angle_glesv2_extension != "") {
|
|
|
|
output_extension = angle_glesv2_extension
|
|
|
|
}
|
2019-07-31 00:22:17 +03:00
|
|
|
|
2019-07-05 18:13:30 +03:00
|
|
|
configs += [
|
|
|
|
":angle_gl_visibility_config",
|
|
|
|
":debug_annotations_config",
|
|
|
|
":gl_prototypes",
|
|
|
|
]
|
2015-01-13 19:13:56 +03:00
|
|
|
|
2022-07-21 19:38:47 +03:00
|
|
|
if (angle_enable_gl_desktop_frontend) {
|
|
|
|
sources += libglesv2_gl_sources
|
|
|
|
defines += [ "ANGLE_ENABLE_GL_DESKTOP_FRONTEND" ]
|
2022-08-22 20:40:40 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources += [
|
|
|
|
"src/libGLESv2/entry_points_wgl.cpp",
|
|
|
|
"src/libGLESv2/entry_points_wgl.h",
|
|
|
|
"src/libGLESv2/proc_table_wgl.h",
|
|
|
|
"src/libGLESv2/proc_table_wgl_autogen.cpp",
|
|
|
|
]
|
|
|
|
defines += [ "ANGLE_EXPOSE_WGL_ENTRY_POINTS" ]
|
|
|
|
} else {
|
|
|
|
sources += [
|
|
|
|
"src/libGLESv2/entry_points_glx.cpp",
|
|
|
|
"src/libGLESv2/entry_points_glx.h",
|
|
|
|
"src/libGLESv2/proc_table_glx.h",
|
|
|
|
"src/libGLESv2/proc_table_glx_autogen.cpp",
|
|
|
|
]
|
|
|
|
}
|
2022-07-21 19:38:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (angle_enable_cl) {
|
|
|
|
sources += libglesv2_cl_sources
|
|
|
|
}
|
2021-10-19 17:07:07 +03:00
|
|
|
|
2021-10-08 20:00:19 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources += [
|
|
|
|
"src/libGLESv2/${invoker.output_name}_autogen.def",
|
|
|
|
"src/libGLESv2/libGLESv2.rc",
|
|
|
|
]
|
|
|
|
deps += [ ":angle_version" ]
|
|
|
|
}
|
2019-07-05 18:13:30 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
angle_libGLESv2("libGLESv2") {
|
2019-07-31 00:22:17 +03:00
|
|
|
if (angle_with_capture_by_default) {
|
2020-02-05 08:31:47 +03:00
|
|
|
deps = [ ":libANGLE_with_capture" ]
|
2019-08-12 19:11:53 +03:00
|
|
|
} else {
|
2020-02-05 08:31:47 +03:00
|
|
|
deps = [ ":libANGLE" ]
|
2019-07-31 00:22:17 +03:00
|
|
|
}
|
2019-07-05 18:13:30 +03:00
|
|
|
}
|
|
|
|
|
2019-08-12 19:11:53 +03:00
|
|
|
# Output capture lib when `angle_with_capture_by_default` disabled, vice versa.
|
2021-09-10 00:26:56 +03:00
|
|
|
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"
|
|
|
|
}
|
2019-07-31 00:22:17 +03:00
|
|
|
}
|
2017-01-03 19:03:23 +03:00
|
|
|
}
|
|
|
|
|
2022-07-21 19:38:47 +03:00
|
|
|
if (angle_enable_gl_desktop_frontend) {
|
|
|
|
angle_libGLESv2("libGL") {
|
2021-10-08 20:00:19 +03:00
|
|
|
if (is_win) {
|
2022-07-21 19:38:47 +03:00
|
|
|
output_name = "opengl32"
|
|
|
|
} else {
|
|
|
|
output_name = "libGL"
|
2021-10-08 20:00:19 +03:00
|
|
|
}
|
2022-07-21 19:38:47 +03:00
|
|
|
|
|
|
|
deps = [ ":libANGLE" ]
|
2019-06-18 20:02:03 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_static_library("libGLESv2_static") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libglesv2_sources
|
2022-07-21 19:38:47 +03:00
|
|
|
if (angle_enable_gl_desktop_frontend) {
|
|
|
|
sources += libglesv2_gl_sources
|
|
|
|
defines = [ "ANGLE_ENABLE_GL_DESKTOP_FRONTEND" ]
|
2022-08-22 20:40:40 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources += [
|
|
|
|
"src/libGLESv2/entry_points_wgl.cpp",
|
|
|
|
"src/libGLESv2/entry_points_wgl.h",
|
|
|
|
"src/libGLESv2/proc_table_wgl.h",
|
|
|
|
"src/libGLESv2/proc_table_wgl_autogen.cpp",
|
|
|
|
]
|
|
|
|
defines += [ "ANGLE_EXPOSE_WGL_ENTRY_POINTS" ]
|
|
|
|
} else {
|
|
|
|
sources += [
|
|
|
|
"src/libGLESv2/entry_points_glx.cpp",
|
|
|
|
"src/libGLESv2/entry_points_glx.h",
|
|
|
|
"src/libGLESv2/proc_table_glx.h",
|
|
|
|
"src/libGLESv2/proc_table_glx_autogen.cpp",
|
|
|
|
]
|
|
|
|
}
|
2022-07-21 19:38:47 +03:00
|
|
|
}
|
2021-04-21 23:43:46 +03:00
|
|
|
if (angle_enable_cl) {
|
|
|
|
sources += libglesv2_cl_sources
|
|
|
|
}
|
2019-01-16 02:33:42 +03:00
|
|
|
configs += [ ":debug_annotations_config" ]
|
2021-01-11 01:29:44 +03:00
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
public_configs += [ ":angle_static" ]
|
2020-02-05 08:31:47 +03:00
|
|
|
deps = [ ":includes" ]
|
|
|
|
public_deps = [ ":libANGLE" ]
|
2015-01-14 22:31:02 +03:00
|
|
|
}
|
|
|
|
|
2019-06-28 18:24:27 +03:00
|
|
|
angle_shared_library("libGLESv1_CM") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libglesv1_cm_sources
|
2019-06-28 18:24:27 +03:00
|
|
|
output_name = "libGLESv1_CM${angle_libs_suffix}"
|
2018-01-13 01:17:27 +03:00
|
|
|
|
|
|
|
configs += [
|
2018-10-09 04:25:19 +03:00
|
|
|
":angle_gl_visibility_config",
|
2018-01-13 01:17:27 +03:00
|
|
|
":debug_annotations_config",
|
2018-12-29 18:29:33 +03:00
|
|
|
":gl_prototypes",
|
2018-01-13 01:17:27 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
defines = []
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":includes",
|
2019-06-28 18:24:27 +03:00
|
|
|
":libGLESv2",
|
2018-01-13 01:17:27 +03:00
|
|
|
]
|
2020-08-26 19:59:19 +03:00
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
sources += [ "src/libGLESv1_CM/libGLESv1_CM.def" ]
|
2021-10-08 20:00:19 +03:00
|
|
|
deps += [ ":angle_version" ]
|
2020-08-26 19:59:19 +03:00
|
|
|
}
|
2018-01-13 01:17:27 +03:00
|
|
|
}
|
|
|
|
|
2018-12-17 21:13:49 +03:00
|
|
|
config("libEGL_egl_loader_config") {
|
|
|
|
defines = [ "ANGLE_USE_EGL_LOADER" ]
|
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_source_set("libEGL_egl_loader") {
|
2018-12-17 21:13:49 +03:00
|
|
|
sources = [
|
|
|
|
"src/libEGL/egl_loader_autogen.cpp",
|
|
|
|
"src/libEGL/egl_loader_autogen.h",
|
|
|
|
]
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
public_configs += [
|
2018-12-17 21:13:49 +03:00
|
|
|
":libEGL_egl_loader_config",
|
|
|
|
":gl_prototypes",
|
|
|
|
]
|
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
deps = [ ":includes" ]
|
2018-12-17 21:13:49 +03:00
|
|
|
}
|
|
|
|
|
2019-06-28 18:24:27 +03:00
|
|
|
angle_shared_library("libEGL") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libegl_sources
|
2021-10-08 20:00:19 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources += [ "src/libEGL/libEGL.rc" ]
|
|
|
|
}
|
|
|
|
|
2019-06-28 18:24:27 +03:00
|
|
|
output_name = "libEGL${angle_libs_suffix}"
|
2021-11-09 01:01:34 +03:00
|
|
|
if (angle_egl_extension != "") {
|
|
|
|
output_extension = angle_egl_extension
|
|
|
|
}
|
2015-01-14 22:31:02 +03:00
|
|
|
|
2017-01-03 19:03:23 +03:00
|
|
|
configs += [
|
|
|
|
":debug_annotations_config",
|
2018-12-17 21:13:49 +03:00
|
|
|
":library_name_config",
|
2017-01-03 19:03:23 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
defines = [ "LIBEGL_IMPLEMENTATION" ]
|
|
|
|
if (is_win) {
|
|
|
|
defines += [ "EGLAPI=" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
deps = [
|
2019-08-06 20:10:52 +03:00
|
|
|
":angle_common",
|
2018-12-17 21:13:49 +03:00
|
|
|
":libEGL_egl_loader",
|
2017-01-03 19:03:23 +03:00
|
|
|
]
|
2018-12-17 22:04:10 +03:00
|
|
|
|
2021-10-08 20:00:19 +03:00
|
|
|
if (is_win) {
|
|
|
|
sources += [ "src/libEGL/libEGL_autogen.def" ]
|
|
|
|
deps += [ ":angle_version" ]
|
|
|
|
}
|
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
public_deps = [ ":includes" ]
|
2018-12-17 21:13:49 +03:00
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
data_deps = [ ":libGLESv2" ]
|
2017-01-03 19:03:23 +03:00
|
|
|
}
|
|
|
|
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_static_library("libEGL_static") {
|
2018-08-30 00:31:27 +03:00
|
|
|
sources = libegl_sources
|
2020-06-22 05:27:06 +03:00
|
|
|
configs += [
|
|
|
|
":debug_annotations_config",
|
|
|
|
":library_name_config",
|
|
|
|
]
|
|
|
|
public_configs += [ ":angle_static" ]
|
|
|
|
deps = [
|
|
|
|
":includes",
|
|
|
|
":libGLESv2_static",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2017-06-29 00:01:15 +03:00
|
|
|
# Convenience targets for some of the samples so they can be built
|
|
|
|
# with Chromium's toolchain.
|
2019-01-16 02:33:42 +03:00
|
|
|
angle_executable("angle_shader_translator") {
|
2017-06-29 00:01:15 +03:00
|
|
|
testonly = true
|
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
sources = [ "samples/shader_translator/shader_translator.cpp" ]
|
2017-06-29 00:01:15 +03:00
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
deps = [ ":translator" ]
|
2021-02-26 08:00:57 +03:00
|
|
|
|
|
|
|
defines = []
|
|
|
|
|
|
|
|
if (angle_enable_vulkan) {
|
|
|
|
deps += [
|
|
|
|
"${angle_spirv_tools_dir}:spvtools_headers",
|
|
|
|
"${angle_spirv_tools_dir}:spvtools_val",
|
|
|
|
]
|
|
|
|
|
|
|
|
defines += [ "ANGLE_ENABLE_VULKAN" ]
|
|
|
|
}
|
2017-06-29 00:01:15 +03:00
|
|
|
}
|
2018-04-13 02:06:48 +03:00
|
|
|
|
2020-12-21 17:57:58 +03:00
|
|
|
if (angle_standalone || build_with_chromium) {
|
2019-10-04 22:17:49 +03:00
|
|
|
config("angle_feature_support_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"include",
|
|
|
|
"src",
|
|
|
|
]
|
|
|
|
defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
|
|
|
|
if (is_debug) {
|
|
|
|
defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
|
|
|
|
}
|
2018-10-09 04:25:19 +03:00
|
|
|
}
|
2019-06-28 18:24:27 +03:00
|
|
|
|
2019-10-04 22:17:49 +03:00
|
|
|
angle_shared_library("libfeature_support") {
|
|
|
|
output_name = "libfeature_support${angle_libs_suffix}"
|
2018-10-09 04:25:19 +03:00
|
|
|
|
2019-10-04 22:17:49 +03:00
|
|
|
if (is_android) {
|
|
|
|
libs = [ "log" ]
|
|
|
|
}
|
2018-11-28 21:44:48 +03:00
|
|
|
|
2021-01-27 06:22:07 +03:00
|
|
|
configs += [
|
2019-10-04 22:17:49 +03:00
|
|
|
":angle_feature_support_config",
|
|
|
|
"${angle_jsoncpp_dir}:jsoncpp_config",
|
2019-02-01 12:53:44 +03:00
|
|
|
]
|
|
|
|
|
2021-01-12 07:11:56 +03:00
|
|
|
if (is_apple && !is_component_build) {
|
2019-10-04 22:17:49 +03:00
|
|
|
ldflags = [
|
|
|
|
"-install_name",
|
|
|
|
"@rpath/${target_name}.dylib",
|
|
|
|
]
|
|
|
|
}
|
2019-01-16 02:33:42 +03:00
|
|
|
|
2019-10-04 22:17:49 +03:00
|
|
|
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",
|
|
|
|
]
|
|
|
|
}
|
2018-11-28 21:44:48 +03:00
|
|
|
}
|
|
|
|
|
2022-03-11 14:58:52 +03:00
|
|
|
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),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-02 00:40:26 +03:00
|
|
|
if (is_android && symbol_level != 0) {
|
2019-01-03 23:24:22 +03:00
|
|
|
action_foreach("compressed_symbols") {
|
2019-01-03 22:40:13 +03:00
|
|
|
sources = []
|
|
|
|
foreach(_library, angle_libraries) {
|
2021-04-02 00:40:26 +03:00
|
|
|
if (is_component_build) {
|
|
|
|
sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.cr.so" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.so" ]
|
|
|
|
}
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
if (angle_enable_vulkan_validation_layers) {
|
|
|
|
foreach(_layer, vulkan_validation_layers) {
|
2021-04-02 00:40:26 +03:00
|
|
|
if (is_component_build) {
|
|
|
|
sources += [ "$root_out_dir/lib${_layer}.cr.so" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "$root_out_dir/lib${_layer}.so" ]
|
|
|
|
}
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
}
|
2019-01-03 23:24:22 +03:00
|
|
|
|
|
|
|
script = rebase_path("${root_build_dir}/android/compress_symbols.py",
|
|
|
|
root_build_dir)
|
|
|
|
|
2019-01-03 22:40:13 +03:00
|
|
|
deps = []
|
|
|
|
foreach(_library, angle_libraries) {
|
2019-06-28 18:24:27 +03:00
|
|
|
deps += [ ":$_library" ]
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (angle_enable_vulkan_validation_layers) {
|
|
|
|
foreach(_layer, vulkan_validation_layers) {
|
2020-12-16 03:25:50 +03:00
|
|
|
deps += [ "$angle_vulkan_validation_layers_dir:${_layer}" ]
|
2019-01-03 22:40:13 +03:00
|
|
|
}
|
|
|
|
}
|
2019-01-03 23:24:22 +03:00
|
|
|
|
2020-02-05 08:31:47 +03:00
|
|
|
outputs = [ "$root_out_dir/lib.compressed/{{source_file_part}}" ]
|
2019-01-03 23:24:22 +03:00
|
|
|
|
|
|
|
android_nm = "${android_tool_prefix}nm"
|
2019-05-14 19:42:25 +03:00
|
|
|
android_strip = "${android_tool_prefix}strip"
|
2019-01-03 23:24:22 +03:00
|
|
|
|
|
|
|
args = [
|
|
|
|
"--objcopy",
|
|
|
|
rebase_path(android_objcopy, root_build_dir),
|
|
|
|
"--nm",
|
|
|
|
rebase_path(android_nm, root_build_dir),
|
2019-05-14 19:42:25 +03:00
|
|
|
"--strip",
|
|
|
|
rebase_path(android_strip, root_build_dir),
|
2019-01-03 23:24:22 +03:00
|
|
|
"--unstrippedsofile",
|
|
|
|
"{{source_dir}}/lib.unstripped/{{source_file_part}}",
|
|
|
|
"--output",
|
|
|
|
"{{source_dir}}/lib.compressed/{{source_file_part}}",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-30 22:56:11 +03:00
|
|
|
if ((angle_standalone || build_with_chromium) && is_android &&
|
|
|
|
current_toolchain == default_toolchain) {
|
2021-02-09 21:48:32 +03:00
|
|
|
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
|
2019-04-23 22:25:20 +03:00
|
|
|
angle_apk("angle_chromium_apk") {
|
2020-08-31 19:23:27 +03:00
|
|
|
package_name = "org.chromium.angle"
|
Reland "Create Container ANGLE APK"
This reverts commit 902ceed3998617e97aad25d6b632f9e34dff2644.
Reason for revert:
Re-landing this since the Chromium build fix has landed:
https://bugs.chromium.org/p/chromium/issues/detail?id=933783#c29
Comment 29 by gbeaty@chromium.org, Today (13 minutes ago)
Tim, you should be able to re-land your change now.
Original change's description:
> Revert "Create Container ANGLE APK"
>
> This reverts commit e82c857d38549da44de2c055e9e677a368e8793f.
>
> Reason for revert:
> This is breaking the ANGLE build in the Chromium build process:
>
> https://bugs.chromium.org/p/chromium/issues/detail?id=933783#c6
>
> Original change's description:
> > Create Container ANGLE APK
> >
> > The ANGLE APK needs to be reverted back to just being a container
> > for the ANGLE shared object libraries, since the rest of the APK
> > contents are in the Android source tree.
> >
> > Bug: angleproject:3154
> > Test: 'adb sync' the APK on to a device
> > Change-Id: Id245f1e3d269c71054d9759e8ba8be0532afe659
> > Reviewed-on: https://chromium-review.googlesource.com/c/1474341
> > Commit-Queue: Tim Van Patten <timvp@google.com>
> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
>
> TBR=ynovikov@chromium.org,jmadill@google.com,cnorthrop@google.com,courtneygo@google.com,timvp@google.com
>
> Change-Id: I71a739faa2052a707a06bce616ab43a621d5a4ff
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: angleproject:3154
> Reviewed-on: https://chromium-review.googlesource.com/c/1478333
> Reviewed-by: Tim Van Patten <timvp@google.com>
> Commit-Queue: Tim Van Patten <timvp@google.com>
TBR=ynovikov@chromium.org,jmadill@google.com,cnorthrop@google.com,courtneygo@google.com,timvp@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: angleproject:3154
Change-Id: If3a9abfb1c00aab3278437a233bef29d5febe5a5
Reviewed-on: https://chromium-review.googlesource.com/c/1480865
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
2019-02-21 22:21:09 +03:00
|
|
|
apk_name = "AngleLibraries"
|
2020-09-23 06:37:54 +03:00
|
|
|
version_name = "ANGLE Developer Build"
|
2021-02-09 21:48:32 +03:00
|
|
|
version_code = apk_version_code
|
|
|
|
}
|
2020-09-23 06:37:54 +03:00
|
|
|
|
2021-02-09 21:48:32 +03:00
|
|
|
# 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
|
2018-11-29 19:00:08 +03:00
|
|
|
}
|
|
|
|
|
2018-12-01 02:24:11 +03:00
|
|
|
group("angle_apks") {
|
2021-02-09 21:48:32 +03:00
|
|
|
deps = [
|
|
|
|
":angle_agi_chromium_apk",
|
|
|
|
":angle_chromium_apk",
|
|
|
|
]
|
2018-04-13 02:06:48 +03:00
|
|
|
}
|
|
|
|
}
|
2019-10-04 22:17:49 +03:00
|
|
|
|
|
|
|
group("angle") {
|
|
|
|
data_deps = [
|
2020-02-05 08:31:47 +03:00
|
|
|
":libEGL",
|
2019-12-03 22:08:36 +03:00
|
|
|
":libGLESv1_CM",
|
2019-10-04 22:17:49 +03:00
|
|
|
":libGLESv2",
|
|
|
|
]
|
|
|
|
}
|