[go: up one dir, main page]

blob: 595e09a71c74dd27aa46dd1e6f01ab6f6e9fef6a [file] [log] [blame]
Jamie Madill0cb3b0f2019-01-28 14:55:201# Copyright 2019 The ANGLE Project Authors. All rights reserved.
Jamie Madill72f5b5e2014-06-23 19:13:022# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Maksim Sisovfa2e3742021-09-09 12:34:235# import the ozone_platform_x11 variable
Frank Henigmand0ef13a2017-08-29 02:53:246import("gni/angle.gni")
Antonio Caggiano7b0f6312022-03-30 12:16:027if (angle_enable_vulkan) {
8 import("//build_overrides//vulkan_headers.gni")
9}
Brian Osmana62204c2022-06-15 18:01:1710if (angle_use_wayland) {
11 import("//build_overrides/wayland.gni")
12}
Liza Burakovae8a34932024-02-14 21:51:0013if (angle_enable_wgpu) {
14 import("//build_overrides/dawn.gni")
15 import("//build_overrides/tint.gni")
16}
Jamie Madill1ba72542019-10-04 19:17:4917if (angle_has_build) {
18 import("//build/config/linux/pkg_config.gni")
Jamie Madill89e3de92021-11-11 15:18:3619 import("//build/config/sanitizers/sanitizers.gni")
Jamie Madill1ba72542019-10-04 19:17:4920 import("//build/config/ui.gni")
21 import("//testing/libfuzzer/fuzzer_test.gni")
22
23 if (is_android) {
24 # android/rules.gni can only be imported for Android targets
25 import("//build/config/android/config.gni")
26 import("//build/config/android/rules.gni")
27 import("android/angle_apk.gni")
28 }
Jamie Madill6a70398c2021-11-19 14:41:5829} else {
30 using_sanitizer = false
Courtney Goeltzenleuchter2565d482018-04-12 23:06:4831}
Corentin Wallez51e2ad12015-05-26 15:32:5832
Corentin Wallez16d4e472017-03-20 17:06:1933declare_args() {
34 # Use the PCI lib to collect GPU information on Linux.
mark a. foltz5040c4d2022-03-28 21:27:1635 use_libpci = (is_linux || is_chromeos) && (angle_use_x11 || use_ozone) &&
36 angle_has_build
Frank Henigmane42ec182017-12-12 04:58:5337
Geoff Lang48da7e72021-09-07 19:49:0738 # Enable using Vulkan to collect system info as a fallback.
39 angle_enable_vulkan_system_info = false
40
Frank Henigmane42ec182017-12-12 04:58:5341 # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md.
42 angle_link_glx = false
Jamie Madilleb1b1642019-07-30 21:22:1743
Austin Kinross11dc1632019-09-18 21:46:2344 # Don't build extra (test, samples etc) for Windows UWP. We don't have
45 # infrastructure (e.g. windowing helper functions) in place to run them.
Yuly Novikovaa973692023-02-23 18:40:1646 # Also don't build them with MSVC, because tests and unused dependencies
47 # often have problems building with it, e.g. for C++20.
Jamie Madill7df1f582022-05-24 13:58:3648 angle_build_all = !build_with_chromium && !angle_is_winuwp &&
Yuly Novikovaa973692023-02-23 18:40:1649 !angle_is_msvc && angle_has_build && angle_build_tests
Geoff Lange8883562020-03-06 14:32:1850
51 # Enable generating current commit information using git
52 angle_enable_commit_id = true
Tim Van Pattene78d9a62020-07-24 17:58:4553
54 # Abseil has trouble supporting MSVC, particularly regarding component builds.
55 # http://crbug.com/1126524
56 angle_enable_abseil = angle_has_build && is_clang
Jamie Madill06a9d522020-11-05 00:57:2757
58 # Adds run-time checks to filter out EVENT() messages when the debug annotator is disabled.
59 angle_enable_annotator_run_time_checks = false
Tim Van Pattenbbed8812021-03-06 00:40:2760
61 # Enables non-conformant extensions and features
62 angle_expose_non_conformant_extensions_and_versions = false
Jamie Madill54dfb622021-04-07 16:33:3163
64 # Optional feature that forces dirty state whenever we use a new context regardless of thread.
65 angle_force_context_check_every_call = false
Craig Stout24136212021-11-08 22:01:3466
67 # Allow shared library custom name extensions for setting soname such as libEGL.so.1
68 angle_egl_extension = ""
69 angle_glesv2_extension = ""
Peng Huangb78d4712022-07-21 13:53:3770
71 # Enable share context lock. If it is false, the client need to use gl calls in a threadsafe way.
Peng Huangc6cd91e2023-05-26 17:23:3372 angle_enable_share_context_lock =
Geoff Langc6d827e2024-01-25 18:00:4673 !build_with_chromium || build_angle_deqp_tests
Peng Huangb9fd47b2022-08-12 14:55:4974
75 if (is_android) {
76 # Use Android TLS slot to store current context.
77 angle_use_android_tls_slot = !build_with_chromium
78 }
Igor Nazarovb22124b2023-01-17 15:44:0679
Shahbaz Youssefi3de92372023-11-27 13:55:2680 angle_enable_global_mutex_recursion =
81 is_android && angle_enable_vulkan && !build_with_chromium
Igor Nazarov8b97c8d2023-03-31 12:54:4082
83 # Potentially can be enabled for other platforms, but limiting to Android platform for now.
84 # Chromium may have problems (requires verification), disabled for safety.
85 angle_enable_global_mutex_load_time_allocate =
86 is_android && !build_with_chromium
Igor Nazarov36c3e0f2023-01-17 15:42:5987
Igor Nazarov4b724132023-06-27 15:08:2788 angle_enable_context_mutex = true
Antonio Caggianoe3cba402024-04-30 15:47:3689
90 # Prefix where the artifacts should be installed on the system
91 install_prefix = ""
Corentin Wallez16d4e472017-03-20 17:06:1992}
93
Igor Nazarovd61a50c2023-07-31 12:09:0894declare_args() {
95 # May need to enable to fix recursion when vkAcquireNextImageKHR() returns back to ANGLE from
96 # eglClientWaitSyncKHR(). May happen if Android Presentation Engine uses
97 # EGL_KHR_fence_sync instead of EGL_ANDROID_native_fence_sync for synchronization.
98 # To check call: adb shell "dumpsys SurfaceFlinger | grep 'Sync configuration'"
99 # The Android's "testDrawingHardwareBitmapNotLeaking" test may be used for testing.
100 # Disable this option to save performance on platforms that does not require recursion.
101 angle_enable_context_mutex_recursion = angle_enable_global_mutex_recursion
102}
103
Jamie Madille3c25712019-12-03 19:08:36104if (angle_build_all) {
Frank Henigmand0ef13a2017-08-29 02:53:24105 group("all") {
106 testonly = true
107 deps = [
Jamie Madille3c25712019-12-03 19:08:36108 ":angle",
Frank Henigmand0ef13a2017-08-29 02:53:24109 ":angle_shader_translator",
110 ":translator_fuzzer",
Jamie Madill238c19e2019-02-07 14:09:41111 ":xxhash_fuzzer",
Jamie Madille3c25712019-12-03 19:08:36112 "$angle_root/samples:angle_samples",
113 "$angle_root/src/tests:angle_tests",
Frank Henigmand0ef13a2017-08-29 02:53:24114 ]
John Platee25f3b12021-04-21 20:43:46115 if (angle_enable_cl) {
Austin Annestrand21c0d312024-01-25 21:33:48116 deps += [ "$angle_root/src/libOpenCL:angle_cl" ]
117 }
118 if (angle_enable_cl && angle_enable_vulkan) {
119 # OpenCL through Vulkan in ANGLE requires clspv for online compiler
120 deps += [ "$angle_clspv_dir:clspv" ]
John Platee25f3b12021-04-21 20:43:46121 }
Jamie Madill41184c22022-09-29 14:50:39122 if (angle_build_mesa) {
123 deps += [ "$angle_root/third_party/mesa" ]
124 }
Frank Henigmand0ef13a2017-08-29 02:53:24125 }
126}
127
Tim Van Patten3c2bff42025-05-22 18:33:12128if (build_angle_end2end_tests_library) {
129 group("angle_end2end_tests_library") {
Roman Lavrov49a8d052024-09-05 21:41:07130 testonly = true
131 deps = [ "src/tests:angle_end2end_tests" ]
132 }
133}
134
Yuxin Hu82826be2023-01-06 19:20:14135import("src/angle_program_serialize_data_version.gni")
Tim Van Pattenc4e0a1e2018-11-28 16:08:11136import("src/compiler.gni")
Tim Van Pattenfdccaa32018-11-01 23:47:10137import("src/libGLESv2.gni")
Brett Wilson04bac602014-07-16 21:19:18138
Brett Wilson2f5469c2014-07-23 00:00:17139# This config is exported to dependent targets (and also applied to internal
140# ones).
141config("external_config") {
Jamie Madilledbc2442016-01-04 16:25:00142 include_dirs = [ "include" ]
Brett Wilson2f5469c2014-07-23 00:00:17143}
144
Jamie Madill4638dc92018-12-17 18:13:49145# Prevent the GL headers from redeclaring ANGLE entry points.
146config("no_gl_prototypes") {
147 defines = [
148 "GL_GLES_PROTOTYPES=0",
149 "EGL_EGL_PROTOTYPES=0",
150 ]
151}
152
153config("gl_prototypes") {
154 defines = [
155 "GL_GLES_PROTOTYPES=1",
156 "EGL_EGL_PROTOTYPES=1",
157 "GL_GLEXT_PROTOTYPES",
158 "EGL_EGLEXT_PROTOTYPES",
159 ]
160}
161
Jamie Madill72f5b5e2014-06-23 19:13:02162# This config is applied to internal Angle targets (not pushed to dependents).
163config("internal_config") {
164 include_dirs = [
165 "include",
166 "src",
167 ]
Jamie Madill80ab03c2017-01-03 16:03:23168
Amirali Abdolrashidi4b356c32023-08-17 17:49:19169 defines = []
Jamie Madill6de51852017-04-12 13:53:01170
Manh Nguyendce37b72020-06-22 02:27:06171 if (is_win) {
172 defines += [ "ANGLE_IS_WIN" ]
Jonah Ryan-Davise2fc8182021-05-05 15:51:00173 if (angle_is_winuwp) {
174 defines += [ "ANGLE_IS_WINUWP" ]
175 }
Matthew Leibowitza70b6f52024-01-26 18:37:07176 if (angle_is_winappsdk) {
177 defines += [ "ANGLE_IS_WINAPPSDK" ]
178 }
Hidehiko Abe90a9cf92020-09-10 17:40:34179 } else if (is_linux || is_chromeos) {
Manh Nguyendce37b72020-06-22 02:27:06180 defines += [ "ANGLE_IS_LINUX" ]
181 }
182
Peng Huangb78d4712022-07-21 13:53:37183 if (angle_enable_share_context_lock) {
184 defines += [ "ANGLE_ENABLE_SHARE_CONTEXT_LOCK=1" ]
185 }
186
Peng Huangb9fd47b2022-08-12 14:55:49187 if (is_android) {
188 if (angle_use_android_tls_slot) {
189 defines += [ "ANGLE_USE_ANDROID_TLS_SLOT=1" ]
190 }
191 }
192
Igor Nazarovb22124b2023-01-17 15:44:06193 if (angle_enable_global_mutex_recursion) {
194 defines += [ "ANGLE_ENABLE_GLOBAL_MUTEX_RECURSION=1" ]
195 }
196
Igor Nazarov8b97c8d2023-03-31 12:54:40197 if (angle_enable_global_mutex_load_time_allocate) {
198 defines += [ "ANGLE_ENABLE_GLOBAL_MUTEX_LOAD_TIME_ALLOCATE=1" ]
199 }
200
Igor Nazarov4b724132023-06-27 15:08:27201 if (angle_enable_context_mutex && angle_enable_share_context_lock &&
Igor Nazarov36c3e0f2023-01-17 15:42:59202 !angle_force_context_check_every_call) {
Igor Nazarov4b724132023-06-27 15:08:27203 defines += [ "ANGLE_ENABLE_CONTEXT_MUTEX=1" ]
Igor Nazarov36c3e0f2023-01-17 15:42:59204 }
205
Igor Nazarovd61a50c2023-07-31 12:09:08206 if (angle_enable_context_mutex_recursion) {
207 defines += [ "ANGLE_ENABLE_CONTEXT_MUTEX_RECURSION=1" ]
208 }
209
Ian Elliotte2ecb2d2020-11-04 02:26:00210 # Enables debug/trace-related functionality, including logging every GLES/EGL API command to the
211 # "angle_debug.txt" file on desktop. Enables debug markers for AGI, but must also set
212 # angle_enable_annotator_run_time_checks to improve performance.
Tobin Ehlis573f76b2018-05-03 17:10:44213 if (angle_enable_trace) {
214 defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ]
215 }
Tobin Ehlis93121f32019-10-17 14:18:16216
Ian Elliotte2ecb2d2020-11-04 02:26:00217 # When used with angle_enable_trace, enables logging every GLES/EGL API command to Android logcat
218 # Enables debug markers for AGI regardless of run-time checks.
219 if (angle_enable_trace_android_logcat) {
220 defines += [ "ANGLE_ENABLE_TRACE_ANDROID_LOGCAT=1" ]
221 }
222
Cody Northrope3c44912022-03-24 17:32:10223 # When used with angle_enable_trace, enables logging every GLES/EGL API command to the terminal
224 if (angle_enable_trace_events) {
225 defines += [ "ANGLE_ENABLE_TRACE_EVENTS=1" ]
226 }
227
Roman Lavrov23c1e112025-04-01 15:27:02228 # Enables platform trace events (PlatformMethods::addTraceEvent) e.g. AGI/perfetto on Android
229 if (angle_enable_platform_trace_events) {
230 defines += [ "ANGLE_ENABLE_PLATFORM_TRACE_EVENTS=1" ]
231 }
232
Bruno BELANYId3d96a32024-05-24 14:43:12233 # Output `INFO`-level logs and up.
234 if (angle_always_log_info) {
235 defines += [ "ANGLE_ALWAYS_LOG_INFO" ]
236 }
237
Mohan Maiyaac71a592024-01-23 17:56:42238 # Enables pipeline cache graph dump functionality.
239 # The dump path must have appropriate permissions for this to work.
240 if (angle_dump_pipeline_cache_graph) {
241 defines += [ "ANGLE_DUMP_PIPELINE_CACHE_GRAPH=1" ]
242 }
243
Amirali Abdolrashidif62405c2022-11-01 01:47:52244 # Checks that unwind backtrace support for Android is enabled only for debug mode.
245 assert(is_debug || !angle_enable_unwind_backtrace_support)
246
Tobin Ehlis93121f32019-10-17 14:18:16247 if (is_chromeos) {
248 defines += [ "ANGLE_PLATFORM_CHROMEOS" ]
249 }
Ethan Leefcef6dc2020-01-25 03:41:35250
Sergey Ulanovb73eee72021-07-08 01:51:35251 if (angle_use_vulkan_null_display) {
252 defines += [ "ANGLE_USE_VULKAN_NULL_DISPLAY" ]
253 } else if (angle_use_vulkan_display) {
Alexis Hetu729cbcf2021-07-23 15:18:18254 defines += [ "ANGLE_USE_VULKAN_DISPLAY" ]
255 if (!angle_use_x11) {
256 defines += [ "EGL_NO_X11" ]
257 }
Antonio Caggiano9ad43bd2021-12-09 15:52:35258
259 # These two are needed here to correctly select OSWindow::New
260 if (angle_use_x11) {
261 defines += [ "ANGLE_USE_X11" ]
262 }
263 if (angle_use_wayland) {
264 defines += [ "ANGLE_USE_WAYLAND" ]
265 }
266
Xiaoxuan Liu61180d02020-10-12 08:40:13267 if (angle_vulkan_display_mode == "simple") {
268 defines += [ "ANGLE_VULKAN_DISPLAY_MODE_SIMPLE" ]
269 } else if (angle_vulkan_display_mode == "headless") {
270 defines += [ "ANGLE_VULKAN_DISPLAY_MODE_HEADLESS" ]
Brian Hod2a6b2a2023-08-04 18:15:11271 } else if (angle_vulkan_display_mode == "offscreen") {
272 defines += [ "ANGLE_VULKAN_DISPLAY_MODE_OFFSCREEN" ]
273 } else {
274 assert(false)
Xiaoxuan Liu61180d02020-10-12 08:40:13275 }
276 }
Alexis Hetuf2a15482020-12-04 19:07:24277
278 if (is_lsan) {
279 defines += [ "ANGLE_WITH_LSAN" ]
280 }
Lubosz Sarnecki45e5cf02022-06-03 12:29:23281
282 if (angle_has_astc_encoder) {
283 defines += [ "ANGLE_HAS_ASTCENC" ]
284 }
Constantine Shablyab9df95f2022-09-06 15:19:32285
286 if (angle_test_enable_system_egl) {
287 defines += [ "ANGLE_TEST_ENABLE_SYSTEM_EGL" ]
288 }
Jamie Madille495e7f2022-10-14 17:52:47289
290 if (angle_debug_layers_enabled) {
291 defines += [ "ANGLE_DEBUG_LAYERS_ENABLED" ]
292 }
Jamie Madilla9868112022-09-15 21:29:04293
294 if (angle_build_mesa) {
295 defines += [ "ANGLE_HAS_MESA" ]
296 }
Kenneth Russell8875ba42023-02-25 06:40:22297
298 if (angle_standalone || build_with_chromium) {
299 defines += [ "ANGLE_OUTSIDE_WEBKIT" ]
300 }
Shahbaz Youssefid9d583b2024-04-15 04:24:47301
302 if (is_win && build_with_chromium) {
303 defines += [ "ANGLE_WINDOWS_NO_FUTEX=1" ]
304 }
hoonee.cho2ee914a2024-03-04 06:54:29305
306 if (angle_enable_cl) {
307 defines += [ "ANGLE_ENABLE_CL" ]
308 }
Roman Lavrov19e45682025-03-18 16:50:52309
310 if (angle_trace_events_ignore_timestamp) {
311 defines += [ "ANGLE_TRACE_EVENTS_IGNORE_TIMESTAMP" ]
312 }
Jamie Madill72f5b5e2014-06-23 19:13:02313}
314
Jamie Madilla9f11bf2019-10-21 12:39:14315config("constructor_and_destructor_warnings") {
angle-autoroll6c26ea12025-03-17 09:48:51316 if (is_clang && !angle_enable_global_mutex_load_time_allocate) {
Jamie Madilla9f11bf2019-10-21 12:39:14317 cflags = [
318 "-Wexit-time-destructors",
319 "-Wglobal-constructors",
320 ]
321 }
322}
323
Devon Loehrae199692025-07-14 18:23:40324config("no_thread_safety_warnings") {
325 if (is_clang) {
326 cflags_cc = [ "-Wno-thread-safety" ]
327 cflags_objcc = [ "-Wno-thread-safety" ]
328 }
329}
330
Jamie Madill509a1d42016-07-18 14:10:29331config("extra_warnings") {
Ben Wagner211bff32017-10-11 03:53:20332 cflags = []
Frank Henigmand0ef13a2017-08-29 02:53:24333
Gert Wollny79f24112021-02-12 08:36:18334 is_gcc = !is_clang && !is_win
335
Brian Salomone7496f52021-01-26 21:13:04336 # Avoid failing builds for warnings enabled by Skia build.
337 if (defined(is_skia_standalone)) {
338 cflags += [ "-w" ]
339 }
340
Jamie Madill509a1d42016-07-18 14:10:29341 # Enable more default warnings on Windows.
342 if (is_win) {
Ben Wagner211bff32017-10-11 03:53:20343 cflags += [
Jamie Madill509a1d42016-07-18 14:10:29344 "/we4244", # Conversion: possible loss of data.
Jamie Madill330c8672020-08-28 21:44:13345 "/we4312", # Conversion: greater size.
Jamie Madill509a1d42016-07-18 14:10:29346 "/we4456", # Variable shadowing.
Jamie Madill1db8a262016-09-22 17:53:47347 "/we4458", # declaration hides class member.
Ben Wagner1e064012019-04-12 18:10:17348 "/we4715", # not all control paths return a value
Geoff Langb9440532017-11-28 18:26:34349 "/we4800", # forcing value to bool.
350 "/we4838", # narrowing conversion.
Jamie Madill509a1d42016-07-18 14:10:29351 ]
352 }
Ben Wagner211bff32017-10-11 03:53:20353 if (is_clang) {
Michael Spang229fc832019-01-21 23:09:15354 cflags += [
Jamie Madillc7217aa2020-08-28 18:45:14355 "-Wbad-function-cast",
Jamie Madill155947f2019-10-24 16:55:11356 "-Wconditional-uninitialized",
Jamie Madill44a0e732019-09-02 17:55:59357 "-Wextra-semi-stmt",
Jiacheng Lu73e5e9b2019-07-22 21:26:17358 "-Wfloat-conversion",
Jamie Madill16370a62019-10-24 16:55:11359 "-Winconsistent-missing-destructor-override",
Jamie Madilla6206852019-10-24 16:55:09360 "-Wmissing-field-initializers",
Stuart Morgan5dba7232020-06-16 16:29:16361 "-Wnewline-eof",
Olli Etuaho8073a952018-05-09 13:41:39362 "-Wnon-virtual-dtor",
Jamie Madill68945f12019-10-24 16:55:09363 "-Wredundant-parens",
Adrian McCarthy462fb1e2021-02-17 21:46:43364 "-Wreturn-std-move",
Jamie Madillcb87d782021-07-08 12:28:04365 "-Wshadow",
Jamie Madill859ca032019-10-24 16:55:08366 "-Wshadow-field",
Jamie Madillfd58d222019-10-24 16:55:07367 "-Wtautological-type-limit-compare",
Jamie Madillc017cee2019-10-24 16:55:10368 "-Wundefined-reinterpret-cast",
Jamie Madillc09ae152019-02-01 19:16:32369 "-Wunneeded-internal-declaration",
Peter Kastingd4d6c232021-07-31 18:41:29370 "-Wunused-but-set-variable",
Sylvain Defresne30afc252021-11-03 16:59:19371 "-Wsuggest-destructor-override",
372 "-Wsuggest-override",
James Darpinianefa898a2019-08-08 00:05:35373
374 # The below warnings are used by WebKit. We enable them to make rolling
375 # ANGLE in WebKit easier.
376 "-Wparentheses",
377 "-Wrange-loop-analysis",
378 "-Wstrict-prototypes",
Peter Kastingd4d6c232021-07-31 18:41:29379 "-Wunreachable-code-aggressive",
James Darpinian7e48c9e2019-08-07 00:17:19380 "-Wshorten-64-to-32",
Nico Weber79de62c2018-01-31 15:47:14381 ]
Ben Wagner211bff32017-10-11 03:53:20382 }
Austin Kinross11dc1632019-09-18 21:46:23383
Gert Wollny79f24112021-02-12 08:36:18384 if (is_gcc) {
385 cflags_cc = [ "-Wdeprecated-copy" ]
386 }
387
Austin Kinross11dc1632019-09-18 21:46:23388 if (angle_is_winuwp) {
angle-autoroll66c89b02021-10-06 16:28:42389 cflags += [
390 "/wd4091", # keyword ignored on left of type when no variable is declared
391 "/wd4447", # 'main' signature found without threading model.
392 ]
Austin Kinross11dc1632019-09-18 21:46:23393 }
Jamie Madill509a1d42016-07-18 14:10:29394}
395
Courtney Goeltzenleuchter46071482018-05-15 19:35:15396# This config adds build-ids to the associated library.
397# -Wl is a special option that indicates that clang should pass the associated
398# option --build-id to the linker. This will cause a build-id section to be added
399# to the associated library. The build-id makes it possible for a debugger to
400# find the right symbol file to use.
401config("build_id_config") {
402 ldflags = [ "-Wl,--build-id" ]
403}
404
Bruce Dawsona3af3642023-02-23 00:18:24405_use_copy_compiler_dll = angle_has_build && is_win
Jamie Madill1ba72542019-10-04 19:17:49406
Jamie Madill1ba72542019-10-04 19:17:49407if (_use_copy_compiler_dll) {
Daniel Bratell73941de2015-02-25 13:34:49408 copy("copy_compiler_dll") {
Julien Isorce5641d192020-02-05 05:31:47409 sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ]
Julien Isorce5641d192020-02-05 05:31:47410 outputs = [ "$root_out_dir/{{source_file_part}}" ]
Daniel Bratell73941de2015-02-25 13:34:49411 }
Daniel Bratell73941de2015-02-25 13:34:49412}
413
Jamie Madill55959b02019-03-05 15:07:41414# Holds the shared includes so we only need to list them once.
Jamie Madillcd4f1fb2019-02-07 20:26:10415config("includes_config") {
416 include_dirs = [ "include" ]
417}
418
James Clarke06d194e2021-01-10 22:29:44419config("angle_uwp_env") {
Matthew Leibowitza70b6f52024-01-26 18:37:07420 if (angle_is_winuwp && !angle_is_winappsdk) {
James Clarke06d194e2021-01-10 22:29:44421 defines = [ "WINAPI_FAMILY=WINAPI_FAMILY_PC_APP" ]
422 }
423}
424
John Platee25f3b12021-04-21 20:43:46425angle_source_set("cl_includes") {
426 sources = cl_includes
John Platedfe208f2021-04-28 17:26:00427 public_configs = [ ":external_config" ]
John Platee25f3b12021-04-21 20:43:46428}
429
Jamie Madill7098cff2019-01-15 23:33:42430angle_source_set("includes") {
Frank Henigman44b2c0b2018-08-29 21:31:27431 sources = libangle_includes
Jamie Madill8d412db2020-08-29 22:25:18432 public_configs = [ ":includes_config" ]
John Platee25f3b12021-04-21 20:43:46433 if (angle_enable_cl) {
434 public_deps = [ ":cl_includes" ]
435 }
Jamie Madill72f5b5e2014-06-23 19:13:02436}
437
Peter Kasting1bffabe2021-06-30 01:13:39438config("disable_unreachable_code_break_warning") {
439 if (is_clang) {
440 cflags = [ "-Wno-unreachable-code-break" ]
441 }
442}
443
Jamie Madill7098cff2019-01-15 23:33:42444angle_static_library("preprocessor") {
Frank Henigman44b2c0b2018-08-29 21:31:27445 sources = angle_preprocessor_sources
Jamie Madill72f5b5e2014-06-23 19:13:02446
Peter Kasting1bffabe2021-06-30 01:13:39447 # preprocessor_tab_autogen.cpp contains an instance of this.
448 configs += [ ":disable_unreachable_code_break_warning" ]
449
Corentin Wallez054f7ed2016-09-20 21:15:59450 public_deps = [
451 ":angle_common",
Jamie Madill1f08ab22019-10-03 20:22:52452 ":angle_translator_headers",
Corentin Wallez054f7ed2016-09-20 21:15:59453 ]
Jamie Madill72f5b5e2014-06-23 19:13:02454}
455
Tobin Ehlis5546fb42019-01-17 17:25:54456config("angle_disable_pool_alloc") {
457 defines = [ "ANGLE_DISABLE_POOL_ALLOC" ]
Jamie Madille5c97ab2014-08-07 16:31:38458}
459
Cooper Partin75da1972015-06-16 22:03:14460config("debug_annotations_config") {
Jamie Madill786d38a2021-09-10 14:58:39461 defines = []
Corentin Wallez105bc9d2019-03-06 16:32:40462 if (is_debug) {
Jamie Madill786d38a2021-09-10 14:58:39463 defines += [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
Cooper Partin75da1972015-06-16 22:03:14464 }
Jamie Madill06a9d522020-11-05 00:57:27465 if (angle_enable_annotator_run_time_checks) {
Ian Elliotte2ecb2d2020-11-04 02:26:00466 # When used with angle_enable_trace, enables debug markers for AGI with run-time checks to
467 # filter out EVENT() messages when the debug annotator is disabled.
Jamie Madill786d38a2021-09-10 14:58:39468 defines += [ "ANGLE_ENABLE_ANNOTATOR_RUN_TIME_CHECKS" ]
Jamie Madill06a9d522020-11-05 00:57:27469 }
Cooper Partin75da1972015-06-16 22:03:14470}
471
Jamie Madill2b86e2d2021-07-19 14:30:57472config("angle_asserts_config") {
473 if (angle_assert_always_on) {
474 defines = [ "ANGLE_ASSERT_ALWAYS_ON" ]
Jamie Madille31fd872016-05-27 12:35:36475 }
476}
477
Jamie Madille2e406c2016-06-02 17:04:10478config("angle_common_config") {
Nicolas Capens022b52f2022-11-30 19:58:01479 include_dirs = [
Nicolas Capensc991eb22022-12-01 19:05:07480 "src/common/base",
Nicolas Capens022b52f2022-11-30 19:58:01481 "src/common/third_party/xxhash",
482 ]
Shahbaz Youssefic3a1cae2024-04-15 18:58:55483 libs = []
Yuly Novikove7624002018-01-27 23:27:07484 if (is_android) {
Shahbaz Youssefic3a1cae2024-04-15 18:58:55485 libs += [ "log" ]
486 }
487
488 if (is_win && !angle_is_winuwp && !build_with_chromium) {
489 # Needed for futex support
490 libs += [ "synchronization.lib" ]
Yuly Novikove7624002018-01-27 23:27:07491 }
Shahbaz Youssefifbd7d5f2022-10-17 21:20:09492
493 defines = []
494 if (angle_delegate_workers) {
Dave Tapuskafe08eee2023-07-12 22:03:30495 defines += [ "ANGLE_DELEGATE_WORKERS=1" ]
Shahbaz Youssefifbd7d5f2022-10-17 21:20:09496 }
Jamie Madille2e406c2016-06-02 17:04:10497}
498
Alexis Hetua20f5b12020-08-18 15:26:50499# Silences the "indirect call of a function with wrong dynamic type" cfi error
500config("angle_no_cfi_icall") {
501 if (is_cfi && use_cfi_icall && current_toolchain == default_toolchain) {
502 cflags = [ "-fno-sanitize=cfi-icall" ]
503 }
504}
505
506# Silences the "cast from void* or another unrelated type to the wrong dynamic type" cfi error
507config("angle_no_cfi_unrelated_cast") {
508 if (is_cfi && use_cfi_cast && current_toolchain == default_toolchain) {
509 cflags = [ "-fno-sanitize=cfi-unrelated-cast" ]
510 }
511}
512
Jamie Madillc09ae152019-02-01 19:16:32513angle_source_set("xxhash") {
514 sources = xxhash_sources
Jamie Madill5fde6322020-08-28 18:45:17515 if (is_clang) {
516 cflags_c = [ "-Wno-implicit-fallthrough" ]
517 }
Jamie Madillc09ae152019-02-01 19:16:32518}
519
Jamie Madill1ba72542019-10-04 19:17:49520if (angle_has_build) {
521 fuzzer_test("xxhash_fuzzer") {
Julien Isorce5641d192020-02-05 05:31:47522 sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ]
523 deps = [ ":xxhash" ]
Jamie Madill1ba72542019-10-04 19:17:49524 }
Jamie Madill238c19e2019-02-07 14:09:41525}
526
Mohan Maiyacc34aa72022-12-19 22:03:27527template("angle_common_lib") {
528 angle_static_library(target_name) {
529 sources = invoker.sources
530
531 configs += [
532 ":angle_common_config",
533 ":debug_annotations_config",
534 ]
535
536 deps = [ ":xxhash" ]
537
538 public_deps = [
539 ":angle_abseil",
540 ":includes",
541 ]
542 public_configs += [ ":angle_common_config" ]
543 if (angle_has_build && use_fuzzing_engine) {
544 all_dependent_configs = [ ":angle_disable_pool_alloc" ]
545 }
546
547 if (is_linux || is_chromeos) {
548 libs = [ "dl" ]
549 }
550
551 if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
552 # In API level 26 ANativeWindow APIs were moved from libandroid.so
553 # into a separate library, libnativewindow.so
554 if (ndk_api_level_at_least_26) {
555 libs = [ "nativewindow" ]
556 } else {
557 libs = [ "android" ]
558 }
559 }
560
561 if (angle_expose_non_conformant_extensions_and_versions) {
562 defines = [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ]
563 }
564
565 if (using_sanitizer && !build_with_chromium) {
566 data_deps =
567 [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ]
568 }
569
570 if (is_apple) {
571 frameworks = [ "Metal.framework" ]
572 }
573 }
574}
575
576angle_common_lib("angle_common") {
Frank Henigman44b2c0b2018-08-29 21:31:27577 sources = libangle_common_sources
John Plate05fb2272021-04-27 18:31:31578 if (angle_enable_cl) {
579 sources += libangle_common_cl_sources
580 }
Mohan Maiyacc34aa72022-12-19 22:03:27581}
Cooper Partin75da1972015-06-16 22:03:14582
Mohan Maiyacc34aa72022-12-19 22:03:27583angle_common_lib("angle_common_shader_state") {
584 sources = libangle_common_shader_state_sources
Jamie Madill562e81b2015-01-14 19:31:02585}
586
Jamie Madill4bfb7492022-10-11 00:59:48587angle_source_set("angle_capture_common") {
588 sources = [
Mark Lobodzinski71812392025-04-04 20:13:58589 "src/common/frame_capture_binary_data.cpp",
590 "src/common/frame_capture_binary_data.h",
Jamie Madill4bfb7492022-10-11 00:59:48591 "src/common/frame_capture_utils.cpp",
592 "src/common/frame_capture_utils.h",
593 "src/common/frame_capture_utils_autogen.cpp",
594 "src/common/frame_capture_utils_autogen.h",
595 ]
Mark Lobodzinski71812392025-04-04 20:13:58596
597 # Required for 32-bit platform large file I/O
598 defines = [ "_FILE_OFFSET_BITS=64" ]
599 deps = [
600 ":angle_common",
601 ":angle_compression",
602 ]
Jamie Madill4bfb7492022-10-11 00:59:48603 public_deps = [ ":angle_gl_enum_utils" ]
604}
605
Geoff Lang6e4cfceb2016-06-13 19:06:31606config("angle_image_util_config") {
607 include_dirs = [
608 "include",
609 "src",
610 ]
611}
612
Jamie Madill1f08ab22019-10-03 20:22:52613angle_source_set("angle_image_util_headers") {
614 sources = libangle_image_util_headers
Julien Isorce5641d192020-02-05 05:31:47615 public_deps = [ ":angle_common" ]
Jamie Madill1f08ab22019-10-03 20:22:52616}
617
Jamie Madill7098cff2019-01-15 23:33:42618angle_static_library("angle_image_util") {
Frank Henigman44b2c0b2018-08-29 21:31:27619 sources = libangle_image_util_sources
Jamie Madill7098cff2019-01-15 23:33:42620 public_configs += [ ":angle_image_util_config" ]
Julien Isorce5641d192020-02-05 05:31:47621 public_deps = [ ":angle_image_util_headers" ]
Lubosz Sarnecki45e5cf02022-06-03 12:29:23622
623 if (angle_has_astc_encoder) {
624 public_deps += [ "third_party/astc-encoder:astcenc" ]
625 include_dirs = [ "third_party/astc-encoder/src/Source/" ]
626 }
Geoff Lang6e4cfceb2016-06-13 19:06:31627}
628
Courtney Goeltzenleuchter7d81ae72018-10-09 01:25:19629config("angle_gl_visibility_config") {
630 if (is_win) {
631 defines = [
632 "GL_APICALL=",
633 "GL_API=",
634 ]
635 } else {
636 defines = [
637 "GL_APICALL=__attribute__((visibility(\"default\")))",
638 "GL_API=__attribute__((visibility(\"default\")))",
639 ]
Courtney Goeltzenleuchtere7ece9e2018-10-08 22:43:43640 }
Ian Elliottabcb2b32018-08-29 23:04:15641}
642
Antonio Caggiano7b0f6312022-03-30 12:16:02643config("angle_vulkan_wayland_config") {
644 if (angle_enable_vulkan && angle_use_wayland &&
645 defined(vulkan_wayland_include_dirs)) {
646 include_dirs = vulkan_wayland_include_dirs
647 }
648}
649
Corentin Wallez7b4e00d2017-02-08 15:43:47650config("angle_gpu_info_util_config") {
651 include_dirs = [
652 "include",
653 "src",
654 ]
655}
656
Jamie Madill7098cff2019-01-15 23:33:42657angle_static_library("angle_gpu_info_util") {
Jonah Ryan-Davis66e48502019-04-25 14:49:05658 public_configs += [
659 ":angle_gpu_info_util_config",
660 ":angle_backend_config",
661 ]
Julien Isorce5641d192020-02-05 05:31:47662 public_deps = [ ":angle_common" ]
Frank Henigman44b2c0b2018-08-29 21:31:27663 sources = libangle_gpu_info_util_sources
Corentin Wallez7b4e00d2017-02-08 15:43:47664 deps = []
665 libs = []
666 defines = []
667
Jamie Madilld27552f2021-11-11 16:43:30668 if (angle_build_vulkan_system_info) {
Michael Spangb630bf92020-01-24 22:27:01669 sources += libangle_gpu_info_util_vulkan_sources
Jamie Madill48da1c32021-07-16 17:24:34670 deps += [
Jamie Madill48da1c32021-07-16 17:24:34671 "$angle_vulkan_headers_dir:vulkan_headers",
Jamie Madilld27552f2021-11-11 16:43:30672 "src/common/vulkan:angle_libvulkan_loader",
673 "src/common/vulkan:angle_vulkan_icd",
Jamie Madill48da1c32021-07-16 17:24:34674 ]
Peng Huang28aadf42022-09-26 13:20:49675 configs += [ "$angle_root:angle_no_cfi_icall" ]
Geoff Lang48da7e72021-09-07 19:49:07676 if (angle_enable_vulkan_system_info) {
Jamie Madilld27552f2021-11-11 16:43:30677 defines += [ "ANGLE_USE_VULKAN_SYSTEM_INFO" ]
Geoff Lang48da7e72021-09-07 19:49:07678 }
Michael Spangb630bf92020-01-24 22:27:01679 }
680
Ian Elliottd07c52e2018-06-22 21:42:09681 if (is_android) {
Michael Spangb630bf92020-01-24 22:27:01682 sources += libangle_gpu_info_util_android_sources
683 }
684
685 if (is_fuchsia) {
686 sources += libangle_gpu_info_util_fuchsia_sources
Antonio Maiorano13816d22020-06-16 18:27:04687 deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ]
Ian Elliottd07c52e2018-06-22 21:42:09688 }
689
Corentin Wallez8f77e5d2017-03-24 18:58:59690 if (is_win) {
Frank Henigman44b2c0b2018-08-29 21:31:27691 sources += libangle_gpu_info_util_win_sources
Austin Kinross11dc1632019-09-18 21:46:23692 if (!angle_is_winuwp) {
693 libs += [ "setupapi.lib" ]
694 }
Jonah Ryan-Davis66e48502019-04-25 14:49:05695 libs += [ "dxgi.lib" ]
Corentin Wallez8f77e5d2017-03-24 18:58:59696 }
697
Hidehiko Abe90a9cf92020-09-10 17:40:34698 if (is_linux || is_chromeos) {
Frank Henigman44b2c0b2018-08-29 21:31:27699 sources += libangle_gpu_info_util_linux_sources
Corentin Wallez7b4e00d2017-02-08 15:43:47700
Jamie Madill8970ad32020-08-26 16:59:19701 if (angle_use_x11 && angle_has_build) {
Frank Henigman44b2c0b2018-08-29 21:31:27702 sources += libangle_gpu_info_util_x11_sources
Shahbaz Youssefi7a193b02025-08-06 17:50:50703 deps += [ "src/third_party/libXNVCtrl" ]
Corentin Wallez7b4e00d2017-02-08 15:43:47704 defines += [ "GPU_INFO_USE_X11" ]
705 libs += [
706 "X11",
707 "Xi",
708 "Xext",
709 ]
710 }
Antonio Caggiano9ad43bd2021-12-09 15:52:35711
712 if (angle_use_wayland && angle_has_build) {
713 public_deps += [ ":angle_wayland" ]
714 }
Corentin Wallez7b4e00d2017-02-08 15:43:47715 }
716
Corentin Wallez7b4e00d2017-02-08 15:43:47717 if (use_libpci) {
Frank Henigman44b2c0b2018-08-29 21:31:27718 sources += libangle_gpu_info_util_libpci_sources
Corentin Wallez7b4e00d2017-02-08 15:43:47719 defines += [ "GPU_INFO_USE_LIBPCI" ]
720 libs += [ "pci" ]
721 }
Corentin Wallezd83f64f2017-02-16 15:58:46722
Shahbaz Youssefi5b8dec52021-01-12 04:11:56723 if (is_apple) {
Sylvain Defresnebae95f82020-07-02 15:19:14724 frameworks = [
Corentin Wallezd83f64f2017-02-16 15:58:46725 "CoreFoundation.framework",
Corentin Wallez163965d2017-10-11 15:38:55726 "CoreGraphics.framework",
Corentin Wallezd83f64f2017-02-16 15:58:46727 ]
Alexey Knyazev78f146e2024-10-14 00:00:00728 if (angle_enable_cgl) {
James Darpiniandea86292020-12-03 00:26:03729 frameworks += [ "OpenGL.framework" ]
730 }
731 if (is_mac || angle_enable_cgl) {
Julie Jeongeun Kimca959762025-04-15 13:28:04732 frameworks += [ "IOKit.framework" ]
James Darpiniandea86292020-12-03 00:26:03733 sources += libangle_gpu_info_util_mac_sources
734 }
735 if (is_ios && !angle_enable_cgl) {
736 sources += libangle_gpu_info_util_ios_sources
737 }
Corentin Wallezd83f64f2017-02-16 15:58:46738 }
Corentin Wallez7b4e00d2017-02-08 15:43:47739}
740
Jamie Madill1f08ab22019-10-03 20:22:52741angle_source_set("angle_translator_headers") {
742 sources = angle_translator_exported_headers
Yuly Novikov0c9cbf32023-01-26 12:07:51743 public_deps = [ ":includes" ]
Jamie Madill1f08ab22019-10-03 20:22:52744}
745
Shahbaz Youssefic0c541d2024-10-28 15:54:26746angle_static_library("translator") {
747 sources = angle_translator_sources
748 defines = []
Austin Kinross82b5ab62015-12-11 17:30:15749
Shahbaz Youssefic0c541d2024-10-28 15:54:26750 _needs_glsl_base = false
751 _needs_glsl_and_vulkan_base = false
752 _uses_spirv = false
Shahbaz Youssefi382bf282020-12-25 04:56:39753
Shahbaz Youssefic0c541d2024-10-28 15:54:26754 # Frontend support:
755 sources += angle_translator_essl_symbol_table_sources
Shahbaz Youssefi58930a72021-08-08 02:05:27756
Shahbaz Youssefic0c541d2024-10-28 15:54:26757 # Backend support:
758 if (angle_enable_null) {
759 defines += [ "ANGLE_ENABLE_NULL" ]
760 }
Alexey Knyazev2f644ed2024-10-16 00:00:00761
Shahbaz Youssefic0c541d2024-10-28 15:54:26762 if (angle_enable_essl || use_fuzzing_engine) {
763 _needs_glsl_base = true
764 sources += angle_translator_essl_sources
765 defines += [ "ANGLE_ENABLE_ESSL" ]
766 }
Jamie Madill72f5b5e2014-06-23 19:13:02767
Shahbaz Youssefic0c541d2024-10-28 15:54:26768 if (angle_enable_glsl || use_fuzzing_engine) {
769 _needs_glsl_base = true
770 _needs_glsl_and_vulkan_base = true
771 sources += angle_translator_glsl_sources
772 defines += [ "ANGLE_ENABLE_GLSL" ]
Jamie Madille794cd82017-01-13 22:29:51773
Shahbaz Youssefic0c541d2024-10-28 15:54:26774 if (is_apple) {
775 sources += angle_translator_glsl_apple_sources
Shahbaz Youssefi0973dd62021-03-31 15:11:26776 }
Jamie Madilla8503ce2016-07-18 17:47:12777 }
Jamie Madill72f5b5e2014-06-23 19:13:02778
Shahbaz Youssefic0c541d2024-10-28 15:54:26779 if (angle_enable_hlsl || use_fuzzing_engine) {
780 sources += angle_translator_hlsl_sources
781 defines += [ "ANGLE_ENABLE_HLSL" ]
782 }
Shahbaz Youssefi0973dd62021-03-31 15:11:26783
Shahbaz Youssefic0c541d2024-10-28 15:54:26784 if (angle_enable_vulkan || use_fuzzing_engine) {
785 _needs_glsl_base = true
786 _needs_glsl_and_vulkan_base = true
787 _uses_spirv = true
788
789 sources += angle_translator_lib_spirv_sources
790 }
791
792 if (angle_enable_vulkan || use_fuzzing_engine) {
793 defines += [ "ANGLE_ENABLE_VULKAN" ]
794 }
795
796 if (angle_enable_metal) {
797 sources += angle_translator_lib_msl_sources
798 defines += [ "ANGLE_ENABLE_METAL" ]
799 }
800
801 if (angle_enable_wgpu) {
802 sources += angle_translator_lib_wgsl_sources
803 defines += [ "ANGLE_ENABLE_WGPU" ]
804 }
805
806 if (_needs_glsl_base) {
807 sources += angle_translator_glsl_base_sources
808 }
809 if (_needs_glsl_and_vulkan_base) {
810 sources += angle_translator_glsl_and_vulkan_base_sources
811 }
812
813 public_configs += [ ":external_config" ]
814
815 deps = [
816 ":angle_common_shader_state",
817 ":includes",
818 ":preprocessor",
819 "$angle_root/src/common/spirv:angle_spirv_headers",
820 ]
821
822 if (_uses_spirv) {
823 deps += [
824 "$angle_root/src/common/spirv:angle_spirv_base",
825 "$angle_root/src/common/spirv:angle_spirv_builder",
826 "${angle_spirv_headers_dir}:spv_headers",
827 "${angle_spirv_tools_dir}:spvtools_headers",
828 "${angle_spirv_tools_dir}:spvtools_val",
829 ]
830 }
831
832 public_deps = [
833 ":angle_common",
834 ":angle_translator_headers",
835 ":angle_version_info",
836 ]
837
838 if (is_win) {
839 # Necessary to suppress some system header xtree warnings in Release.
840 # For some reason this warning doesn't get triggered in Chromium
841 cflags = [ "/wd4718" ]
Shahbaz Youssefie2c87b42021-05-04 15:46:36842 }
Shahbaz Youssefi0973dd62021-03-31 15:11:26843}
844
Jamie Madill7098cff2019-01-15 23:33:42845angle_source_set("translator_fuzzer") {
Julien Isorce5641d192020-02-05 05:31:47846 sources = [ "src/compiler/fuzz/translator_fuzzer.cpp" ]
Corentin Wallez28b65282016-06-16 14:24:50847
848 include_dirs = [
849 "include",
850 "src",
851 ]
852
Julien Isorce5641d192020-02-05 05:31:47853 deps = [ ":translator" ]
Corentin Wallez28b65282016-06-16 14:24:50854}
855
Yuxin Hu82826be2023-01-06 19:20:14856config("angle_program_version_id_config") {
857 include_dirs = [ "$root_gen_dir/angle" ]
858 visibility = [ ":angle_program_version_id" ]
859}
860
861action("angle_program_version_id") {
862 response_file_contents =
863 rebase_path(angle_code_affecting_program_serialize, root_build_dir)
864
865 _program_version_header = "$root_gen_dir/angle/ANGLEShaderProgramVersion.h"
866 script = "src/program_serialize_data_version.py"
867 outputs = [ _program_version_header ]
868
869 visibility = [ ":angle_version" ]
870
871 inputs = angle_code_affecting_program_serialize
Geoff Langdb387072023-10-19 22:08:51872 deps = angle_dependencies_affecting_program_serialize
Yuxin Hu82826be2023-01-06 19:20:14873
874 args = [
875 rebase_path(_program_version_header, root_build_dir),
876 "{{response_file_name}}",
877 ]
878
879 public_configs = [ ":angle_program_version_id_config" ]
880}
881
Jamie Madill62778cb2020-09-23 03:10:04882config("angle_commit_id_config") {
Jamie Madill72f5b5e2014-06-23 19:13:02883 include_dirs = [ "$root_gen_dir/angle" ]
Jamie Madill62778cb2020-09-23 03:10:04884 visibility = [ ":angle_commit_id" ]
Jamie Madill720ca442018-12-17 19:04:10885}
886
Jamie Madill62778cb2020-09-23 03:10:04887action("angle_commit_id") {
Jamie Madilld8c18ac2021-10-08 17:00:19888 _commit_id_header = "$root_gen_dir/angle/angle_commit.h"
Geoff Langba8ef682020-02-24 19:13:40889 script = "src/commit_id.py"
Jamie Madilld8c18ac2021-10-08 17:00:19890 outputs = [ _commit_id_header ]
Andrew Grieve35356d92025-05-06 16:27:32891 depfile = "${_commit_id_header}.d"
Jamie Madilld8c18ac2021-10-08 17:00:19892 visibility = [ ":angle_version" ]
Jamie Madill72f5b5e2014-06-23 19:13:02893
Geoff Langba8ef682020-02-24 19:13:40894 args = [
895 "gen",
Jamie Madilld8c18ac2021-10-08 17:00:19896 rebase_path(_commit_id_header, root_build_dir),
Andrew Grieve35356d92025-05-06 16:27:32897 rebase_path(depfile, root_build_dir),
Geoff Langba8ef682020-02-24 19:13:40898 ]
899
Jamie Madill62778cb2020-09-23 03:10:04900 public_configs = [ ":angle_commit_id_config" ]
901}
902
Jamie Madill7098cff2019-01-15 23:33:42903angle_source_set("angle_version") {
Jamie Madill1b104dd2021-05-26 18:29:01904 sources = [ "src/common/angle_version.h" ]
Yuxin Hu82826be2023-01-06 19:20:14905 public_deps = [
906 ":angle_commit_id",
907 ":angle_program_version_id",
908 ]
Jamie Madilld8c18ac2021-10-08 17:00:19909 visibility = [ ":angle_version_info" ]
910
911 # The version headers are used directly in Windows .RC files.
912 if (is_win) {
913 visibility += [
914 ":libEGL",
915 ":libGL",
916 ":libGLESv1_CM",
917 ":libGLESv2",
918 ":libGLESv2_capture_complement",
919 ]
Jamie Madillaaee3c22022-11-30 19:24:13920 if (angle_enable_vulkan) {
921 visibility += [
922 ":libEGL_vulkan_secondaries",
923 ":libGLESv2_vulkan_secondaries",
924 ]
925 }
Jamie Madilld8c18ac2021-10-08 17:00:19926 }
Jamie Madilld8c18ac2021-10-08 17:00:19927}
928
929angle_source_set("angle_version_info") {
930 sources = [
931 "src/common/angle_version_info.cpp",
932 "src/common/angle_version_info.h",
933 ]
Yuxin Hu82826be2023-01-06 19:20:14934 deps = [
935 ":angle_translator_headers",
936 ":angle_version",
937 ]
Jamie Madill4638dc92018-12-17 18:13:49938}
939
Jonah Ryan-Davis66e48502019-04-25 14:49:05940config("angle_backend_config") {
Jamie Madill562e81b2015-01-14 19:31:02941 defines = []
Jonah Ryan-Davis66e48502019-04-25 14:49:05942
Jamie Madill54dfb622021-04-07 16:33:31943 if (angle_force_context_check_every_call) {
944 defines += [ "ANGLE_FORCE_CONTEXT_CHECK_EVERY_CALL=1" ]
945 }
946
Tim Van Patten085044d2021-04-09 00:49:05947 if (angle_expose_non_conformant_extensions_and_versions) {
948 defines += [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ]
949 }
950
Jonah Ryan-Davis5afd5ec2019-10-25 16:53:40951 configs = []
952
Jamie Madillbb96aef2020-09-11 17:50:09953 if (angle_enable_d3d11) {
954 configs += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend_config" ]
955 }
956
957 if (angle_enable_d3d9) {
958 configs += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend_config" ]
959 }
960
Jamie Madill2d741702020-09-11 16:30:04961 if (angle_enable_gl) {
962 configs += [ "src/libANGLE/renderer/gl:angle_gl_backend_config" ]
963 }
964
Jamie Madill852f61f2020-09-11 15:54:35965 if (angle_enable_null) {
966 configs += [ "src/libANGLE/renderer/null:angle_null_backend_config" ]
967 }
968
Liza Burakovaf2c00e82024-01-18 18:36:33969 if (angle_enable_wgpu) {
970 configs += [ "src/libANGLE/renderer/wgpu:angle_wgpu_backend_config" ]
971 }
972
Le Quyend200a772019-10-09 16:44:01973 if (angle_enable_metal) {
Jonah Ryan-Davis5afd5ec2019-10-25 16:53:40974 configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ]
Le Quyend200a772019-10-09 16:44:01975 }
976
Jamie Madill1f08ab22019-10-03 20:22:52977 if (angle_enable_vulkan) {
Jonah Ryan-Davis5afd5ec2019-10-25 16:53:40978 configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
Jamie Madill1f08ab22019-10-03 20:22:52979 }
James Clarke06d194e2021-01-10 22:29:44980
John Plate16a919b2021-04-27 10:36:11981 if (angle_enable_cl_passthrough) {
982 configs += [ "src/libANGLE/renderer/cl:angle_cl_backend_config" ]
983 }
984
James Clarke06d194e2021-01-10 22:29:44985 if (angle_is_winuwp) {
986 configs += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp_config" ]
987 }
Jonah Ryan-Davis66e48502019-04-25 14:49:05988}
989
990config("libANGLE_config") {
991 cflags = []
992 defines = []
993 libs = []
994 ldflags = []
Jamie Madill80ab03c2017-01-03 16:03:23995 defines += [ "LIBANGLE_IMPLEMENTATION" ]
Corentin Wallezbeb81582015-09-02 14:30:55996
997 if (is_win) {
Julien Isorce5641d192020-02-05 05:31:47998 cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics
999 # are not enabled.
Austin Kinross40853472015-02-12 18:39:561000 }
Yuly Novikovb29fccf2018-11-28 15:09:391001
1002 if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
Yuly Novikov8edc68e2019-02-12 17:41:011003 # In API level 26 ANativeWindow APIs were moved from libandroid.so
1004 # into a separate library, libnativewindow.so
1005 if (ndk_api_level_at_least_26) {
Yuly Novikovb29fccf2018-11-28 15:09:391006 libs += [ "nativewindow" ]
1007 } else {
1008 libs += [ "android" ]
1009 }
1010 }
Michael Spang7cd5f642019-08-22 00:03:491011
Ethan Leed22b8be2019-11-15 17:26:391012 if (angle_use_x11) {
Michael Spang7cd5f642019-08-22 00:03:491013 defines += [ "ANGLE_USE_X11" ]
1014 }
Jamie Madillaf5e3822020-01-28 15:05:361015
Antonio Caggiano9ad43bd2021-12-09 15:52:351016 if (angle_use_wayland) {
1017 defines += [ "ANGLE_USE_WAYLAND" ]
1018 }
1019
Jamie Madillaf5e3822020-01-28 15:05:361020 if (angle_enable_overlay) {
1021 defines += [ "ANGLE_ENABLE_OVERLAY=1" ]
1022 }
Tim Van Pattenee4e0862020-09-24 17:39:491023 if (angle_enable_perf_counter_output) {
1024 defines += [ "ANGLE_ENABLE_PERF_COUNTER_OUTPUT=1" ]
1025 }
Geoff Lang46c92a02023-05-16 15:14:441026
1027 if (!is_android) {
1028 # b/283233503
1029 # Only export the ANGLE platform methods on Android, the EGL loader depends on them for
1030 # detecting ANGLE. Normally, users are expected to load them through eglGetProcAddress.
1031 defines += [ "ANGLE_PLATFORM_EXPORT=" ]
1032 }
Jamie Madill562e81b2015-01-14 19:31:021033}
Geoff Lang2b5420c2014-11-19 19:20:151034
Jamie Madill1f08ab22019-10-03 20:22:521035angle_source_set("libANGLE_headers") {
1036 sources = libangle_headers
John Platee25f3b12021-04-21 20:43:461037 if (angle_enable_cl) {
1038 sources += libangle_cl_headers
1039 }
Jamie Madill1f08ab22019-10-03 20:22:521040 public_deps = [
1041 ":angle_common",
1042 ":angle_translator_headers",
1043 ]
Jamie Madillaf5e3822020-01-28 15:05:361044 public_configs += [ ":libANGLE_config" ]
Jamie Madillb62a1c22018-02-06 14:54:021045}
1046
Jamie Madill23b16742021-09-14 14:29:141047if ((is_win && angle_enable_gl) || angle_enable_d3d11 || angle_enable_d3d9) {
Jamie Madill4d3a0f62020-09-11 16:36:051048 angle_source_set("angle_d3d_format_tables") {
1049 sources = [
1050 "src/libANGLE/renderer/dxgi_format_map.h",
1051 "src/libANGLE/renderer/dxgi_format_map_autogen.cpp",
1052 "src/libANGLE/renderer/dxgi_support_table.h",
1053 "src/libANGLE/renderer/dxgi_support_table_autogen.cpp",
1054 ]
1055
1056 if (!angle_is_winuwp) {
1057 sources += [
1058 "src/libANGLE/renderer/d3d_format.cpp",
1059 "src/libANGLE/renderer/d3d_format.h",
1060 ]
1061 }
1062
1063 public_deps = [ ":libANGLE_headers" ]
1064 configs += [ ":angle_backend_config" ]
1065 }
1066}
1067
Jamie Madillaaee3c22022-11-30 19:24:131068# Vulkan gets mixed in later depending on secondary command buffer configs
1069angle_source_set("libANGLE_no_vulkan") {
Frank Henigman44b2c0b2018-08-29 21:31:271070 sources = libangle_sources
John Platee25f3b12021-04-21 20:43:461071 if (angle_enable_cl) {
1072 sources += libangle_cl_sources
1073 }
Eddie Hatfieldc54ed792022-07-21 16:38:471074 defines = []
Geoff Lang2b5420c2014-11-19 19:20:151075
Jamie Madill5ea762a2017-06-07 18:59:511076 include_dirs = []
Jamie Madill562e81b2015-01-14 19:31:021077 libs = []
Frank Henigmane42ec182017-12-12 04:58:531078 if (angle_link_glx) {
1079 libs += [ "GL" ]
1080 defines += [ "ANGLE_LINK_GLX" ]
1081 }
Jamie Madille2e406c2016-06-02 17:04:101082 public_deps = [
Corentin Wallezcc068e92016-02-29 21:37:041083 ":angle_common",
Mohan Maiyacc34aa72022-12-19 22:03:271084 ":angle_common_shader_state",
Jamie Madill720ca442018-12-17 19:04:101085 ":angle_gpu_info_util",
Greg Schlomoff81a244d2022-10-10 22:32:251086 ":angle_image_util",
Jamie Madilld8c18ac2021-10-08 17:00:191087 ":angle_version_info",
Jamie Madill1f08ab22019-10-03 20:22:521088 ":libANGLE_headers",
Jamie Madill720ca442018-12-17 19:04:101089 ":translator",
Jamie Madille2e406c2016-06-02 17:04:101090 ]
1091 deps = [
Tim Van Pattenb55f0f72020-06-03 00:01:241092 ":angle_compression",
Corentin Wallezcc068e92016-02-29 21:37:041093 ":includes",
Corentin Wallezcc068e92016-02-29 21:37:041094 ]
1095
James Clarke06d194e2021-01-10 22:29:441096 if (is_win && !angle_is_winuwp) {
Jamie Madille55374f2019-10-24 16:55:121097 libs += [
Jamie Madille55374f2019-10-24 16:55:121098 "gdi32.lib",
1099 "user32.lib",
1100 ]
1101 }
1102
Jamie Madillbb96aef2020-09-11 17:50:091103 if (angle_enable_d3d11) {
1104 public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend" ]
1105 }
1106
1107 if (angle_enable_d3d9) {
1108 public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend" ]
1109 }
1110
Jamie Madill2d741702020-09-11 16:30:041111 if (angle_enable_gl) {
1112 public_deps += [ "src/libANGLE/renderer/gl:angle_gl_backend" ]
1113 }
1114
Jamie Madill852f61f2020-09-11 15:54:351115 if (angle_enable_null) {
1116 public_deps += [ "src/libANGLE/renderer/null:angle_null_backend" ]
1117 }
1118
Liza Burakovaf2c00e82024-01-18 18:36:331119 if (angle_enable_wgpu) {
1120 public_deps += [ "src/libANGLE/renderer/wgpu:angle_wgpu_backend" ]
1121 }
1122
James Clarke06d194e2021-01-10 22:29:441123 if (angle_is_winuwp) {
1124 public_deps += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp" ]
1125 }
1126
1127 if (angle_enable_d3d11) {
1128 libs += [ "dxguid.lib" ]
1129 }
1130
Le Quyend200a772019-10-09 16:44:011131 if (angle_enable_metal) {
1132 public_deps += [ "src/libANGLE/renderer/metal:angle_metal_backend" ]
1133 }
1134
John Plate16a919b2021-04-27 10:36:111135 if (angle_enable_cl_passthrough) {
1136 public_deps += [ "src/libANGLE/renderer/cl:angle_cl_backend" ]
1137 }
1138
Shahbaz Youssefi5b8dec52021-01-12 04:11:561139 if (is_apple) {
Geoff Langecd2e3b2019-07-09 19:39:391140 sources += libangle_mac_sources
1141 }
1142
Kyle Piddingtond33a2222021-04-26 23:56:151143 if (is_ios) {
1144 sources += [ "src/libANGLE/renderer/driver_utils_ios.mm" ]
1145 }
1146
Jamie Madill562e81b2015-01-14 19:31:021147 if (is_debug) {
Jamie Madilledbc2442016-01-04 16:25:001148 defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
Jamie Madill72f5b5e2014-06-23 19:13:021149 }
Shahbaz Youssefi7a193b02025-08-06 17:50:501150 if (build_with_chromium) {
1151 defines += [ "ANGLE_ALWAYS_REPORT_VALIDATION_ERRORS" ]
1152 }
Jamie Madill72f5b5e2014-06-23 19:13:021153
Jamie Madill7098cff2019-01-15 23:33:421154 configs += [ ":debug_annotations_config" ]
Jonah Ryan-Davis66e48502019-04-25 14:49:051155 public_configs += [
1156 ":libANGLE_config",
1157 ":angle_backend_config",
1158 ]
Jamie Madill80ab03c2017-01-03 16:03:231159
Jamie Madill1ba72542019-10-04 19:17:491160 if (_use_copy_compiler_dll) {
Julien Isorce5641d192020-02-05 05:31:471161 data_deps = [ ":copy_compiler_dll" ]
Jamie Madill562e81b2015-01-14 19:31:021162 }
1163}
1164
Jamie Madilleb1b1642019-07-30 21:22:171165config("angle_frame_capture_disabled") {
1166 defines = [ "ANGLE_CAPTURE_ENABLED=0" ]
1167}
1168
Jamie Madillaaee3c22022-11-30 19:24:131169angle_source_set("angle_frame_capture_mock") {
1170 public_deps = [ ":libANGLE_headers" ]
Jamie Madilleb1b1642019-07-30 21:22:171171 public_configs = [ ":angle_frame_capture_disabled" ]
Jamie Madill67e4aff2021-04-02 17:17:001172 sources = [
Mark Lobodzinski71812392025-04-04 20:13:581173 "src/common/frame_capture_binary_data.h",
Jamie Madillaaee3c22022-11-30 19:24:131174 "src/common/frame_capture_utils.h",
1175 "src/common/frame_capture_utils_autogen.h",
1176 "src/common/gl_enum_utils_autogen.h",
1177 "src/libANGLE/capture/FrameCapture.h",
Jamie Madill67e4aff2021-04-02 17:17:001178 "src/libANGLE/capture/FrameCapture_mock.cpp",
Jamie Madillaaee3c22022-11-30 19:24:131179 "src/libANGLE/capture/serialize.h",
Jamie Madill4bfb7492022-10-11 00:59:481180 "src/libANGLE/capture/serialize_mock.cpp",
Jamie Madill67e4aff2021-04-02 17:17:001181 ]
Jamie Madilleb1b1642019-07-30 21:22:171182}
1183
Brandon Schade5cfab192019-10-28 16:12:531184angle_source_set("angle_gl_enum_utils") {
Alexey Knyazev47279c72021-08-15 19:20:321185 deps = [ ":angle_common" ]
Brandon Schade5cfab192019-10-28 16:12:531186 sources = [
Jamie Madill4bfb7492022-10-11 00:59:481187 "src/common/gl_enum_utils.cpp",
1188 "src/common/gl_enum_utils.h",
1189 "src/common/gl_enum_utils_autogen.cpp",
1190 "src/common/gl_enum_utils_autogen.h",
Brandon Schade5cfab192019-10-28 16:12:531191 ]
1192}
1193
Antonio Caggiano9ad43bd2021-12-09 15:52:351194if (angle_use_wayland) {
1195 config("angle_wayland_config") {
Maksim Sisov3d954832023-01-17 10:18:501196 if ("$wayland_gn_dir" == "") {
Antonio Caggiano9ad43bd2021-12-09 15:52:351197 libs = [
1198 "wayland-client",
1199 "wayland-egl",
1200 ]
1201 }
1202
1203 include_dirs = [
Antonio Caggiano543dcdd2022-06-09 08:50:411204 "$wayland_dir/egl",
1205 "$wayland_dir/src",
Antonio Caggiano9ad43bd2021-12-09 15:52:351206 ]
1207 }
1208
1209 group("angle_wayland") {
1210 public_configs = [ ":angle_wayland_config" ]
1211
Maksim Sisov3d954832023-01-17 10:18:501212 if ("$wayland_gn_dir" != "") {
Antonio Caggiano543dcdd2022-06-09 08:50:411213 # Use third-party targets
Antonio Caggiano9ad43bd2021-12-09 15:52:351214 public_deps = [
Antonio Caggiano543dcdd2022-06-09 08:50:411215 "$wayland_gn_dir:wayland_client",
1216 "$wayland_gn_dir:wayland_egl",
Antonio Caggiano9ad43bd2021-12-09 15:52:351217 ]
1218 }
1219 }
1220}
1221
Tim Van Pattene78d9a62020-07-24 17:58:451222if (!defined(angle_abseil_cpp_dir)) {
1223 angle_abseil_cpp_dir = "//third_party/abseil-cpp"
1224}
1225
1226config("angle_abseil_config") {
Tim Van Pattenec42b142020-09-28 16:15:461227 if (angle_enable_abseil) {
1228 defines = [ "ANGLE_USE_ABSEIL" ]
Tim Van Pattene78d9a62020-07-24 17:58:451229
Tim Van Pattenec42b142020-09-28 16:15:461230 configs = [
1231 "$angle_abseil_cpp_dir:absl_define_config",
1232 "$angle_abseil_cpp_dir:absl_include_config",
1233 ]
1234 }
Tim Van Pattene78d9a62020-07-24 17:58:451235}
1236
1237group("angle_abseil") {
Tim Van Pattenec42b142020-09-28 16:15:461238 if (angle_enable_abseil) {
1239 # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
Yuly Novikov53cb3f42024-05-11 16:18:221240 # we can be more specific when building standalone non-component ANGLE.
Geoff Langc96435e2024-05-10 20:06:191241 # Also build the combined target when building Dawn to avoid multiply defined globals.
Yuly Novikov53cb3f42024-05-11 16:18:221242 if (build_with_chromium || angle_enable_wgpu || is_component_build) {
Tim Van Pattenec42b142020-09-28 16:15:461243 public_deps = [ "$angle_abseil_cpp_dir:absl" ]
1244 } else {
Shahbaz Youssefi8f77e0b2021-07-29 19:54:261245 public_deps = [
1246 "$angle_abseil_cpp_dir/absl/container:flat_hash_map",
1247 "$angle_abseil_cpp_dir/absl/container:flat_hash_set",
1248 ]
Tim Van Pattenec42b142020-09-28 16:15:461249 }
Tim Van Pattene78d9a62020-07-24 17:58:451250
Tim Van Pattenec42b142020-09-28 16:15:461251 public_configs = [ ":angle_abseil_config" ]
1252 }
Tim Van Pattene78d9a62020-07-24 17:58:451253}
1254
Jamie Madill7e453a22020-03-16 02:11:031255config("angle_compression_config") {
1256 include_dirs = [ "//third_party/zlib/google" ]
1257}
1258
1259group("angle_compression") {
1260 public_configs = [
1261 ":angle_compression_config",
1262 "//third_party/zlib:zlib_config",
1263 ]
Jamie Madill35d3c412020-08-26 16:59:181264 public_deps =
1265 [ "$angle_zlib_compression_utils_dir:compression_utils_portable" ]
Jamie Madill7e453a22020-03-16 02:11:031266}
1267
Tim Van Patten7753c832021-06-18 20:25:401268if (angle_has_rapidjson) {
Jamie Madill67e4aff2021-04-02 17:17:001269 config("angle_rapidjson_config") {
1270 defines = [ "ANGLE_HAS_RAPIDJSON" ]
Gert Wollnyb3a80332021-03-31 07:34:001271 }
Jamie Madill67e4aff2021-04-02 17:17:001272 angle_source_set("angle_json_serializer") {
1273 public_deps = [
Jamie Madill0004ecc2021-09-22 17:39:551274 ":angle_common",
Jamie Madill67e4aff2021-04-02 17:17:001275 "$angle_root/third_party/rapidjson",
1276 ]
1277 sources = [
Jamie Madill1af5c462021-09-14 18:40:491278 "src/common/serializer/JsonSerializer.cpp",
1279 "src/common/serializer/JsonSerializer.h",
Jamie Madill67e4aff2021-04-02 17:17:001280 ]
1281 public_configs = [ ":angle_rapidjson_config" ]
1282 }
Gert Wollnye0b9d4f2021-03-15 10:25:391283}
1284
Jamie Madill1a3b17d2021-09-09 21:26:561285assert(angle_has_frame_capture || !angle_with_capture_by_default)
1286if (angle_has_frame_capture) {
1287 config("angle_frame_capture_enabled") {
1288 defines = [ "ANGLE_CAPTURE_ENABLED=1" ]
1289 }
Jamie Madillaaee3c22022-11-30 19:24:131290}
Jamie Madill67e4aff2021-04-02 17:17:001291
Jamie Madillaaee3c22022-11-30 19:24:131292template("libANGLE_template") {
1293 angle_source_set("${target_name}") {
1294 public_deps = invoker.public_deps + [ ":libANGLE_no_vulkan" ]
1295 public_configs = [ ":angle_frame_capture_disabled" ]
Jamie Madill1a3b17d2021-09-09 21:26:561296
Jamie Madillaaee3c22022-11-30 19:24:131297 # gl_enum_utils defaults included in with_capture build
1298 deps = [ ":angle_frame_capture_mock" ]
1299 if (angle_enable_trace || is_debug) {
1300 deps += [ ":angle_gl_enum_utils" ]
Jamie Madill1a3b17d2021-09-09 21:26:561301 }
Jamie Madill67e4aff2021-04-02 17:17:001302 }
Jamie Madillaaee3c22022-11-30 19:24:131303
1304 if (angle_has_frame_capture) {
1305 angle_source_set("${target_name}_with_capture") {
1306 public_deps = invoker.public_deps + [
1307 ":angle_gl_enum_utils",
1308 ":libANGLE_no_vulkan",
1309 ]
1310 deps = [
1311 ":angle_capture_common",
1312 ":angle_compression",
1313 ]
1314 public_configs = [ ":angle_frame_capture_enabled" ]
1315 sources = libangle_capture_sources
1316
1317 if (angle_has_rapidjson) {
1318 public_deps += [ ":angle_json_serializer" ]
1319 sources += [ "src/libANGLE/capture/serialize.cpp" ]
1320 } else {
1321 sources += [ "src/libANGLE/capture/serialize_mock.cpp" ]
1322 }
1323 }
1324 }
1325}
1326
1327libANGLE_template("libANGLE") {
1328 public_deps = []
1329 if (angle_enable_vulkan) {
1330 public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ]
1331 }
1332}
1333
1334if (angle_enable_vulkan) {
1335 libANGLE_template("libANGLE_vulkan_secondaries") {
1336 public_deps =
1337 [ "src/libANGLE/renderer/vulkan:angle_vulkan_secondaries_backend" ]
1338 }
Jamie Madill612b7412019-07-05 15:13:301339}
1340
Robert Sesekdb8ae832016-06-21 15:47:031341config("shared_library_public_config") {
James Darpinian0dbe7cd2020-12-08 20:24:351342 if (is_mac && !is_component_build) {
Robert Sesekdb8ae832016-06-21 15:47:031343 # Executable targets that depend on the shared libraries below need to have
1344 # the rpath setup in non-component build configurations.
Jamie Madilla8503ce2016-07-18 17:47:121345 ldflags = [
1346 "-rpath",
1347 "@executable_path/",
1348 ]
Jonah Ryan-Davis90a8af32020-03-05 18:48:471349 if (build_with_chromium) {
1350 ldflags += [
1351 # Path for loading shared libraries for unbundled binaries.
1352 # From //build/config/mac/BUILD.gn, this is only added for
1353 # component builds. However, since ANGLE always dynamically
1354 # links to libvulkan, it should be re-added for non-component
Shahbaz Youssefid193d512024-06-18 02:46:081355 # builds. (anglebug.com/42263076)
Jonah Ryan-Davis90a8af32020-03-05 18:48:471356 "-Wl,-rpath,@loader_path/.",
1357 ]
1358 }
Robert Sesekdb8ae832016-06-21 15:47:031359 }
Josh Matthews732c9d02019-11-29 18:59:031360
Matthew Leibowitza70b6f52024-01-26 18:37:071361 if (angle_is_winuwp && !angle_is_winappsdk) {
Josh Matthews732c9d02019-11-29 18:59:031362 ldflags = [
1363 "/APPCONTAINER",
1364
1365 # Disable warning about invalid subsystem number.
1366 # A default appropriate subsystem is selected automatically.
1367 "/IGNORE:4010",
1368 ]
1369 }
Robert Sesekdb8ae832016-06-21 15:47:031370}
1371
Shahbaz Youssefib16d1052024-10-03 14:25:321372_angle_glesv2_library_name = "libGLESv2${angle_libs_suffix}"
Jamie Madillaaee3c22022-11-30 19:24:131373_angle_glesv2_vulkan_secondaries_library_name =
angle-autoroll298abbc2024-02-16 08:50:431374 "libGLESv2_vulkan_secondaries${angle_libs_suffix}"
Jamie Madillaaee3c22022-11-30 19:24:131375
Jamie Madill4638dc92018-12-17 18:13:491376config("library_name_config") {
angle-autoroll298abbc2024-02-16 08:50:431377 _egllib = "libEGL${angle_libs_suffix}"
1378 _vk2egllib = "libEGL_vulkan_secondaries${angle_libs_suffix}"
Jamie Madillaaee3c22022-11-30 19:24:131379 defines = [
1380 "ANGLE_EGL_LIBRARY_NAME=\"${_egllib}\"",
1381 "ANGLE_GLESV2_LIBRARY_NAME=\"${_angle_glesv2_library_name}\"",
Jamie Madilla9868112022-09-15 21:29:041382 "ANGLE_MESA_EGL_LIBRARY_NAME=\"mesa/src/egl/libEGL\"",
1383 "ANGLE_MESA_GLESV2_LIBRARY_NAME=\"mesa/src/mapi/es2api/libGLESv2\"",
Jamie Madill2031e212022-12-02 20:30:541384 "ANGLE_VULKAN_SECONDARIES_EGL_LIBRARY_NAME=\"${_vk2egllib}\"",
1385 "ANGLE_VULKAN_SECONDARIES_GLESV2_LIBRARY_NAME=\"${_angle_glesv2_vulkan_secondaries_library_name}\"",
Jamie Madilla9868112022-09-15 21:29:041386 ]
Jamie Madill4638dc92018-12-17 18:13:491387}
1388
Jamie Madill80ab03c2017-01-03 16:03:231389# This config controls export definitions on ANGLE API calls.
Jamie Madillaaee3c22022-11-30 19:24:131390config("angle_static_config") {
Jamie Madill80ab03c2017-01-03 16:03:231391 defines = [
1392 "ANGLE_EXPORT=",
Peng Huange99828e2021-02-17 00:13:441393 "ANGLE_STATIC=1",
Jamie Madillba319ba2018-12-29 15:29:331394 "ANGLE_UTIL_EXPORT=",
Jamie Madill80ab03c2017-01-03 16:03:231395 "EGLAPI=",
1396 "GL_APICALL=",
Geoff Lang2aaa7b42018-01-12 22:17:271397 "GL_API=",
Jamie Madill80ab03c2017-01-03 16:03:231398 ]
1399}
1400
Jamie Madilleb1b1642019-07-30 21:22:171401set_defaults("angle_libGLESv2") {
1402 sources = []
1403 output_name = "libGLESv2"
1404}
1405
Jamie Madill612b7412019-07-05 15:13:301406template("angle_libGLESv2") {
1407 angle_shared_library(target_name) {
Geoff Langa9115192025-05-12 16:22:421408 sources =
1409 invoker.sources + libglesv2_entry_point_sources + libglesv2_sources
Eddie Hatfieldc54ed792022-07-21 16:38:471410 deps = invoker.deps + [ ":includes" ]
1411 defines = [ "LIBGLESV2_IMPLEMENTATION" ]
Shahbaz Youssefi7defdb62021-10-19 14:07:071412
Jamie Madilleb1b1642019-07-30 21:22:171413 output_name = "${invoker.output_name}${angle_libs_suffix}"
Craig Stout24136212021-11-08 22:01:341414 if (angle_glesv2_extension != "") {
1415 output_extension = angle_glesv2_extension
1416 }
Jamie Madilleb1b1642019-07-30 21:22:171417
Jamie Madill612b7412019-07-05 15:13:301418 configs += [
1419 ":angle_gl_visibility_config",
1420 ":debug_annotations_config",
1421 ":gl_prototypes",
1422 ]
1423
Eddie Hatfieldc54ed792022-07-21 16:38:471424 if (angle_enable_cl) {
1425 sources += libglesv2_cl_sources
1426 }
Shahbaz Youssefi7defdb62021-10-19 14:07:071427
Jamie Madilld8c18ac2021-10-08 17:00:191428 if (is_win) {
Shahbaz Youssefib16d1052024-10-03 14:25:321429 sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ]
Eddie Hatfield3960e632022-08-09 20:02:591430 sources += [ "src/libGLESv2/libGLESv2.rc" ]
Jamie Madilld8c18ac2021-10-08 17:00:191431 deps += [ ":angle_version" ]
1432 }
Geoff Lang2b5420c2014-11-19 19:20:151433 }
Jamie Madill612b7412019-07-05 15:13:301434}
John Abd-El-Malek657cd682014-11-05 22:04:191435
Jamie Madill612b7412019-07-05 15:13:301436angle_libGLESv2("libGLESv2") {
Jamie Madilleb1b1642019-07-30 21:22:171437 if (angle_with_capture_by_default) {
Julien Isorce5641d192020-02-05 05:31:471438 deps = [ ":libANGLE_with_capture" ]
Jiacheng Lu617f23d2019-08-12 16:11:531439 } else {
Julien Isorce5641d192020-02-05 05:31:471440 deps = [ ":libANGLE" ]
Jamie Madilleb1b1642019-07-30 21:22:171441 }
Jamie Madill612b7412019-07-05 15:13:301442}
Jamie Madill72f5b5e2014-06-23 19:13:021443
Jamie Madillaaee3c22022-11-30 19:24:131444if (angle_enable_vulkan) {
1445 angle_libGLESv2("libGLESv2_vulkan_secondaries") {
1446 output_name = "libGLESv2_vulkan_secondaries"
1447 if (angle_with_capture_by_default) {
1448 deps = [ ":libANGLE_vulkan_secondaries_with_capture" ]
1449 } else {
1450 deps = [ ":libANGLE_vulkan_secondaries" ]
1451 }
1452 }
1453}
1454
Jiacheng Lu617f23d2019-08-12 16:11:531455# Output capture lib when `angle_with_capture_by_default` disabled, vice versa.
Jamie Madill1a3b17d2021-09-09 21:26:561456if (angle_has_frame_capture) {
1457 angle_libGLESv2("libGLESv2_capture_complement") {
1458 if (angle_with_capture_by_default) {
1459 deps = [ ":libANGLE" ]
1460 output_name += "_no_capture"
1461 } else {
1462 deps = [ ":libANGLE_with_capture" ]
1463 output_name += "_with_capture"
1464 }
Jamie Madilleb1b1642019-07-30 21:22:171465 }
Jamie Madill80ab03c2017-01-03 16:03:231466}
1467
Geoff Langa9115192025-05-12 16:22:421468angle_static_library("libGLESv2_thin_static") {
1469 sources = libglesv2_entry_point_sources
John Platee25f3b12021-04-21 20:43:461470 if (angle_enable_cl) {
1471 sources += libglesv2_cl_sources
1472 }
Jamie Madill7098cff2019-01-15 23:33:421473 configs += [ ":debug_annotations_config" ]
James Clarke06d194e2021-01-10 22:29:441474
Jamie Madillaaee3c22022-11-30 19:24:131475 public_configs += [ ":angle_static_config" ]
Julien Isorce5641d192020-02-05 05:31:471476 deps = [ ":includes" ]
1477 public_deps = [ ":libANGLE" ]
Jamie Madill562e81b2015-01-14 19:31:021478}
1479
Geoff Langa9115192025-05-12 16:22:421480angle_static_library("libGLESv2_static") {
1481 sources = libglesv2_sources
1482 public_deps = [ ":libGLESv2_thin_static" ]
1483}
1484
Jamie Madill77c84962019-06-28 15:24:271485angle_shared_library("libGLESv1_CM") {
Frank Henigman44b2c0b2018-08-29 21:31:271486 sources = libglesv1_cm_sources
Jamie Madill77c84962019-06-28 15:24:271487 output_name = "libGLESv1_CM${angle_libs_suffix}"
Geoff Lang2aaa7b42018-01-12 22:17:271488
Geoff Lang2aaa7b42018-01-12 22:17:271489 configs += [
Courtney Goeltzenleuchter7d81ae72018-10-09 01:25:191490 ":angle_gl_visibility_config",
Geoff Lang2aaa7b42018-01-12 22:17:271491 ":debug_annotations_config",
Jamie Madillba319ba2018-12-29 15:29:331492 ":gl_prototypes",
Geoff Lang2aaa7b42018-01-12 22:17:271493 ]
1494
1495 defines = []
Geoff Lang2aaa7b42018-01-12 22:17:271496
1497 deps = [
1498 ":includes",
Jamie Madill77c84962019-06-28 15:24:271499 ":libGLESv2",
Geoff Lang2aaa7b42018-01-12 22:17:271500 ]
Jamie Madill8970ad32020-08-26 16:59:191501
1502 if (is_win) {
1503 sources += [ "src/libGLESv1_CM/libGLESv1_CM.def" ]
Jamie Madilld8c18ac2021-10-08 17:00:191504 deps += [ ":angle_version" ]
Jamie Madill8970ad32020-08-26 16:59:191505 }
Geoff Lang2aaa7b42018-01-12 22:17:271506}
1507
Jamie Madill4638dc92018-12-17 18:13:491508config("libEGL_egl_loader_config") {
1509 defines = [ "ANGLE_USE_EGL_LOADER" ]
1510}
1511
Jamie Madill7098cff2019-01-15 23:33:421512angle_source_set("libEGL_egl_loader") {
Jamie Madill4638dc92018-12-17 18:13:491513 sources = [
1514 "src/libEGL/egl_loader_autogen.cpp",
1515 "src/libEGL/egl_loader_autogen.h",
1516 ]
1517
Jamie Madill7098cff2019-01-15 23:33:421518 public_configs += [
Jamie Madill4638dc92018-12-17 18:13:491519 ":libEGL_egl_loader_config",
1520 ":gl_prototypes",
Jamie Madill4638dc92018-12-17 18:13:491521 ]
1522
Julien Isorce5641d192020-02-05 05:31:471523 deps = [ ":includes" ]
Jamie Madill4638dc92018-12-17 18:13:491524}
1525
Jamie Madillaaee3c22022-11-30 19:24:131526set_defaults("libEGL_template") {
1527 sources = []
1528 deps = []
1529 public_configs = []
Jamie Madill562e81b2015-01-14 19:31:021530}
Corentin Wallezbeb81582015-09-02 14:30:551531
Jamie Madillaaee3c22022-11-30 19:24:131532template("libEGL_template") {
1533 target(invoker.target_type, target_name) {
1534 forward_variables_from(invoker, "*")
1535 sources += libegl_sources
1536 configs += [
1537 ":debug_annotations_config",
1538 ":library_name_config",
1539 ]
1540 deps += [ ":includes" ]
1541 }
1542}
1543
1544template("libEGL_shared_template") {
1545 libEGL_template(target_name) {
1546 target_type = "angle_shared_library"
1547 output_name = "${invoker.output_name}${angle_libs_suffix}"
1548 if (angle_egl_extension != "") {
1549 output_extension = angle_egl_extension
1550 }
1551
1552 defines = invoker.defines + [ "LIBEGL_IMPLEMENTATION" ]
1553 if (is_win) {
1554 defines += [ "EGLAPI=" ]
1555 } else {
1556 defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
1557 }
1558
1559 deps = [
1560 ":angle_common",
1561 ":libEGL_egl_loader",
1562 ]
1563
1564 sources += invoker.sources
1565
1566 if (is_win) {
1567 sources += [ "src/libEGL/libEGL.rc" ]
1568 deps += [ ":angle_version" ]
1569 }
1570
1571 data_deps = [ ":${invoker.gles_library}" ]
1572 }
1573}
1574
1575libEGL_shared_template("libEGL") {
1576 defines = [ "ANGLE_DISPATCH_LIBRARY=\"${_angle_glesv2_library_name}\"" ]
1577 output_name = "libEGL"
1578 gles_library = "libGLESv2"
1579 sources = []
1580 if (is_win) {
1581 sources += [ "src/libEGL/libEGL_autogen.def" ]
1582 }
1583}
1584
1585if (angle_enable_vulkan) {
1586 libEGL_shared_template("libEGL_vulkan_secondaries") {
1587 defines = [ "ANGLE_DISPATCH_LIBRARY=\"${_angle_glesv2_vulkan_secondaries_library_name}\"" ]
1588 output_name = "libEGL_vulkan_secondaries"
1589 gles_library = "libGLESv2_vulkan_secondaries"
1590 sources = []
1591 if (is_win) {
1592 sources += [ "src/libEGL/libEGL_vulkan_secondaries_autogen.def" ]
1593 }
1594 }
1595}
1596
1597libEGL_template("libEGL_static") {
1598 target_type = "angle_static_library"
1599 public_configs = [ ":angle_static_config" ]
1600 deps = [ ":libGLESv2_static" ]
Manh Nguyendce37b72020-06-22 02:27:061601}
1602
Ken Russellfcadd082017-06-28 21:01:151603# Convenience targets for some of the samples so they can be built
1604# with Chromium's toolchain.
Jamie Madill7098cff2019-01-15 23:33:421605angle_executable("angle_shader_translator") {
Ken Russellfcadd082017-06-28 21:01:151606 testonly = true
1607
Julien Isorce5641d192020-02-05 05:31:471608 sources = [ "samples/shader_translator/shader_translator.cpp" ]
Ken Russellfcadd082017-06-28 21:01:151609
Julien Isorce5641d192020-02-05 05:31:471610 deps = [ ":translator" ]
Shahbaz Youssefi776c6012021-02-26 05:00:571611
1612 defines = []
1613
1614 if (angle_enable_vulkan) {
1615 deps += [
1616 "${angle_spirv_tools_dir}:spvtools_headers",
1617 "${angle_spirv_tools_dir}:spvtools_val",
1618 ]
1619
1620 defines += [ "ANGLE_ENABLE_VULKAN" ]
1621 }
Ken Russellfcadd082017-06-28 21:01:151622}
Courtney Goeltzenleuchter2565d482018-04-12 23:06:481623
Tim Van Patten3c2bff42025-05-22 18:33:121624if (angle_standalone || build_with_chromium ||
1625 build_angle_end2end_tests_library) {
Jamie Madill1ba72542019-10-04 19:17:491626 config("angle_feature_support_config") {
1627 include_dirs = [
1628 "include",
1629 "src",
1630 ]
1631 defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
1632 if (is_debug) {
1633 defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
1634 }
Ian Elliotta9d579e2018-11-28 18:44:481635 }
Courtney Goeltzenleuchter7d81ae72018-10-09 01:25:191636
Jamie Madill1ba72542019-10-04 19:17:491637 angle_shared_library("libfeature_support") {
1638 output_name = "libfeature_support${angle_libs_suffix}"
Ian Elliotta9d579e2018-11-28 18:44:481639
Jamie Madill1ba72542019-10-04 19:17:491640 if (is_android) {
1641 libs = [ "log" ]
1642 }
1643
Yuly Novikov52afb6f2021-01-27 03:22:071644 configs += [
Jamie Madill1ba72542019-10-04 19:17:491645 ":angle_feature_support_config",
1646 "${angle_jsoncpp_dir}:jsoncpp_config",
1647 ]
1648
Shahbaz Youssefi5b8dec52021-01-12 04:11:561649 if (is_apple && !is_component_build) {
Jamie Madill1ba72542019-10-04 19:17:491650 ldflags = [
1651 "-install_name",
1652 "@rpath/${target_name}.dylib",
1653 ]
1654 }
1655
1656 sources = [
1657 "src/feature_support_util/feature_support_util.cpp",
1658 "src/feature_support_util/feature_support_util.h",
1659 ]
1660
1661 deps = [
1662 ":angle_gpu_info_util",
1663 "${angle_jsoncpp_dir}:jsoncpp",
Cezary Kulakowski4fb738f2019-02-01 09:53:441664 ]
1665 }
Ian Elliotta9d579e2018-11-28 18:44:481666}
1667
Kimmo Kinnunenba04fcf2022-03-11 11:58:521668if (angle_enable_cgl) {
1669 config("supports_automatic_graphics_switching") {
1670 # For discussion about config, inputs, etc, see:
1671 # https://bugs.chromium.org/p/chromium/issues/detail?id=781858
1672 _plist_file = "util/osx/supports_automatic_graphics_switching.plist"
1673 inputs = [ _plist_file ]
1674 ldflags = [
1675 "-sectcreate",
1676 "__TEXT",
1677 "__info_plist",
1678 rebase_path(_plist_file, root_build_dir),
1679 ]
1680 }
1681}
1682
Stephen White791970d2024-07-30 17:06:131683if (is_android && symbol_level != 0 &&
1684 (angle_standalone || build_with_chromium)) {
Jamie Madill1f56ed22019-01-03 20:24:221685 action_foreach("compressed_symbols") {
Courtney Goeltzenleuchterc05c1412019-01-03 19:40:131686 sources = []
1687 foreach(_library, angle_libraries) {
Andrew Grieved9665092024-02-12 18:53:321688 sources += [ "$root_out_dir/$_library$angle_libs_suffix$shlib_extension" ]
Courtney Goeltzenleuchterc05c1412019-01-03 19:40:131689 }
1690 if (angle_enable_vulkan_validation_layers) {
1691 foreach(_layer, vulkan_validation_layers) {
Andrew Grieved9665092024-02-12 18:53:321692 sources += [ "$root_out_dir/lib$_layer$shlib_extension" ]
Courtney Goeltzenleuchterc05c1412019-01-03 19:40:131693 }
1694 }
Jamie Madill1f56ed22019-01-03 20:24:221695
Mike Schuchardt45ea2092024-09-06 17:36:071696 if (angle_enable_vulkan_api_dump_layer &&
1697 current_toolchain == default_toolchain) {
Mark Lobodzinski37b24872024-05-03 15:55:041698 sources += [ "$root_out_dir/libVkLayer_lunarg_api_dump$shlib_extension" ]
1699 }
1700
Jamie Madill1f56ed22019-01-03 20:24:221701 script = rebase_path("${root_build_dir}/android/compress_symbols.py",
1702 root_build_dir)
1703
Courtney Goeltzenleuchterc05c1412019-01-03 19:40:131704 deps = []
1705 foreach(_library, angle_libraries) {
Jamie Madill77c84962019-06-28 15:24:271706 deps += [ ":$_library" ]
Courtney Goeltzenleuchterc05c1412019-01-03 19:40:131707 }
1708
1709 if (angle_enable_vulkan_validation_layers) {
1710 foreach(_layer, vulkan_validation_layers) {
Jamie Madill328f72a2020-12-16 00:25:501711 deps += [ "$angle_vulkan_validation_layers_dir:${_layer}" ]
Courtney Goeltzenleuchterc05c1412019-01-03 19:40:131712 }
1713 }
Jamie Madill1f56ed22019-01-03 20:24:221714
Mike Schuchardt45ea2092024-09-06 17:36:071715 if (angle_enable_vulkan_api_dump_layer &&
1716 current_toolchain == default_toolchain) {
Mark Lobodzinski37b24872024-05-03 15:55:041717 deps += [ "$angle_lunarg_vulkantools_dir:VkLayer_lunarg_api_dump" ]
1718 }
1719
Julien Isorce5641d192020-02-05 05:31:471720 outputs = [ "$root_out_dir/lib.compressed/{{source_file_part}}" ]
Jamie Madill1f56ed22019-01-03 20:24:221721
1722 android_nm = "${android_tool_prefix}nm"
Tim Van Patten73e17bf2019-05-14 16:42:251723 android_strip = "${android_tool_prefix}strip"
Jamie Madill1f56ed22019-01-03 20:24:221724
1725 args = [
1726 "--objcopy",
1727 rebase_path(android_objcopy, root_build_dir),
1728 "--nm",
1729 rebase_path(android_nm, root_build_dir),
Tim Van Patten73e17bf2019-05-14 16:42:251730 "--strip",
1731 rebase_path(android_strip, root_build_dir),
Jamie Madill1f56ed22019-01-03 20:24:221732 "--unstrippedsofile",
1733 "{{source_dir}}/lib.unstripped/{{source_file_part}}",
1734 "--output",
1735 "{{source_dir}}/lib.compressed/{{source_file_part}}",
1736 ]
1737 }
1738}
1739
Tim Van Patten57202fb2021-04-30 19:56:111740if ((angle_standalone || build_with_chromium) && is_android &&
1741 current_toolchain == default_toolchain) {
Andrew Grieve1f0766b2025-05-06 17:17:121742 if (build_with_chromium) {
1743 import("//chrome/version.gni")
1744 apk_version_code = chrome_version_code
1745 } else if (angle_enable_commit_id) {
Ian Elliott7ec4d2d2021-02-09 18:48:321746 apk_version_code =
1747 exec_script("src/commit_id.py", [ "position" ], "trim string")
Andrew Grieve1f0766b2025-05-06 17:17:121748 } else {
1749 apk_version_code = "0"
Ian Elliott7ec4d2d2021-02-09 18:48:321750 }
1751
1752 # Package ANGLE libraries for normal use on Android
Cody Northrop8cbd3212019-04-23 19:25:201753 angle_apk("angle_chromium_apk") {
Tobin Ehlis736c43a2020-08-31 16:23:271754 package_name = "org.chromium.angle"
Tim Van Pattenee4fa072019-02-21 19:21:091755 apk_name = "AngleLibraries"
Jamie Madill7bed2a52020-09-23 03:37:541756 version_name = "ANGLE Developer Build"
Ian Elliott7ec4d2d2021-02-09 18:48:321757 version_code = apk_version_code
1758 }
Jamie Madill7bed2a52020-09-23 03:37:541759
Ian Elliott7ec4d2d2021-02-09 18:48:321760 # Package ANGLE libraries for AGI use on Android
1761 angle_apk("angle_agi_chromium_apk") {
1762 package_name = "org.chromium.angle.agi"
1763 apk_name = "AngleAgiLibraries"
1764 version_name = "ANGLE AGI Build"
1765 version_code = apk_version_code
Cody Northrop8e636442018-11-30 23:24:111766 }
1767
1768 group("angle_apks") {
Ian Elliott7ec4d2d2021-02-09 18:48:321769 deps = [
1770 ":angle_agi_chromium_apk",
1771 ":angle_chromium_apk",
1772 ]
Courtney Goeltzenleuchter2565d482018-04-12 23:06:481773 }
1774}
Jamie Madill1ba72542019-10-04 19:17:491775
Antonio Caggianoe3cba402024-04-30 15:47:361776if (install_prefix != "") {
1777 template("install_target") {
1778 install_deps = []
1779
1780 foreach(_lib, invoker.libs) {
1781 install_deps += [ ":install_${_lib}" ]
1782
1783 source = "${root_build_dir}/${_lib}${angle_libs_suffix}${shlib_extension}"
1784
1785 action("install_${_lib}") {
1786 deps = [ ":${_lib}" ]
1787 script = "scripts/install_target.py"
1788 sources = [ source ]
1789
1790 outputs = [ "${target_gen_dir}/install_${_lib}.stamp" ]
1791 args = [
1792 "--name",
1793 _lib,
1794 "--prefix",
1795 "$install_prefix",
1796 "--libs",
1797 rebase_path(source),
1798 ]
1799 }
1800 }
1801
1802 install_deps += [ ":install_includes" ]
1803 action("install_includes") {
1804 script = "scripts/install_target.py"
1805 configs = invoker.configs
1806
1807 outputs = [ "${target_gen_dir}/install_${target_name}.stamp" ]
1808 args = [
1809 "--prefix",
1810 "$install_prefix",
1811 "{{include_dirs}}",
1812 ]
1813 }
1814
1815 group("install_${target_name}") {
1816 deps = install_deps
1817 }
1818 }
1819
1820 install_target("angle") {
1821 libs = [
1822 "libEGL",
1823 "libGLESv1_CM",
1824 "libGLESv2",
1825 ]
1826 configs = [ ":includes_config" ]
1827 }
1828}
1829
Jamie Madill1ba72542019-10-04 19:17:491830group("angle") {
1831 data_deps = [
Julien Isorce5641d192020-02-05 05:31:471832 ":libEGL",
Jamie Madille3c25712019-12-03 19:08:361833 ":libGLESv1_CM",
Jamie Madill1ba72542019-10-04 19:17:491834 ":libGLESv2",
Jamie Madill1ba72542019-10-04 19:17:491835 ]
Jamie Madillaaee3c22022-11-30 19:24:131836 if (angle_enable_vulkan) {
1837 data_deps += [
1838 ":libEGL_vulkan_secondaries",
1839 ":libGLESv2_vulkan_secondaries",
1840 ]
1841 }
Yuly Novikovb0735702023-01-10 15:11:501842 if (is_ios) {
1843 # Need to bundle the libraries inside the .app.
1844 deps = data_deps
1845 }
Jamie Madillaaee3c22022-11-30 19:24:131846}
1847
1848group("angle_static") {
1849 public_deps = [
1850 ":libEGL_static",
1851 ":libGLESv2_static",
1852 ":preprocessor",
1853 ":translator",
1854 ]
Jamie Madill1ba72542019-10-04 19:17:491855}
Fumitoshi Ukaicf9949b2025-01-07 06:15:511856
1857# GN evaluates each .gn file once per toolchain, so restricting to default
1858# toolchain will ensure write_file() is called only once.
1859if (!build_with_chromium && angle_has_build &&
1860 current_toolchain == default_toolchain) {
1861 import("//build/gn_logs.gni")
1862
1863 # Write debug logs to gn_logs.txt.
1864 _lines = [
1865 "Generated during 'gn gen' by //BUILD.gn.",
1866 "",
1867 ] + build_gn_logs
1868
1869 write_file("$root_build_dir/gn_logs.txt", _lines)
1870}