blob: 3e5ac3617f1541154fb9b1b39a05036382f9ac4e [file] [log] [blame]
Jamie Madill0cb3b0f2019-01-28 09:55:20 -05001# Copyright 2019 The ANGLE Project Authors. All rights reserved.
Jamie Madill72f5b5e2014-06-23 15:13:02 -04002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Corentin Wallez51e2ad12015-05-26 11:32:58 -04005# import the use_x11 variable
Frank Henigmand0ef13a2017-08-28 22:53:24 -04006import("gni/angle.gni")
Jamie Madill1ba72542019-10-04 15:17:49 -04007if (angle_has_build) {
8 import("//build/config/linux/pkg_config.gni")
9 import("//build/config/ui.gni")
10 import("//testing/libfuzzer/fuzzer_test.gni")
11
12 if (is_android) {
13 # android/rules.gni can only be imported for Android targets
14 import("//build/config/android/config.gni")
15 import("//build/config/android/rules.gni")
16 import("android/angle_apk.gni")
17 }
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -060018}
Corentin Wallez51e2ad12015-05-26 11:32:58 -040019
Corentin Wallez16d4e472017-03-20 13:06:19 -040020declare_args() {
21 # Use the PCI lib to collect GPU information on Linux.
Hidehiko Abe90a9cf92020-09-11 02:40:34 +090022 use_libpci =
23 (is_linux || is_chromeos) && (!is_chromecast || is_cast_desktop_build) &&
24 (angle_use_x11 || use_ozone) && angle_has_build
Frank Henigmane42ec182017-12-11 23:58:53 -050025
26 # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md.
27 angle_link_glx = false
Jamie Madilleb1b1642019-07-30 17:22:17 -040028
29 # Defaults to capture building to $root_out_dir/angle_libs/with_capture.
30 # Switch on to build capture to $root_out_dir.
31 angle_with_capture_by_default = false
Austin Kinross11dc1632019-09-18 14:46:23 -070032
33 # Don't build extra (test, samples etc) for Windows UWP. We don't have
34 # infrastructure (e.g. windowing helper functions) in place to run them.
Jamie Madille3c25712019-12-03 14:08:36 -050035 angle_build_all = !build_with_chromium && !angle_is_winuwp && angle_has_build
Geoff Lange8883562020-03-06 09:32:18 -050036
37 # Enable generating current commit information using git
38 angle_enable_commit_id = true
Tim Van Pattene78d9a62020-07-24 11:58:45 -060039
40 # Abseil has trouble supporting MSVC, particularly regarding component builds.
41 # http://crbug.com/1126524
42 angle_enable_abseil = angle_has_build && is_clang
Jamie Madill06a9d522020-11-04 19:57:27 -050043
44 # Adds run-time checks to filter out EVENT() messages when the debug annotator is disabled.
45 angle_enable_annotator_run_time_checks = false
Corentin Wallez16d4e472017-03-20 13:06:19 -040046}
47
Jamie Madille3c25712019-12-03 14:08:36 -050048if (angle_build_all) {
Frank Henigmand0ef13a2017-08-28 22:53:24 -040049 group("all") {
50 testonly = true
51 deps = [
Jamie Madille3c25712019-12-03 14:08:36 -050052 ":angle",
Frank Henigmand0ef13a2017-08-28 22:53:24 -040053 ":angle_shader_translator",
54 ":translator_fuzzer",
Jamie Madill238c19e2019-02-07 09:09:41 -050055 ":xxhash_fuzzer",
Jamie Madille3c25712019-12-03 14:08:36 -050056 "$angle_root/samples:angle_samples",
57 "$angle_root/src/tests:angle_tests",
Frank Henigmand0ef13a2017-08-28 22:53:24 -040058 ]
59 }
60}
61
Tim Van Pattenc4e0a1e2018-11-28 16:08:11 +000062import("src/compiler.gni")
Tim Van Pattenfdccaa32018-11-01 17:47:10 -060063import("src/libGLESv2.gni")
Brett Wilson04bac602014-07-16 14:19:18 -070064
Brett Wilson2f5469c2014-07-22 17:00:17 -070065# This config is exported to dependent targets (and also applied to internal
66# ones).
67config("external_config") {
Jamie Madilledbc2442016-01-04 11:25:00 -050068 include_dirs = [ "include" ]
Brett Wilson2f5469c2014-07-22 17:00:17 -070069}
70
Jamie Madill4638dc92018-12-17 13:13:49 -050071# Prevent the GL headers from redeclaring ANGLE entry points.
72config("no_gl_prototypes") {
73 defines = [
74 "GL_GLES_PROTOTYPES=0",
75 "EGL_EGL_PROTOTYPES=0",
76 ]
77}
78
79config("gl_prototypes") {
80 defines = [
81 "GL_GLES_PROTOTYPES=1",
82 "EGL_EGL_PROTOTYPES=1",
83 "GL_GLEXT_PROTOTYPES",
84 "EGL_EGLEXT_PROTOTYPES",
85 ]
86}
87
Jamie Madill72f5b5e2014-06-23 15:13:02 -040088# This config is applied to internal Angle targets (not pushed to dependents).
89config("internal_config") {
90 include_dirs = [
91 "include",
92 "src",
93 ]
Jamie Madill80ab03c2017-01-03 11:03:23 -050094
Jamie Madill4638dc92018-12-17 13:13:49 -050095 defines = []
Jamie Madill6de51852017-04-12 09:53:01 -040096
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -060097 if (angle_64bit_current_cpu) {
Yuly Novikovc4f1dd82017-10-25 17:02:29 -040098 defines += [ "ANGLE_IS_64_BIT_CPU" ]
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -060099 } else {
100 defines += [ "ANGLE_IS_32_BIT_CPU" ]
Jamie Madill6de51852017-04-12 09:53:01 -0400101 }
Geoff Langb02fc662018-08-21 09:48:01 -0400102
Manh Nguyendce37b72020-06-21 22:27:06 -0400103 if (is_win) {
104 defines += [ "ANGLE_IS_WIN" ]
Hidehiko Abe90a9cf92020-09-11 02:40:34 +0900105 } else if (is_linux || is_chromeos) {
Manh Nguyendce37b72020-06-21 22:27:06 -0400106 defines += [ "ANGLE_IS_LINUX" ]
107 }
108
Ian Elliotte2ecb2d2020-11-03 19:26:00 -0700109 # Enables debug/trace-related functionality, including logging every GLES/EGL API command to the
110 # "angle_debug.txt" file on desktop. Enables debug markers for AGI, but must also set
111 # angle_enable_annotator_run_time_checks to improve performance.
Tobin Ehlis573f76b2018-05-03 11:10:44 -0600112 if (angle_enable_trace) {
113 defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ]
114 }
Tobin Ehlis93121f32019-10-17 08:18:16 -0600115
Ian Elliotte2ecb2d2020-11-03 19:26:00 -0700116 # When used with angle_enable_trace, enables logging every GLES/EGL API command to Android logcat
117 # Enables debug markers for AGI regardless of run-time checks.
118 if (angle_enable_trace_android_logcat) {
119 defines += [ "ANGLE_ENABLE_TRACE_ANDROID_LOGCAT=1" ]
120 }
121
Tobin Ehlis93121f32019-10-17 08:18:16 -0600122 if (is_chromeos) {
123 defines += [ "ANGLE_PLATFORM_CHROMEOS" ]
124 }
Ethan Leefcef6dc2020-01-24 22:41:35 -0500125
126 if (is_ggp) {
127 defines += [ "__ggp__" ]
128 }
Xiaoxuan Liu61180d02020-10-12 16:40:13 +0800129
130 if (angle_use_vulkan_display) {
Xiaoxuan Liud0f99d52020-12-03 11:06:56 +0800131 defines += [
132 "ANGLE_USE_VULKAN_DISPLAY",
133 "EGL_NO_X11",
134 ]
Xiaoxuan Liu61180d02020-10-12 16:40:13 +0800135 if (angle_vulkan_display_mode == "simple") {
136 defines += [ "ANGLE_VULKAN_DISPLAY_MODE_SIMPLE" ]
137 } else if (angle_vulkan_display_mode == "headless") {
138 defines += [ "ANGLE_VULKAN_DISPLAY_MODE_HEADLESS" ]
139 }
140 }
Alexis Hetuf2a15482020-12-04 14:07:24 -0500141
142 if (is_lsan) {
143 defines += [ "ANGLE_WITH_LSAN" ]
144 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400145}
146
Jamie Madilla9f11bf2019-10-21 08:39:14 -0400147config("constructor_and_destructor_warnings") {
148 if (is_clang) {
149 cflags = [
150 "-Wexit-time-destructors",
151 "-Wglobal-constructors",
152 ]
153 }
154}
155
Jamie Madill509a1d42016-07-18 10:10:29 -0400156config("extra_warnings") {
Ben Wagner211bff32017-10-10 23:53:20 -0400157 cflags = []
Frank Henigmand0ef13a2017-08-28 22:53:24 -0400158
Jamie Madill509a1d42016-07-18 10:10:29 -0400159 # Enable more default warnings on Windows.
160 if (is_win) {
Ben Wagner211bff32017-10-10 23:53:20 -0400161 cflags += [
Jamie Madill509a1d42016-07-18 10:10:29 -0400162 "/we4244", # Conversion: possible loss of data.
Jamie Madill330c8672020-08-28 17:44:13 -0400163 "/we4312", # Conversion: greater size.
Jamie Madill509a1d42016-07-18 10:10:29 -0400164 "/we4456", # Variable shadowing.
Jamie Madill1db8a262016-09-22 13:53:47 -0400165 "/we4458", # declaration hides class member.
Ben Wagner1e064012019-04-12 14:10:17 -0400166 "/we4715", # not all control paths return a value
Geoff Langb9440532017-11-28 13:26:34 -0500167 "/we4800", # forcing value to bool.
168 "/we4838", # narrowing conversion.
Jamie Madill509a1d42016-07-18 10:10:29 -0400169 ]
170 }
Ben Wagner211bff32017-10-10 23:53:20 -0400171 if (is_clang) {
Michael Spang229fc832019-01-21 18:09:15 -0500172 cflags += [
Jamie Madillc7217aa2020-08-28 14:45:14 -0400173 "-Wbad-function-cast",
Jamie Madill155947f2019-10-24 12:55:11 -0400174 "-Wconditional-uninitialized",
Jamie Madill44a0e732019-09-02 13:55:59 -0400175 "-Wextra-semi-stmt",
Jiacheng Lu73e5e9b2019-07-22 15:26:17 -0600176 "-Wfloat-conversion",
Jamie Madill16370a62019-10-24 12:55:11 -0400177 "-Winconsistent-missing-destructor-override",
Jamie Madilla6206852019-10-24 12:55:09 -0400178 "-Wmissing-field-initializers",
Stuart Morgan5dba7232020-06-16 09:29:16 -0700179 "-Wnewline-eof",
Olli Etuaho8073a952018-05-09 16:41:39 +0300180 "-Wnon-virtual-dtor",
Jamie Madill68945f12019-10-24 12:55:09 -0400181 "-Wredundant-parens",
Jamie Madill1ab8b752020-08-28 14:45:15 -0400182 "-Wreturn-std-move-in-c++11",
Jamie Madill859ca032019-10-24 12:55:08 -0400183 "-Wshadow-field",
Jamie Madillfd58d222019-10-24 12:55:07 -0400184 "-Wtautological-type-limit-compare",
Jamie Madillc017cee2019-10-24 12:55:10 -0400185 "-Wundefined-reinterpret-cast",
Jamie Madillc09ae152019-02-01 14:16:32 -0500186 "-Wunneeded-internal-declaration",
Jamie Madill3486ec92020-09-10 17:55:28 -0400187 "-Wweak-template-vtables",
James Darpinianefa898a2019-08-07 17:05:35 -0700188
189 # The below warnings are used by WebKit. We enable them to make rolling
190 # ANGLE in WebKit easier.
191 "-Wparentheses",
192 "-Wrange-loop-analysis",
193 "-Wstrict-prototypes",
194 "-Wunreachable-code",
James Darpinian7e48c9e2019-08-06 17:17:19 -0700195 "-Wshorten-64-to-32",
Nico Weber79de62c2018-01-31 10:47:14 -0500196 ]
James Darpiniandea86292020-12-02 16:26:03 -0800197 if (!use_xcode_clang) {
198 # Mac catalyst uses a clang version that doesn't have these.
199 cflags += [
200 "-Wdeprecated-copy",
201 "-Wsuggest-destructor-override",
202 "-Wsuggest-override",
203 ]
204 }
Ben Wagner211bff32017-10-10 23:53:20 -0400205 }
Austin Kinross11dc1632019-09-18 14:46:23 -0700206
207 if (angle_is_winuwp) {
208 cflags += [ "/wd4447" ] # 'main' signature found without threading model.
209 }
Jamie Madill509a1d42016-07-18 10:10:29 -0400210}
211
Courtney Goeltzenleuchter46071482018-05-15 13:35:15 -0600212# This config adds build-ids to the associated library.
213# -Wl is a special option that indicates that clang should pass the associated
214# option --build-id to the linker. This will cause a build-id section to be added
215# to the associated library. The build-id makes it possible for a debugger to
216# find the right symbol file to use.
217config("build_id_config") {
218 ldflags = [ "-Wl,--build-id" ]
219}
220
Jamie Madill1ba72542019-10-04 15:17:49 -0400221_use_copy_compiler_dll = angle_has_build && is_win && target_cpu != "arm64"
222
Tom Tan5c317532018-11-30 17:01:01 -0800223# Windows ARM64 is available since 10.0.16299 so no need to copy
224# d3dcompiler_47.dll because this file is available as inbox.
Jamie Madill1ba72542019-10-04 15:17:49 -0400225if (_use_copy_compiler_dll) {
Jamie Madilld09546e2019-02-22 10:24:44 -0500226 # We also ship an older DLL for compatiblity with Windows 7 machines without
227 # the UCRT. This DLL isn't available in the standard SDK distribution.
228 _old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll"
229 _has_old_compiler =
230 exec_script("scripts/file_exists.py", [ _old_compiler ], "value")
231
Daniel Bratell73941de2015-02-25 14:34:49 +0100232 copy("copy_compiler_dll") {
Julien Isorce5641d192020-02-04 21:31:47 -0800233 sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ]
Jamie Madilld09546e2019-02-22 10:24:44 -0500234
235 if (_has_old_compiler) {
236 sources += [ _old_compiler ]
237 }
238
Julien Isorce5641d192020-02-04 21:31:47 -0800239 outputs = [ "$root_out_dir/{{source_file_part}}" ]
Daniel Bratell73941de2015-02-25 14:34:49 +0100240 }
Daniel Bratell73941de2015-02-25 14:34:49 +0100241}
242
Jamie Madill55959b02019-03-05 10:07:41 -0500243# Holds the shared includes so we only need to list them once.
Jamie Madillcd4f1fb2019-02-07 15:26:10 -0500244config("includes_config") {
245 include_dirs = [ "include" ]
246}
247
Jamie Madill7098cff2019-01-15 18:33:42 -0500248angle_source_set("includes") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400249 sources = libangle_includes
Jamie Madill8d412db2020-08-29 22:25:18 +0000250 public_configs = [ ":includes_config" ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400251}
252
Jamie Madill7098cff2019-01-15 18:33:42 -0500253angle_static_library("preprocessor") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400254 sources = angle_preprocessor_sources
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400255
Corentin Wallez054f7ed2016-09-20 17:15:59 -0400256 public_deps = [
257 ":angle_common",
Jamie Madill1f08ab22019-10-03 16:22:52 -0400258 ":angle_translator_headers",
Corentin Wallez054f7ed2016-09-20 17:15:59 -0400259 ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400260}
261
Tobin Ehlis5546fb42019-01-17 12:25:54 -0500262config("angle_disable_pool_alloc") {
263 defines = [ "ANGLE_DISABLE_POOL_ALLOC" ]
Jamie Madille5c97ab2014-08-07 12:31:38 -0400264}
265
Cooper Partin75da1972015-06-16 15:03:14 -0700266config("debug_annotations_config") {
Corentin Wallez105bc9d2019-03-06 16:32:40 +0000267 if (is_debug) {
Jamie Madilledbc2442016-01-04 11:25:00 -0500268 defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
Cooper Partin75da1972015-06-16 15:03:14 -0700269 }
Jamie Madill06a9d522020-11-04 19:57:27 -0500270 if (angle_enable_annotator_run_time_checks) {
Ian Elliotte2ecb2d2020-11-03 19:26:00 -0700271 # When used with angle_enable_trace, enables debug markers for AGI with run-time checks to
272 # filter out EVENT() messages when the debug annotator is disabled.
Jamie Madill06a9d522020-11-04 19:57:27 -0500273 defines = [ "ANGLE_ENABLE_ANNOTATOR_RUN_TIME_CHECKS" ]
274 }
Cooper Partin75da1972015-06-16 15:03:14 -0700275}
276
Jamie Madille31fd872016-05-27 08:35:36 -0400277config("angle_release_asserts_config") {
278 if (dcheck_always_on) {
279 defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ]
280 }
281}
282
Jamie Madille2e406c2016-06-02 13:04:10 -0400283config("angle_common_config") {
Jamie Madill5ea762a2017-06-07 14:59:51 -0400284 include_dirs = [ "src/common/third_party/base" ]
Yuly Novikove7624002018-01-27 18:27:07 -0500285 if (is_android) {
286 libs = [ "log" ]
287 }
Jamie Madille2e406c2016-06-02 13:04:10 -0400288}
289
Alexis Hetua20f5b12020-08-18 11:26:50 -0400290# Silences the "indirect call of a function with wrong dynamic type" cfi error
291config("angle_no_cfi_icall") {
292 if (is_cfi && use_cfi_icall && current_toolchain == default_toolchain) {
293 cflags = [ "-fno-sanitize=cfi-icall" ]
294 }
295}
296
297# Silences the "cast from void* or another unrelated type to the wrong dynamic type" cfi error
298config("angle_no_cfi_unrelated_cast") {
299 if (is_cfi && use_cfi_cast && current_toolchain == default_toolchain) {
300 cflags = [ "-fno-sanitize=cfi-unrelated-cast" ]
301 }
302}
303
Jamie Madillc09ae152019-02-01 14:16:32 -0500304angle_source_set("xxhash") {
305 sources = xxhash_sources
Jamie Madill5fde6322020-08-28 14:45:17 -0400306 if (is_clang) {
307 cflags_c = [ "-Wno-implicit-fallthrough" ]
308 }
Jamie Madillc09ae152019-02-01 14:16:32 -0500309}
310
Jamie Madill1ba72542019-10-04 15:17:49 -0400311if (angle_has_build) {
312 fuzzer_test("xxhash_fuzzer") {
Julien Isorce5641d192020-02-04 21:31:47 -0800313 sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ]
314 deps = [ ":xxhash" ]
Jamie Madill1ba72542019-10-04 15:17:49 -0400315 }
Jamie Madill238c19e2019-02-07 09:09:41 -0500316}
317
Jamie Madill7098cff2019-01-15 18:33:42 -0500318angle_static_library("angle_common") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400319 sources = libangle_common_sources
Cooper Partin75da1972015-06-16 15:03:14 -0700320
Jamie Madill562e81b2015-01-14 14:31:02 -0500321 configs += [
Jamie Madille2e406c2016-06-02 13:04:10 -0400322 ":angle_common_config",
Cooper Partin75da1972015-06-16 15:03:14 -0700323 ":debug_annotations_config",
Jamie Madill562e81b2015-01-14 14:31:02 -0500324 ]
Jeremy Roman06feb812016-04-06 16:39:52 -0400325
Julien Isorce5641d192020-02-04 21:31:47 -0800326 deps = [ ":xxhash" ]
Jamie Madillc09ae152019-02-01 14:16:32 -0500327
Yuly Novikov87ae8cd2016-05-19 17:59:55 -0400328 public_deps = [
Tim Van Pattene78d9a62020-07-24 11:58:45 -0600329 ":angle_abseil",
Jamie Madill4638dc92018-12-17 13:13:49 -0500330 ":angle_version",
Jamie Madill8d986bf2018-02-21 08:28:01 -0500331 ":includes",
Yuly Novikov87ae8cd2016-05-19 17:59:55 -0400332 ]
Jamie Madill7098cff2019-01-15 18:33:42 -0500333 public_configs += [ ":angle_common_config" ]
Jamie Madill1ba72542019-10-04 15:17:49 -0400334 if (angle_has_build && use_fuzzing_engine) {
Jamie Madill48aa52f2019-10-17 07:56:53 -0400335 all_dependent_configs = [ ":angle_disable_pool_alloc" ]
Tobin Ehlis5546fb42019-01-17 12:25:54 -0500336 }
Tim Van Pattene99b8bc2020-10-23 18:50:33 -0600337
Jamie Madill95286412020-11-23 15:47:09 -0500338 if (is_linux || is_chromeos) {
339 libs = [ "dl" ]
340 }
341
Tim Van Pattene99b8bc2020-10-23 18:50:33 -0600342 if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
343 # In API level 26 ANativeWindow APIs were moved from libandroid.so
344 # into a separate library, libnativewindow.so
345 if (ndk_api_level_at_least_26) {
346 libs = [ "nativewindow" ]
347 } else {
348 libs = [ "android" ]
349 }
350 }
Jamie Madill562e81b2015-01-14 14:31:02 -0500351}
352
Geoff Lang6e4cfce2016-06-13 15:06:31 -0400353config("angle_image_util_config") {
354 include_dirs = [
355 "include",
356 "src",
357 ]
358}
359
Jamie Madill1f08ab22019-10-03 16:22:52 -0400360angle_source_set("angle_image_util_headers") {
361 sources = libangle_image_util_headers
Julien Isorce5641d192020-02-04 21:31:47 -0800362 public_deps = [ ":angle_common" ]
Jamie Madill1f08ab22019-10-03 16:22:52 -0400363}
364
Jamie Madill7098cff2019-01-15 18:33:42 -0500365angle_static_library("angle_image_util") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400366 sources = libangle_image_util_sources
Jamie Madill7098cff2019-01-15 18:33:42 -0500367 public_configs += [ ":angle_image_util_config" ]
Julien Isorce5641d192020-02-04 21:31:47 -0800368 public_deps = [ ":angle_image_util_headers" ]
Geoff Lang6e4cfce2016-06-13 15:06:31 -0400369}
370
Courtney Goeltzenleuchter7d81ae72018-10-08 19:25:19 -0600371config("angle_gl_visibility_config") {
372 if (is_win) {
373 defines = [
374 "GL_APICALL=",
375 "GL_API=",
376 ]
377 } else {
378 defines = [
379 "GL_APICALL=__attribute__((visibility(\"default\")))",
380 "GL_API=__attribute__((visibility(\"default\")))",
381 ]
Courtney Goeltzenleuchtere7ece9e2018-10-08 16:43:43 -0600382 }
Ian Elliottabcb2b32018-08-29 17:04:15 -0600383}
384
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500385config("angle_gpu_info_util_config") {
386 include_dirs = [
387 "include",
388 "src",
389 ]
390}
391
Jamie Madill7098cff2019-01-15 18:33:42 -0500392angle_static_library("angle_gpu_info_util") {
Jonah Ryan-Davis66e48502019-04-25 10:49:05 -0400393 public_configs += [
394 ":angle_gpu_info_util_config",
395 ":angle_backend_config",
396 ]
Julien Isorce5641d192020-02-04 21:31:47 -0800397 public_deps = [ ":angle_common" ]
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400398 sources = libangle_gpu_info_util_sources
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500399 deps = []
400 libs = []
401 defines = []
402
Jamie Madillb09f16e2020-10-01 10:02:07 -0400403 if (!is_chromeos && angle_has_build) {
Michael Spangb630bf92020-01-24 17:27:01 -0500404 sources += libangle_gpu_info_util_vulkan_sources
Jamie Madill4798c8c2020-12-14 16:35:27 -0500405 deps += [ "$angle_vulkan_headers_dir:vulkan_headers" ]
Michael Spangb630bf92020-01-24 17:27:01 -0500406 }
407
Ian Elliottd07c52e2018-06-22 15:42:09 -0600408 if (is_android) {
Michael Spangb630bf92020-01-24 17:27:01 -0500409 sources += libangle_gpu_info_util_android_sources
410 }
411
412 if (is_fuchsia) {
413 sources += libangle_gpu_info_util_fuchsia_sources
Antonio Maiorano13816d22020-06-16 14:27:04 -0400414 deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ]
Ian Elliottd07c52e2018-06-22 15:42:09 -0600415 }
416
Corentin Wallez8f77e5d2017-03-24 11:58:59 -0700417 if (is_win) {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400418 sources += libangle_gpu_info_util_win_sources
Austin Kinross11dc1632019-09-18 14:46:23 -0700419 if (!angle_is_winuwp) {
420 libs += [ "setupapi.lib" ]
421 }
Jonah Ryan-Davis66e48502019-04-25 10:49:05 -0400422 libs += [ "dxgi.lib" ]
Corentin Wallez8f77e5d2017-03-24 11:58:59 -0700423 }
424
Hidehiko Abe90a9cf92020-09-11 02:40:34 +0900425 if (is_linux || is_chromeos) {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400426 sources += libangle_gpu_info_util_linux_sources
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500427
Jamie Madill8970ad32020-08-26 12:59:19 -0400428 if (angle_use_x11 && angle_has_build) {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400429 sources += libangle_gpu_info_util_x11_sources
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500430 deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
431 defines += [ "GPU_INFO_USE_X11" ]
432 libs += [
433 "X11",
434 "Xi",
435 "Xext",
436 ]
437 }
438 }
439
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500440 if (use_libpci) {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400441 sources += libangle_gpu_info_util_libpci_sources
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500442 defines += [ "GPU_INFO_USE_LIBPCI" ]
443 libs += [ "pci" ]
444 }
Corentin Wallezd83f64f2017-02-16 10:58:46 -0500445
Shahbaz Youssefi5b8dec52021-01-12 04:11:56 +0000446 if (is_apple) {
Sylvain Defresnebae95f82020-07-02 17:19:14 +0200447 frameworks = [
Corentin Wallezd83f64f2017-02-16 10:58:46 -0500448 "IOKit.framework",
449 "CoreFoundation.framework",
Corentin Wallez163965d2017-10-11 11:38:55 -0400450 "CoreGraphics.framework",
Corentin Wallezd83f64f2017-02-16 10:58:46 -0500451 ]
James Darpiniandea86292020-12-02 16:26:03 -0800452 if (angle_enable_eagl) {
453 frameworks += [ "OpenGLES.framework" ]
454 } else if (angle_enable_cgl) {
455 frameworks += [ "OpenGL.framework" ]
456 }
457 if (is_mac || angle_enable_cgl) {
458 sources += libangle_gpu_info_util_mac_sources
459 }
460 if (is_ios && !angle_enable_cgl) {
461 sources += libangle_gpu_info_util_ios_sources
462 }
Corentin Wallezd83f64f2017-02-16 10:58:46 -0500463 }
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500464}
465
Jamie Madill1f08ab22019-10-03 16:22:52 -0400466angle_source_set("angle_translator_headers") {
467 sources = angle_translator_exported_headers
Julien Isorce5641d192020-02-04 21:31:47 -0800468 public_deps = [ ":includes" ]
Jamie Madill1f08ab22019-10-03 16:22:52 -0400469}
470
Jamie Madill7098cff2019-01-15 18:33:42 -0500471angle_static_library("translator") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400472 sources = angle_translator_sources
Austin Kinross82b5ab62015-12-11 09:30:15 -0800473 defines = []
474
Shahbaz Youssefi382bf282020-12-24 23:56:39 -0500475 _needs_glsl_base = false
476 needs_glsl_and_vulkan_base = false
477
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700478 if (angle_enable_essl || use_fuzzing_engine) {
Shahbaz Youssefi382bf282020-12-24 23:56:39 -0500479 _needs_glsl_base = true
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400480 sources += angle_translator_essl_sources
Austin Kinross82b5ab62015-12-11 09:30:15 -0800481 defines += [ "ANGLE_ENABLE_ESSL" ]
482 }
483
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700484 if (angle_enable_glsl || use_fuzzing_engine) {
Shahbaz Youssefi382bf282020-12-24 23:56:39 -0500485 _needs_glsl_base = true
486 needs_glsl_and_vulkan_base = true
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400487 sources += angle_translator_glsl_sources
Shahbaz Youssefi5b8dec52021-01-12 04:11:56 +0000488 if (is_apple) {
Shahbaz Youssefi382bf282020-12-24 23:56:39 -0500489 sources += angle_translator_glsl_mac_sources
490 }
Austin Kinross82b5ab62015-12-11 09:30:15 -0800491 defines += [ "ANGLE_ENABLE_GLSL" ]
492 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400493
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700494 if (angle_enable_hlsl || use_fuzzing_engine) {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400495 sources += angle_translator_hlsl_sources
Austin Kinross82b5ab62015-12-11 09:30:15 -0800496 defines += [ "ANGLE_ENABLE_HLSL" ]
Daniel Bratell73941de2015-02-25 14:34:49 +0100497 }
Jamie Madille794cd82017-01-13 17:29:51 -0500498
Le Quyend200a772019-10-10 00:44:01 +0800499 if (angle_enable_vulkan || use_fuzzing_engine || angle_enable_metal) {
Shahbaz Youssefi382bf282020-12-24 23:56:39 -0500500 _needs_glsl_base = true
501 needs_glsl_and_vulkan_base = true
502
Le Quyend200a772019-10-10 00:44:01 +0800503 # This translator is needed by metal backend also.
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400504 sources += angle_translator_lib_vulkan_sources
Le Quyend200a772019-10-10 00:44:01 +0800505 }
506
Shahbaz Youssefi382bf282020-12-24 23:56:39 -0500507 if (_needs_glsl_base) {
508 sources += angle_translator_glsl_base_sources
509 }
510 if (needs_glsl_and_vulkan_base) {
511 sources += angle_translator_glsl_and_vulkan_base_sources
512 }
513
Le Quyend200a772019-10-10 00:44:01 +0800514 if (angle_enable_vulkan || use_fuzzing_engine) {
Jamie Madille794cd82017-01-13 17:29:51 -0500515 defines += [ "ANGLE_ENABLE_VULKAN" ]
516 }
517
Le Quyend200a772019-10-10 00:44:01 +0800518 if (angle_enable_metal) {
519 sources += angle_translator_lib_metal_sources
520 defines += [ "ANGLE_ENABLE_METAL" ]
521 }
522
Jonah Ryan-Davis5afd5ec2019-10-25 10:53:40 -0600523 if (angle_enable_swiftshader) {
524 defines += [ "ANGLE_ENABLE_SWIFTSHADER" ]
525 }
526
Jamie Madill7098cff2019-01-15 18:33:42 -0500527 public_configs += [ ":external_config" ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400528
529 deps = [
530 ":includes",
531 ":preprocessor",
532 ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500533
534 public_deps = [
535 ":angle_common",
Jamie Madill1f08ab22019-10-03 16:22:52 -0400536 ":angle_translator_headers",
Jamie Madill562e81b2015-01-14 14:31:02 -0500537 ]
Jamie Madilla8503ce2016-07-18 13:47:12 -0400538
539 if (is_win) {
540 # Necessary to suppress some system header xtree warnigns in Release.
541 # For some reason this warning doesn't get triggered in Chromium
542 cflags = [ "/wd4718" ]
543 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400544}
545
Jamie Madill7098cff2019-01-15 18:33:42 -0500546angle_source_set("translator_fuzzer") {
Julien Isorce5641d192020-02-04 21:31:47 -0800547 sources = [ "src/compiler/fuzz/translator_fuzzer.cpp" ]
Corentin Wallez28b65282016-06-16 07:24:50 -0700548
549 include_dirs = [
550 "include",
551 "src",
552 ]
553
Julien Isorce5641d192020-02-04 21:31:47 -0800554 deps = [ ":translator" ]
Corentin Wallez28b65282016-06-16 07:24:50 -0700555}
556
Jamie Madill62778cb2020-09-22 23:10:04 -0400557config("angle_commit_id_config") {
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400558 include_dirs = [ "$root_gen_dir/angle" ]
Jamie Madill62778cb2020-09-22 23:10:04 -0400559 visibility = [ ":angle_commit_id" ]
Jamie Madill720ca442018-12-17 14:04:10 -0500560}
561
Jamie Madill62778cb2020-09-22 23:10:04 -0400562_commit_id_output_file = "$root_gen_dir/angle/angle_commit.h"
563action("angle_commit_id") {
Geoff Langba8ef682020-02-24 14:13:40 -0500564 script = "src/commit_id.py"
Jamie Madill62778cb2020-09-22 23:10:04 -0400565 outputs = [ _commit_id_output_file ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400566
Geoff Langba8ef682020-02-24 14:13:40 -0500567 # Add git as a dependency if it is available.
Geoff Lang20c69732020-03-06 11:02:31 -0500568 if (angle_enable_commit_id &&
569 exec_script("src/commit_id.py", [ "check" ], "value") == 1) {
Geoff Langdd19d552020-03-02 09:41:22 -0500570 # commit id should depend on angle's HEAD revision
571 inputs = [ ".git/HEAD" ]
Jamie Madill5f2ba632020-08-15 23:50:59 -0400572 branch = read_file(".git/HEAD", "string")
573 result = string_split(branch)
574 if (result[0] == "ref:") {
575 inputs += [ ".git/" + result[1] ]
576 }
Tomasz Moniuszko319fb8982015-07-30 14:34:54 +0200577 }
Geoff Langba8ef682020-02-24 14:13:40 -0500578
579 args = [
580 "gen",
Jamie Madill62778cb2020-09-22 23:10:04 -0400581 rebase_path(_commit_id_output_file, root_build_dir),
Geoff Langba8ef682020-02-24 14:13:40 -0500582 ]
583
Jamie Madill62778cb2020-09-22 23:10:04 -0400584 public_configs = [ ":angle_commit_id_config" ]
585}
586
587# TODO(jmadill): Remove this. http://b/168736059
588group("commit_id") {
589 data_deps = [ ":angle_commit_id" ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400590}
591
Jamie Madill7098cff2019-01-15 18:33:42 -0500592angle_source_set("angle_version") {
Jamie Madill62778cb2020-09-22 23:10:04 -0400593 # TODO(jmadill): Remove version.h. http://b/168736059
594 sources = [
595 "src/common/angle_version.h",
596 "src/common/version.h",
597 ]
598 public_deps = [ ":angle_commit_id" ]
Jamie Madill4638dc92018-12-17 13:13:49 -0500599}
600
Jonah Ryan-Davis66e48502019-04-25 10:49:05 -0400601config("angle_backend_config") {
Jamie Madill562e81b2015-01-14 14:31:02 -0500602 defines = []
Jonah Ryan-Davis66e48502019-04-25 10:49:05 -0400603
Etienne Bergeron9e83c152020-06-04 19:53:36 -0400604 if (angle_delegate_workers) {
605 defines += [ "ANGLE_DELEGATE_WORKERS" ]
606 }
Jamie Madill1f08ab22019-10-03 16:22:52 -0400607
Jonah Ryan-Davis5afd5ec2019-10-25 10:53:40 -0600608 configs = []
609
Jamie Madillbb96aef2020-09-11 13:50:09 -0400610 if (angle_enable_d3d11) {
611 configs += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend_config" ]
Trevor David Black192a0142020-10-08 16:47:35 -0700612 defines += [ "ANGLE_FORCE_CONTEXT_CHECK_EVERY_CALL=1" ]
Jamie Madillbb96aef2020-09-11 13:50:09 -0400613 }
614
615 if (angle_enable_d3d9) {
616 configs += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend_config" ]
617 }
618
Jamie Madill2d741702020-09-11 12:30:04 -0400619 if (angle_enable_gl) {
620 configs += [ "src/libANGLE/renderer/gl:angle_gl_backend_config" ]
621 }
622
Jamie Madill852f61f2020-09-11 11:54:35 -0400623 if (angle_enable_null) {
624 configs += [ "src/libANGLE/renderer/null:angle_null_backend_config" ]
625 }
626
Le Quyend200a772019-10-10 00:44:01 +0800627 if (angle_enable_metal) {
Jonah Ryan-Davis5afd5ec2019-10-25 10:53:40 -0600628 configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ]
Le Quyend200a772019-10-10 00:44:01 +0800629 }
630
Jamie Madill1f08ab22019-10-03 16:22:52 -0400631 if (angle_enable_vulkan) {
Jonah Ryan-Davis5afd5ec2019-10-25 10:53:40 -0600632 configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ]
Jamie Madill1f08ab22019-10-03 16:22:52 -0400633 }
Jonah Ryan-Davis66e48502019-04-25 10:49:05 -0400634}
635
636config("libANGLE_config") {
637 cflags = []
638 defines = []
639 libs = []
640 ldflags = []
Jamie Madill80ab03c2017-01-03 11:03:23 -0500641 defines += [ "LIBANGLE_IMPLEMENTATION" ]
Corentin Wallezbeb81582015-09-02 10:30:55 -0400642
643 if (is_win) {
Julien Isorce5641d192020-02-04 21:31:47 -0800644 cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics
645 # are not enabled.
Austin Kinross40853472015-02-12 10:39:56 -0800646 }
Yuly Novikovb29fccf2018-11-28 10:09:39 -0500647
648 if (is_android && (angle_enable_gl || angle_enable_vulkan)) {
Yuly Novikov8edc68e2019-02-12 12:41:01 -0500649 # In API level 26 ANativeWindow APIs were moved from libandroid.so
650 # into a separate library, libnativewindow.so
651 if (ndk_api_level_at_least_26) {
Yuly Novikovb29fccf2018-11-28 10:09:39 -0500652 libs += [ "nativewindow" ]
653 } else {
654 libs += [ "android" ]
655 }
656 }
Michael Spang7cd5f642019-08-21 20:03:49 -0400657
Ethan Leed22b8be2019-11-15 12:26:39 -0500658 if (angle_use_x11) {
Michael Spang7cd5f642019-08-21 20:03:49 -0400659 defines += [ "ANGLE_USE_X11" ]
660 }
Jamie Madillaf5e3822020-01-28 10:05:36 -0500661
662 if (angle_enable_overlay) {
663 defines += [ "ANGLE_ENABLE_OVERLAY=1" ]
664 }
Tim Van Pattenee4e0862020-09-24 11:39:49 -0600665 if (angle_enable_perf_counter_output) {
666 defines += [ "ANGLE_ENABLE_PERF_COUNTER_OUTPUT=1" ]
667 }
Jamie Madill562e81b2015-01-14 14:31:02 -0500668}
Geoff Lang2b5420c2014-11-19 14:20:15 -0500669
Jamie Madill1f08ab22019-10-03 16:22:52 -0400670angle_source_set("libANGLE_headers") {
671 sources = libangle_headers
672 public_deps = [
673 ":angle_common",
674 ":angle_translator_headers",
675 ]
Jamie Madillaf5e3822020-01-28 10:05:36 -0500676 public_configs += [ ":libANGLE_config" ]
Jamie Madillb62a1c22018-02-06 09:54:02 -0500677}
678
Jamie Madill2f718022019-10-28 11:48:46 -0400679# Don't even try to build glslang if Metal and Vulkan are disabled.
680if (angle_enable_vulkan || angle_enable_metal) {
681 angle_source_set("angle_glslang_wrapper") {
682 sources = [
683 "src/libANGLE/renderer/glslang_wrapper_utils.cpp",
684 "src/libANGLE/renderer/glslang_wrapper_utils.h",
685 ]
686 deps = [
687 ":libANGLE_headers",
688 "${angle_glslang_dir}:glslang_default_resource_limits_sources",
Shahbaz Youssefib291ad02020-07-03 23:53:10 -0400689 "${angle_glslang_dir}:glslang_lib_sources",
Shahbaz Youssefi71e6afb2020-01-14 14:12:31 -0500690 "${angle_spirv_headers_dir}:spv_headers",
691 "${angle_spirv_tools_dir}:spvtools_headers",
Jamie Madill2f718022019-10-28 11:48:46 -0400692 ]
693 }
Le Quyena48f95a2019-10-14 14:49:49 +0800694}
695
Jamie Madill4d3a0f62020-09-11 12:36:05 -0400696if (is_win) {
697 angle_source_set("angle_d3d_format_tables") {
698 sources = [
699 "src/libANGLE/renderer/dxgi_format_map.h",
700 "src/libANGLE/renderer/dxgi_format_map_autogen.cpp",
701 "src/libANGLE/renderer/dxgi_support_table.h",
702 "src/libANGLE/renderer/dxgi_support_table_autogen.cpp",
703 ]
704
705 if (!angle_is_winuwp) {
706 sources += [
707 "src/libANGLE/renderer/d3d_format.cpp",
708 "src/libANGLE/renderer/d3d_format.h",
709 ]
710 }
711
712 public_deps = [ ":libANGLE_headers" ]
713 configs += [ ":angle_backend_config" ]
714 }
715}
716
Jamie Madilleb1b1642019-07-30 17:22:17 -0400717angle_source_set("libANGLE_base") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -0400718 sources = libangle_sources
Geoff Lang2b5420c2014-11-19 14:20:15 -0500719
Jamie Madill5ea762a2017-06-07 14:59:51 -0400720 include_dirs = []
Jamie Madill562e81b2015-01-14 14:31:02 -0500721 libs = []
Corentin Wallez64598b52016-11-11 08:25:44 -0500722 defines = []
Frank Henigmane42ec182017-12-11 23:58:53 -0500723 if (angle_link_glx) {
724 libs += [ "GL" ]
725 defines += [ "ANGLE_LINK_GLX" ]
726 }
Jamie Madille2e406c2016-06-02 13:04:10 -0400727 public_deps = [
Corentin Wallezcc068e92016-02-29 16:37:04 -0500728 ":angle_common",
Jamie Madill720ca442018-12-17 14:04:10 -0500729 ":angle_gpu_info_util",
Jamie Madill4638dc92018-12-17 13:13:49 -0500730 ":angle_version",
Jamie Madill1f08ab22019-10-03 16:22:52 -0400731 ":libANGLE_headers",
Jamie Madill720ca442018-12-17 14:04:10 -0500732 ":translator",
Jamie Madille2e406c2016-06-02 13:04:10 -0400733 ]
734 deps = [
Tim Van Pattenb55f0f72020-06-02 18:01:24 -0600735 ":angle_compression",
Corentin Wallez878baf92017-02-15 13:57:16 -0500736 ":angle_image_util",
Corentin Wallezcc068e92016-02-29 16:37:04 -0500737 ":includes",
Corentin Wallezcc068e92016-02-29 16:37:04 -0500738 ]
739
Austin Eng0739f072021-01-19 23:54:20 +0000740 if (is_win) {
Jamie Madille55374f2019-10-24 12:55:12 -0400741 libs += [
Jamie Madille55374f2019-10-24 12:55:12 -0400742 "gdi32.lib",
743 "user32.lib",
744 ]
745 }
746
Jamie Madillbb96aef2020-09-11 13:50:09 -0400747 if (angle_enable_d3d11) {
748 public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend" ]
749 }
750
751 if (angle_enable_d3d9) {
752 public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend" ]
753 }
754
Jamie Madill2d741702020-09-11 12:30:04 -0400755 if (angle_enable_gl) {
756 public_deps += [ "src/libANGLE/renderer/gl:angle_gl_backend" ]
757 }
758
Jamie Madill852f61f2020-09-11 11:54:35 -0400759 if (angle_enable_null) {
760 public_deps += [ "src/libANGLE/renderer/null:angle_null_backend" ]
761 }
762
Jamie Madill1f08ab22019-10-03 16:22:52 -0400763 if (angle_enable_vulkan) {
764 public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ]
765 }
766
Le Quyend200a772019-10-10 00:44:01 +0800767 if (angle_enable_metal) {
768 public_deps += [ "src/libANGLE/renderer/metal:angle_metal_backend" ]
769 }
770
Jamie Madillab2bfa82019-01-15 19:06:47 -0500771 # Enable extra Chromium style warnings for libANGLE.
James Darpiniandea86292020-12-02 16:26:03 -0800772 if (is_clang && angle_has_build && !use_xcode_clang) {
Jamie Madillab2bfa82019-01-15 19:06:47 -0500773 suppressed_configs -= [ "//build/config/clang:find_bad_constructs" ]
774 }
775
Shahbaz Youssefi5b8dec52021-01-12 04:11:56 +0000776 if (is_apple) {
Geoff Langecd2e3b2019-07-09 15:39:39 -0400777 sources += libangle_mac_sources
778 }
779
Jamie Madill562e81b2015-01-14 14:31:02 -0500780 if (is_debug) {
Jamie Madilledbc2442016-01-04 11:25:00 -0500781 defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400782 }
783
Jamie Madill7098cff2019-01-15 18:33:42 -0500784 configs += [ ":debug_annotations_config" ]
Jonah Ryan-Davis66e48502019-04-25 10:49:05 -0400785 public_configs += [
786 ":libANGLE_config",
787 ":angle_backend_config",
788 ]
Jamie Madill80ab03c2017-01-03 11:03:23 -0500789
Tom Tan5c317532018-11-30 17:01:01 -0800790 # Windows ARM64 is available since 10.0.16299 so no need to copy
791 # d3dcompiler_47.dll because this file is available as inbox.
Jamie Madill1ba72542019-10-04 15:17:49 -0400792 if (_use_copy_compiler_dll) {
Julien Isorce5641d192020-02-04 21:31:47 -0800793 data_deps = [ ":copy_compiler_dll" ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500794 }
795}
796
Jamie Madilleb1b1642019-07-30 17:22:17 -0400797config("angle_frame_capture_disabled") {
798 defines = [ "ANGLE_CAPTURE_ENABLED=0" ]
799}
800
801config("angle_frame_capture_enabled") {
802 defines = [ "ANGLE_CAPTURE_ENABLED=1" ]
803}
804
805angle_source_set("libANGLE") {
Julien Isorce5641d192020-02-04 21:31:47 -0800806 public_deps = [ ":libANGLE_base" ]
Jamie Madilleb1b1642019-07-30 17:22:17 -0400807 public_configs = [ ":angle_frame_capture_disabled" ]
Julien Isorce5641d192020-02-04 21:31:47 -0800808 sources = [ "src/libANGLE/FrameCapture_mock.cpp" ]
Jiacheng Lu9e14a192019-08-09 10:03:24 -0600809
810 # gl_enum_utils defaults included in with_capture build
Jamie Madill8d412db2020-08-29 22:25:18 +0000811 deps = []
Jiacheng Lu9e14a192019-08-09 10:03:24 -0600812 if (angle_enable_trace || is_debug) {
Brandon Schade5cfab192019-10-28 09:12:53 -0700813 deps += [ ":angle_gl_enum_utils" ]
Jiacheng Lu9e14a192019-08-09 10:03:24 -0600814 }
Jamie Madilleb1b1642019-07-30 17:22:17 -0400815}
816
Brandon Schade5cfab192019-10-28 09:12:53 -0700817angle_source_set("angle_gl_enum_utils") {
Julien Isorce5641d192020-02-04 21:31:47 -0800818 public_deps = [ ":libANGLE_base" ]
Brandon Schade5cfab192019-10-28 09:12:53 -0700819 sources = [
820 "src/libANGLE/gl_enum_utils.cpp",
821 "src/libANGLE/gl_enum_utils_autogen.cpp",
822 ]
823}
824
Tim Van Pattene78d9a62020-07-24 11:58:45 -0600825if (!defined(angle_abseil_cpp_dir)) {
826 angle_abseil_cpp_dir = "//third_party/abseil-cpp"
827}
828
829config("angle_abseil_config") {
Tim Van Pattenec42b142020-09-28 10:15:46 -0600830 if (angle_enable_abseil) {
831 defines = [ "ANGLE_USE_ABSEIL" ]
Tim Van Pattene78d9a62020-07-24 11:58:45 -0600832
Tim Van Pattenec42b142020-09-28 10:15:46 -0600833 configs = [
834 "$angle_abseil_cpp_dir:absl_define_config",
835 "$angle_abseil_cpp_dir:absl_include_config",
836 ]
837 }
Tim Van Pattene78d9a62020-07-24 11:58:45 -0600838}
839
840group("angle_abseil") {
Tim Van Pattenec42b142020-09-28 10:15:46 -0600841 if (angle_enable_abseil) {
842 # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
843 # we can be more specific when building standalone ANGLE.
Tim Van Patten36f04642020-10-08 14:45:51 -0600844 if (build_with_chromium || is_component_build) {
Tim Van Pattenec42b142020-09-28 10:15:46 -0600845 public_deps = [ "$angle_abseil_cpp_dir:absl" ]
846 } else {
847 public_deps = [ "$angle_abseil_cpp_dir/absl/container:flat_hash_map" ]
848 }
Tim Van Pattene78d9a62020-07-24 11:58:45 -0600849
Tim Van Pattenec42b142020-09-28 10:15:46 -0600850 public_configs = [ ":angle_abseil_config" ]
851 }
Tim Van Pattene78d9a62020-07-24 11:58:45 -0600852}
853
Jamie Madill7e453a22020-03-15 22:11:03 -0400854config("angle_compression_config") {
855 include_dirs = [ "//third_party/zlib/google" ]
856}
857
858group("angle_compression") {
859 public_configs = [
860 ":angle_compression_config",
861 "//third_party/zlib:zlib_config",
862 ]
Jamie Madill35d3c412020-08-26 12:59:18 -0400863 public_deps =
864 [ "$angle_zlib_compression_utils_dir:compression_utils_portable" ]
Jamie Madill7e453a22020-03-15 22:11:03 -0400865}
866
Jamie Madill612b7412019-07-05 11:13:30 -0400867angle_source_set("libANGLE_with_capture") {
Julien Isorce5641d192020-02-04 21:31:47 -0800868 public_deps = [ ":libANGLE_base" ]
Jamie Madill7e453a22020-03-15 22:11:03 -0400869 deps = [ ":angle_compression" ]
Jamie Madilleb1b1642019-07-30 17:22:17 -0400870 public_configs = [ ":angle_frame_capture_enabled" ]
Jamie Madill612b7412019-07-05 11:13:30 -0400871 sources = libangle_capture_sources
872}
873
Robert Sesekdb8ae832016-06-21 11:47:03 -0400874config("shared_library_public_config") {
James Darpinian0dbe7cd2020-12-08 12:24:35 -0800875 if (is_mac && !is_component_build) {
Robert Sesekdb8ae832016-06-21 11:47:03 -0400876 # Executable targets that depend on the shared libraries below need to have
877 # the rpath setup in non-component build configurations.
Jamie Madilla8503ce2016-07-18 13:47:12 -0400878 ldflags = [
879 "-rpath",
880 "@executable_path/",
881 ]
Jonah Ryan-Davis90a8af32020-03-05 13:48:47 -0500882 if (build_with_chromium) {
883 ldflags += [
884 # Path for loading shared libraries for unbundled binaries.
885 # From //build/config/mac/BUILD.gn, this is only added for
886 # component builds. However, since ANGLE always dynamically
887 # links to libvulkan, it should be re-added for non-component
888 # builds. (anglebug.com/4455)
889 "-Wl,-rpath,@loader_path/.",
890 ]
891 }
Robert Sesekdb8ae832016-06-21 11:47:03 -0400892 }
Josh Matthews732c9d02019-11-29 13:59:03 -0500893
894 if (angle_is_winuwp) {
895 ldflags = [
896 "/APPCONTAINER",
897
898 # Disable warning about invalid subsystem number.
899 # A default appropriate subsystem is selected automatically.
900 "/IGNORE:4010",
901 ]
902 }
Robert Sesekdb8ae832016-06-21 11:47:03 -0400903}
904
Jamie Madill4638dc92018-12-17 13:13:49 -0500905config("library_name_config") {
Yuly Novikov8b8dc562020-02-26 19:09:31 -0500906 if (is_component_build && is_android) {
907 defines = [
908 "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}.cr\"",
909 "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}.cr\"",
910 ]
911 } else {
912 defines = [
913 "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"",
914 "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"",
915 ]
916 }
Jamie Madill4638dc92018-12-17 13:13:49 -0500917}
918
Jamie Madill80ab03c2017-01-03 11:03:23 -0500919# This config controls export definitions on ANGLE API calls.
920config("angle_static") {
921 defines = [
922 "ANGLE_EXPORT=",
Jamie Madillba319ba2018-12-29 10:29:33 -0500923 "ANGLE_UTIL_EXPORT=",
Jamie Madill80ab03c2017-01-03 11:03:23 -0500924 "EGLAPI=",
925 "GL_APICALL=",
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500926 "GL_API=",
Jamie Madill80ab03c2017-01-03 11:03:23 -0500927 ]
928}
929
Jamie Madilleb1b1642019-07-30 17:22:17 -0400930set_defaults("angle_libGLESv2") {
931 sources = []
932 output_name = "libGLESv2"
933}
934
Jamie Madill612b7412019-07-05 11:13:30 -0400935template("angle_libGLESv2") {
936 angle_shared_library(target_name) {
Jamie Madilleb1b1642019-07-30 17:22:17 -0400937 sources = libglesv2_sources + invoker.sources
Jamie Madill562e81b2015-01-14 14:31:02 -0500938
Jamie Madill612b7412019-07-05 11:13:30 -0400939 if (is_win) {
Jamie Madilleb1b1642019-07-30 17:22:17 -0400940 sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ]
Jamie Madill612b7412019-07-05 11:13:30 -0400941 }
942
Jamie Madilleb1b1642019-07-30 17:22:17 -0400943 output_name = "${invoker.output_name}${angle_libs_suffix}"
944
Jamie Madill612b7412019-07-05 11:13:30 -0400945 configs += [
946 ":angle_gl_visibility_config",
947 ":debug_annotations_config",
948 ":gl_prototypes",
949 ]
950
Jamie Madilleb1b1642019-07-30 17:22:17 -0400951 defines = [ "LIBGLESV2_IMPLEMENTATION" ]
Jamie Madill612b7412019-07-05 11:13:30 -0400952
Jamie Madilleb1b1642019-07-30 17:22:17 -0400953 deps = invoker.deps + [ ":includes" ]
Jamie Madill612b7412019-07-05 11:13:30 -0400954
Julien Isorce5641d192020-02-04 21:31:47 -0800955 public_deps = [ ":angle_version" ]
Geoff Lang2b5420c2014-11-19 14:20:15 -0500956 }
Jamie Madill612b7412019-07-05 11:13:30 -0400957}
John Abd-El-Malek657cd682014-11-05 14:04:19 -0800958
Jamie Madill612b7412019-07-05 11:13:30 -0400959angle_libGLESv2("libGLESv2") {
Jamie Madilleb1b1642019-07-30 17:22:17 -0400960 if (angle_with_capture_by_default) {
Julien Isorce5641d192020-02-04 21:31:47 -0800961 deps = [ ":libANGLE_with_capture" ]
Jiacheng Lu617f23d2019-08-12 10:11:53 -0600962 } else {
Julien Isorce5641d192020-02-04 21:31:47 -0800963 deps = [ ":libANGLE" ]
Jamie Madilleb1b1642019-07-30 17:22:17 -0400964 }
Jamie Madill612b7412019-07-05 11:13:30 -0400965}
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400966
Jiacheng Lu617f23d2019-08-12 10:11:53 -0600967# Output capture lib when `angle_with_capture_by_default` disabled, vice versa.
968angle_libGLESv2("libGLESv2_capture_complement") {
969 if (angle_with_capture_by_default) {
Julien Isorce5641d192020-02-04 21:31:47 -0800970 deps = [ ":libANGLE" ]
Jiacheng Lu617f23d2019-08-12 10:11:53 -0600971 output_name += "_no_capture"
972 } else {
Julien Isorce5641d192020-02-04 21:31:47 -0800973 deps = [ ":libANGLE_with_capture" ]
Jiacheng Lu617f23d2019-08-12 10:11:53 -0600974 output_name += "_with_capture"
Jamie Madilleb1b1642019-07-30 17:22:17 -0400975 }
Jamie Madill80ab03c2017-01-03 11:03:23 -0500976}
977
Austin Kinross11dc1632019-09-18 14:46:23 -0700978if (is_win && !angle_is_winuwp) {
Clemen Dengcb8b4a52019-07-04 16:05:25 -0400979 angle_shared_library("libGL") {
980 sources = libgl_sources
Clemen Deng663b0482019-07-11 12:37:35 -0400981
Clemen Deng6e7dd1e2019-07-16 13:41:59 -0400982 output_name = "openGL32"
983 output_dir = "$root_out_dir/angle_libs"
Clemen Deng7558e832019-06-18 13:02:03 -0400984
985 configs += [
986 ":angle_gl_visibility_config",
987 ":debug_annotations_config",
988 ":gl_prototypes",
989 ]
990
Jamie Madill612b7412019-07-05 11:13:30 -0400991 defines = [
992 "ANGLE_CAPTURE_ENABLED=0",
Clemen Dengcb8b4a52019-07-04 16:05:25 -0400993 "LIBGL_IMPLEMENTATION",
Jamie Madill612b7412019-07-05 11:13:30 -0400994 ]
Clemen Deng7558e832019-06-18 13:02:03 -0400995
996 deps = [
997 ":includes",
998 ":libANGLE",
999 ]
1000
Julien Isorce5641d192020-02-04 21:31:47 -08001001 public_deps = [ ":angle_version" ]
Clemen Deng7558e832019-06-18 13:02:03 -04001002 }
1003}
1004
Jamie Madill7098cff2019-01-15 18:33:42 -05001005angle_static_library("libGLESv2_static") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -04001006 sources = libglesv2_sources
Jamie Madill7098cff2019-01-15 18:33:42 -05001007 configs += [ ":debug_annotations_config" ]
1008 public_configs += [ ":angle_static" ]
Julien Isorce5641d192020-02-04 21:31:47 -08001009 deps = [ ":includes" ]
1010 public_deps = [ ":libANGLE" ]
Jamie Madill562e81b2015-01-14 14:31:02 -05001011}
1012
Manh Nguyendce37b72020-06-21 22:27:06 -04001013angle_static_library("libGLESv2_with_capture_static") {
1014 sources = libglesv2_sources
1015 configs += [ ":debug_annotations_config" ]
1016 public_configs += [ ":angle_static" ]
1017 deps = [ ":includes" ]
1018 public_deps = [ ":libANGLE_with_capture" ]
1019}
1020
Jamie Madill77c84962019-06-28 11:24:27 -04001021angle_shared_library("libGLESv1_CM") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -04001022 sources = libglesv1_cm_sources
Jamie Madill77c84962019-06-28 11:24:27 -04001023 output_name = "libGLESv1_CM${angle_libs_suffix}"
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001024
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001025 configs += [
Courtney Goeltzenleuchter7d81ae72018-10-08 19:25:19 -06001026 ":angle_gl_visibility_config",
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001027 ":debug_annotations_config",
Jamie Madillba319ba2018-12-29 10:29:33 -05001028 ":gl_prototypes",
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001029 ]
1030
1031 defines = []
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001032
1033 deps = [
1034 ":includes",
Jamie Madill77c84962019-06-28 11:24:27 -04001035 ":libGLESv2",
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001036 ]
Jamie Madill8970ad32020-08-26 12:59:19 -04001037
1038 if (is_win) {
1039 sources += [ "src/libGLESv1_CM/libGLESv1_CM.def" ]
1040 }
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001041}
1042
Jamie Madill7098cff2019-01-15 18:33:42 -05001043angle_static_library("libGLESv1_CM_static") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -04001044 sources = libglesv1_cm_sources
Jamie Madill7098cff2019-01-15 18:33:42 -05001045 configs += [ ":debug_annotations_config" ]
1046 public_configs += [ ":angle_static" ]
Geoff Lang2aaa7b42018-01-12 17:17:27 -05001047 deps = [
1048 ":includes",
1049 ":libGLESv2_static",
1050 ]
1051}
1052
Jamie Madill4638dc92018-12-17 13:13:49 -05001053config("libEGL_egl_loader_config") {
1054 defines = [ "ANGLE_USE_EGL_LOADER" ]
1055}
1056
Jamie Madill7098cff2019-01-15 18:33:42 -05001057angle_source_set("libEGL_egl_loader") {
Jamie Madill4638dc92018-12-17 13:13:49 -05001058 sources = [
1059 "src/libEGL/egl_loader_autogen.cpp",
1060 "src/libEGL/egl_loader_autogen.h",
1061 ]
1062
Jamie Madill7098cff2019-01-15 18:33:42 -05001063 public_configs += [
Jamie Madill4638dc92018-12-17 13:13:49 -05001064 ":libEGL_egl_loader_config",
1065 ":gl_prototypes",
Jamie Madill4638dc92018-12-17 13:13:49 -05001066 ]
1067
Julien Isorce5641d192020-02-04 21:31:47 -08001068 deps = [ ":includes" ]
Jamie Madill4638dc92018-12-17 13:13:49 -05001069}
1070
Jamie Madill77c84962019-06-28 11:24:27 -04001071angle_shared_library("libEGL") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -04001072 sources = libegl_sources
Jamie Madill77c84962019-06-28 11:24:27 -04001073 output_name = "libEGL${angle_libs_suffix}"
Jamie Madill562e81b2015-01-14 14:31:02 -05001074
Jamie Madill562e81b2015-01-14 14:31:02 -05001075 configs += [
Corentin Wallezbeb81582015-09-02 10:30:55 -04001076 ":debug_annotations_config",
Jamie Madill4638dc92018-12-17 13:13:49 -05001077 ":library_name_config",
Jamie Madill562e81b2015-01-14 14:31:02 -05001078 ]
1079
Jamie Madilledbc2442016-01-04 11:25:00 -05001080 defines = [ "LIBEGL_IMPLEMENTATION" ]
Yuly Novikova4ab5802016-12-19 17:44:22 -05001081 if (is_win) {
1082 defines += [ "EGLAPI=" ]
1083 } else {
1084 defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
1085 }
Jamie Madill562e81b2015-01-14 14:31:02 -05001086
Jamie Madill80ab03c2017-01-03 11:03:23 -05001087 if (is_win) {
Jamie Madill23d4b642020-11-22 13:01:36 -05001088 sources += [ "src/libEGL/libEGL_autogen.def" ]
Jamie Madill80ab03c2017-01-03 11:03:23 -05001089 }
1090
Jamie Madill562e81b2015-01-14 14:31:02 -05001091 deps = [
James Darpinian22ec7dc2019-08-06 10:10:52 -07001092 ":angle_common",
Jamie Madill4638dc92018-12-17 13:13:49 -05001093 ":angle_version",
1094 ":libEGL_egl_loader",
Jamie Madill562e81b2015-01-14 14:31:02 -05001095 ]
Jamie Madill720ca442018-12-17 14:04:10 -05001096
Julien Isorce5641d192020-02-04 21:31:47 -08001097 public_deps = [ ":includes" ]
Jamie Madill4638dc92018-12-17 13:13:49 -05001098
Julien Isorce5641d192020-02-04 21:31:47 -08001099 data_deps = [ ":libGLESv2" ]
Jamie Madill562e81b2015-01-14 14:31:02 -05001100}
Corentin Wallezbeb81582015-09-02 10:30:55 -04001101
Jamie Madill7098cff2019-01-15 18:33:42 -05001102angle_static_library("libEGL_static") {
Frank Henigman44b2c0b2018-08-29 17:31:27 -04001103 sources = libegl_sources
Manh Nguyendce37b72020-06-21 22:27:06 -04001104 configs += [
1105 ":debug_annotations_config",
1106 ":library_name_config",
1107 ]
1108 public_configs += [ ":angle_static" ]
1109 deps = [
1110 ":includes",
1111 ":libGLESv2_static",
1112 ]
1113}
1114
1115angle_static_library("libEGL_with_capture_static") {
1116 sources = libegl_sources
Jamie Madill80ab03c2017-01-03 11:03:23 -05001117
Jamie Madill80ab03c2017-01-03 11:03:23 -05001118 configs += [
Jamie Madill80ab03c2017-01-03 11:03:23 -05001119 ":debug_annotations_config",
Jamie Madill4638dc92018-12-17 13:13:49 -05001120 ":library_name_config",
Jamie Madill80ab03c2017-01-03 11:03:23 -05001121 ]
1122
Jamie Madill7098cff2019-01-15 18:33:42 -05001123 public_configs += [ ":angle_static" ]
Jamie Madill80ab03c2017-01-03 11:03:23 -05001124
1125 deps = [
1126 ":includes",
Manh Nguyendce37b72020-06-21 22:27:06 -04001127 ":libGLESv2_with_capture_static",
Jamie Madill80ab03c2017-01-03 11:03:23 -05001128 ]
1129}
1130
Ken Russellfcadd082017-06-28 14:01:15 -07001131# Convenience targets for some of the samples so they can be built
1132# with Chromium's toolchain.
Jamie Madill7098cff2019-01-15 18:33:42 -05001133angle_executable("angle_shader_translator") {
Ken Russellfcadd082017-06-28 14:01:15 -07001134 testonly = true
1135
Julien Isorce5641d192020-02-04 21:31:47 -08001136 sources = [ "samples/shader_translator/shader_translator.cpp" ]
Ken Russellfcadd082017-06-28 14:01:15 -07001137
Julien Isorce5641d192020-02-04 21:31:47 -08001138 deps = [ ":translator" ]
Ken Russellfcadd082017-06-28 14:01:15 -07001139}
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -06001140
Stephen Whitef4cd1742020-12-21 09:57:58 -05001141if (angle_standalone || build_with_chromium) {
Jamie Madill1ba72542019-10-04 15:17:49 -04001142 config("angle_feature_support_config") {
1143 include_dirs = [
1144 "include",
1145 "src",
1146 ]
1147 defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ]
1148 if (is_debug) {
1149 defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ]
1150 }
Ian Elliotta9d579e2018-11-28 11:44:48 -07001151 }
Courtney Goeltzenleuchter7d81ae72018-10-08 19:25:19 -06001152
Jamie Madill1ba72542019-10-04 15:17:49 -04001153 angle_shared_library("libfeature_support") {
1154 output_name = "libfeature_support${angle_libs_suffix}"
Ian Elliotta9d579e2018-11-28 11:44:48 -07001155
Jamie Madill1ba72542019-10-04 15:17:49 -04001156 if (is_android) {
1157 libs = [ "log" ]
1158 }
1159
1160 public_configs += [
1161 ":angle_feature_support_config",
1162 "${angle_jsoncpp_dir}:jsoncpp_config",
1163 ]
1164
Shahbaz Youssefi5b8dec52021-01-12 04:11:56 +00001165 if (is_apple && !is_component_build) {
Jamie Madill1ba72542019-10-04 15:17:49 -04001166 ldflags = [
1167 "-install_name",
1168 "@rpath/${target_name}.dylib",
1169 ]
1170 }
1171
1172 sources = [
1173 "src/feature_support_util/feature_support_util.cpp",
1174 "src/feature_support_util/feature_support_util.h",
1175 ]
1176
1177 deps = [
1178 ":angle_gpu_info_util",
1179 "${angle_jsoncpp_dir}:jsoncpp",
Cezary Kulakowski4fb738f2019-02-01 10:53:44 +01001180 ]
1181 }
Ian Elliotta9d579e2018-11-28 11:44:48 -07001182}
1183
Jamie Madill1f56ed22019-01-03 15:24:22 -05001184if (!is_component_build && is_android && symbol_level != 0) {
1185 action_foreach("compressed_symbols") {
Courtney Goeltzenleuchterc05c1412019-01-03 12:40:13 -07001186 sources = []
1187 foreach(_library, angle_libraries) {
Jamie Madill77c84962019-06-28 11:24:27 -04001188 sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.so" ]
Courtney Goeltzenleuchterc05c1412019-01-03 12:40:13 -07001189 }
1190 if (angle_enable_vulkan_validation_layers) {
1191 foreach(_layer, vulkan_validation_layers) {
Jamie Madill77c84962019-06-28 11:24:27 -04001192 sources += [ "$root_out_dir/lib${_layer}.so" ]
Courtney Goeltzenleuchterc05c1412019-01-03 12:40:13 -07001193 }
1194 }
Jamie Madill1f56ed22019-01-03 15:24:22 -05001195
1196 script = rebase_path("${root_build_dir}/android/compress_symbols.py",
1197 root_build_dir)
1198
Courtney Goeltzenleuchterc05c1412019-01-03 12:40:13 -07001199 deps = []
1200 foreach(_library, angle_libraries) {
Jamie Madill77c84962019-06-28 11:24:27 -04001201 deps += [ ":$_library" ]
Courtney Goeltzenleuchterc05c1412019-01-03 12:40:13 -07001202 }
1203
1204 if (angle_enable_vulkan_validation_layers) {
1205 foreach(_layer, vulkan_validation_layers) {
Jamie Madill328f72a2020-12-15 19:25:50 -05001206 deps += [ "$angle_vulkan_validation_layers_dir:${_layer}" ]
Courtney Goeltzenleuchterc05c1412019-01-03 12:40:13 -07001207 }
1208 }
Jamie Madill1f56ed22019-01-03 15:24:22 -05001209
Julien Isorce5641d192020-02-04 21:31:47 -08001210 outputs = [ "$root_out_dir/lib.compressed/{{source_file_part}}" ]
Jamie Madill1f56ed22019-01-03 15:24:22 -05001211
1212 android_nm = "${android_tool_prefix}nm"
Tim Van Patten73e17bf2019-05-14 10:42:25 -06001213 android_strip = "${android_tool_prefix}strip"
Jamie Madill1f56ed22019-01-03 15:24:22 -05001214
1215 args = [
1216 "--objcopy",
1217 rebase_path(android_objcopy, root_build_dir),
1218 "--nm",
1219 rebase_path(android_nm, root_build_dir),
Tim Van Patten73e17bf2019-05-14 10:42:25 -06001220 "--strip",
1221 rebase_path(android_strip, root_build_dir),
Jamie Madill1f56ed22019-01-03 15:24:22 -05001222 "--unstrippedsofile",
1223 "{{source_dir}}/lib.unstripped/{{source_file_part}}",
1224 "--output",
1225 "{{source_dir}}/lib.compressed/{{source_file_part}}",
1226 ]
1227 }
1228}
1229
Geoff Lang6e687af2019-10-17 14:36:41 -04001230if (build_with_chromium && !is_component_build && is_android &&
Courtney Goeltzenleuchter92b16ea2018-12-12 17:06:47 -07001231 current_toolchain == default_toolchain) {
Cody Northrop8cbd3212019-04-23 13:25:20 -06001232 # Package ANGLE libraries
1233 angle_apk("angle_chromium_apk") {
Tobin Ehlis736c43a2020-08-31 10:23:27 -06001234 package_name = "org.chromium.angle"
Tim Van Pattenee4fa072019-02-21 19:21:09 +00001235 apk_name = "AngleLibraries"
Jamie Madill7bed2a52020-09-22 23:37:54 -04001236 version_name = "ANGLE Developer Build"
1237
1238 if (angle_enable_commit_id) {
1239 version_code =
1240 exec_script("src/commit_id.py", [ "position" ], "trim string")
1241 } else {
1242 version_code = "0"
1243 }
Cody Northrop8e636442018-11-30 16:24:11 -07001244 }
1245
1246 group("angle_apks") {
Julien Isorce5641d192020-02-04 21:31:47 -08001247 deps = [ ":angle_chromium_apk" ]
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -06001248 }
1249}
Jamie Madill1ba72542019-10-04 15:17:49 -04001250
Jamie Madill1ba72542019-10-04 15:17:49 -04001251group("angle") {
1252 data_deps = [
Julien Isorce5641d192020-02-04 21:31:47 -08001253 ":libEGL",
Jamie Madille3c25712019-12-03 14:08:36 -05001254 ":libGLESv1_CM",
Jamie Madill1ba72542019-10-04 15:17:49 -04001255 ":libGLESv2",
Jamie Madill1ba72542019-10-04 15:17:49 -04001256 ]
1257}