Jamie Madill | 0cb3b0f | 2019-01-28 09:55:20 -0500 | [diff] [blame] | 1 | # Copyright 2019 The ANGLE Project Authors. All rights reserved. |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Maksim Sisov | fa2e374 | 2021-09-09 15:34:23 +0300 | [diff] [blame] | 5 | # import the ozone_platform_x11 variable |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 6 | import("gni/angle.gni") |
Antonio Caggiano | 7b0f631 | 2022-03-30 14:16:02 +0200 | [diff] [blame] | 7 | if (angle_enable_vulkan) { |
| 8 | import("//build_overrides//vulkan_headers.gni") |
| 9 | } |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 10 | if (angle_has_build) { |
| 11 | import("//build/config/linux/pkg_config.gni") |
Jamie Madill | 89e3de9 | 2021-11-11 10:18:36 -0500 | [diff] [blame] | 12 | import("//build/config/sanitizers/sanitizers.gni") |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 13 | import("//build/config/ui.gni") |
| 14 | import("//testing/libfuzzer/fuzzer_test.gni") |
| 15 | |
| 16 | if (is_android) { |
| 17 | # android/rules.gni can only be imported for Android targets |
| 18 | import("//build/config/android/config.gni") |
| 19 | import("//build/config/android/rules.gni") |
| 20 | import("android/angle_apk.gni") |
| 21 | } |
Jamie Madill | 6a70398 | 2021-11-19 09:41:58 -0500 | [diff] [blame] | 22 | } else { |
| 23 | using_sanitizer = false |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 24 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 25 | |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 26 | declare_args() { |
| 27 | # Use the PCI lib to collect GPU information on Linux. |
mark a. foltz | 5040c4d | 2022-03-28 14:27:16 -0700 | [diff] [blame] | 28 | use_libpci = (is_linux || is_chromeos) && (angle_use_x11 || use_ozone) && |
| 29 | angle_has_build |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 30 | |
Geoff Lang | 48da7e7 | 2021-09-07 15:49:07 -0400 | [diff] [blame] | 31 | # Enable using Vulkan to collect system info as a fallback. |
| 32 | angle_enable_vulkan_system_info = false |
| 33 | |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 34 | # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md. |
| 35 | angle_link_glx = false |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 36 | |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 37 | # Don't build extra (test, samples etc) for Windows UWP. We don't have |
| 38 | # infrastructure (e.g. windowing helper functions) in place to run them. |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 39 | angle_build_all = !build_with_chromium && !angle_is_winuwp && angle_has_build |
Geoff Lang | e888356 | 2020-03-06 09:32:18 -0500 | [diff] [blame] | 40 | |
| 41 | # Enable generating current commit information using git |
| 42 | angle_enable_commit_id = true |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 43 | |
| 44 | # Abseil has trouble supporting MSVC, particularly regarding component builds. |
| 45 | # http://crbug.com/1126524 |
| 46 | angle_enable_abseil = angle_has_build && is_clang |
Jamie Madill | 06a9d52 | 2020-11-04 19:57:27 -0500 | [diff] [blame] | 47 | |
| 48 | # Adds run-time checks to filter out EVENT() messages when the debug annotator is disabled. |
| 49 | angle_enable_annotator_run_time_checks = false |
Tim Van Patten | bbed881 | 2021-03-05 17:40:27 -0700 | [diff] [blame] | 50 | |
| 51 | # Enables non-conformant extensions and features |
| 52 | angle_expose_non_conformant_extensions_and_versions = false |
Jamie Madill | 54dfb62 | 2021-04-07 12:33:31 -0400 | [diff] [blame] | 53 | |
| 54 | # Optional feature that forces dirty state whenever we use a new context regardless of thread. |
| 55 | angle_force_context_check_every_call = false |
Craig Stout | 2413621 | 2021-11-08 14:01:34 -0800 | [diff] [blame] | 56 | |
| 57 | # Allow shared library custom name extensions for setting soname such as libEGL.so.1 |
| 58 | angle_egl_extension = "" |
| 59 | angle_glesv2_extension = "" |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 60 | } |
| 61 | |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 62 | if (angle_build_all) { |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 63 | group("all") { |
| 64 | testonly = true |
| 65 | deps = [ |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 66 | ":angle", |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 67 | ":angle_shader_translator", |
| 68 | ":translator_fuzzer", |
Jamie Madill | 238c19e | 2019-02-07 09:09:41 -0500 | [diff] [blame] | 69 | ":xxhash_fuzzer", |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 70 | "$angle_root/samples:angle_samples", |
| 71 | "$angle_root/src/tests:angle_tests", |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 72 | ] |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 73 | if (angle_enable_cl) { |
| 74 | deps += [ "$angle_root/src/libOpenCL:angle_cl" ] |
| 75 | } |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 76 | } |
| 77 | } |
| 78 | |
Tim Van Patten | c4e0a1e | 2018-11-28 16:08:11 +0000 | [diff] [blame] | 79 | import("src/compiler.gni") |
Tim Van Patten | fdccaa3 | 2018-11-01 17:47:10 -0600 | [diff] [blame] | 80 | import("src/libGLESv2.gni") |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 81 | |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 82 | # This config is exported to dependent targets (and also applied to internal |
| 83 | # ones). |
| 84 | config("external_config") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 85 | include_dirs = [ "include" ] |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 88 | # Prevent the GL headers from redeclaring ANGLE entry points. |
| 89 | config("no_gl_prototypes") { |
| 90 | defines = [ |
| 91 | "GL_GLES_PROTOTYPES=0", |
| 92 | "EGL_EGL_PROTOTYPES=0", |
| 93 | ] |
| 94 | } |
| 95 | |
| 96 | config("gl_prototypes") { |
| 97 | defines = [ |
| 98 | "GL_GLES_PROTOTYPES=1", |
| 99 | "EGL_EGL_PROTOTYPES=1", |
| 100 | "GL_GLEXT_PROTOTYPES", |
| 101 | "EGL_EGLEXT_PROTOTYPES", |
| 102 | ] |
| 103 | } |
| 104 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 105 | # This config is applied to internal Angle targets (not pushed to dependents). |
| 106 | config("internal_config") { |
| 107 | include_dirs = [ |
| 108 | "include", |
| 109 | "src", |
| 110 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 111 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 112 | defines = [] |
Jamie Madill | 6de5185 | 2017-04-12 09:53:01 -0400 | [diff] [blame] | 113 | |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 114 | if (is_win) { |
| 115 | defines += [ "ANGLE_IS_WIN" ] |
Jonah Ryan-Davis | e2fc818 | 2021-05-05 11:51:00 -0400 | [diff] [blame] | 116 | if (angle_is_winuwp) { |
| 117 | defines += [ "ANGLE_IS_WINUWP" ] |
| 118 | } |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 119 | } else if (is_linux || is_chromeos) { |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 120 | defines += [ "ANGLE_IS_LINUX" ] |
| 121 | } |
| 122 | |
Ian Elliott | e2ecb2d | 2020-11-03 19:26:00 -0700 | [diff] [blame] | 123 | # Enables debug/trace-related functionality, including logging every GLES/EGL API command to the |
| 124 | # "angle_debug.txt" file on desktop. Enables debug markers for AGI, but must also set |
| 125 | # angle_enable_annotator_run_time_checks to improve performance. |
Tobin Ehlis | 573f76b | 2018-05-03 11:10:44 -0600 | [diff] [blame] | 126 | if (angle_enable_trace) { |
| 127 | defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ] |
| 128 | } |
Tobin Ehlis | 93121f3 | 2019-10-17 08:18:16 -0600 | [diff] [blame] | 129 | |
Ian Elliott | e2ecb2d | 2020-11-03 19:26:00 -0700 | [diff] [blame] | 130 | # When used with angle_enable_trace, enables logging every GLES/EGL API command to Android logcat |
| 131 | # Enables debug markers for AGI regardless of run-time checks. |
| 132 | if (angle_enable_trace_android_logcat) { |
| 133 | defines += [ "ANGLE_ENABLE_TRACE_ANDROID_LOGCAT=1" ] |
| 134 | } |
| 135 | |
Cody Northrop | e3c4491 | 2022-03-24 11:32:10 -0600 | [diff] [blame] | 136 | # When used with angle_enable_trace, enables logging every GLES/EGL API command to the terminal |
| 137 | if (angle_enable_trace_events) { |
| 138 | defines += [ "ANGLE_ENABLE_TRACE_EVENTS=1" ] |
| 139 | } |
| 140 | |
Tobin Ehlis | 93121f3 | 2019-10-17 08:18:16 -0600 | [diff] [blame] | 141 | if (is_chromeos) { |
| 142 | defines += [ "ANGLE_PLATFORM_CHROMEOS" ] |
| 143 | } |
Ethan Lee | fcef6dc | 2020-01-24 22:41:35 -0500 | [diff] [blame] | 144 | |
| 145 | if (is_ggp) { |
| 146 | defines += [ "__ggp__" ] |
| 147 | } |
Xiaoxuan Liu | 61180d0 | 2020-10-12 16:40:13 +0800 | [diff] [blame] | 148 | |
Sergey Ulanov | b73eee7 | 2021-07-07 18:51:35 -0700 | [diff] [blame] | 149 | if (angle_use_vulkan_null_display) { |
| 150 | defines += [ "ANGLE_USE_VULKAN_NULL_DISPLAY" ] |
| 151 | } else if (angle_use_vulkan_display) { |
Alexis Hetu | 729cbcf | 2021-07-23 11:18:18 -0400 | [diff] [blame] | 152 | defines += [ "ANGLE_USE_VULKAN_DISPLAY" ] |
| 153 | if (!angle_use_x11) { |
| 154 | defines += [ "EGL_NO_X11" ] |
| 155 | } |
Antonio Caggiano | f6cdd02 | 2021-12-09 16:52:35 +0100 | [diff] [blame] | 156 | |
| 157 | # These two are needed here to correctly select OSWindow::New |
| 158 | if (angle_use_x11) { |
| 159 | defines += [ "ANGLE_USE_X11" ] |
| 160 | } |
| 161 | if (angle_use_wayland) { |
| 162 | defines += [ "ANGLE_USE_WAYLAND" ] |
| 163 | } |
| 164 | |
Xiaoxuan Liu | 61180d0 | 2020-10-12 16:40:13 +0800 | [diff] [blame] | 165 | if (angle_vulkan_display_mode == "simple") { |
| 166 | defines += [ "ANGLE_VULKAN_DISPLAY_MODE_SIMPLE" ] |
| 167 | } else if (angle_vulkan_display_mode == "headless") { |
| 168 | defines += [ "ANGLE_VULKAN_DISPLAY_MODE_HEADLESS" ] |
| 169 | } |
| 170 | } |
Alexis Hetu | f2a1548 | 2020-12-04 14:07:24 -0500 | [diff] [blame] | 171 | |
| 172 | if (is_lsan) { |
| 173 | defines += [ "ANGLE_WITH_LSAN" ] |
| 174 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 175 | } |
| 176 | |
Jamie Madill | a9f11bf | 2019-10-21 08:39:14 -0400 | [diff] [blame] | 177 | config("constructor_and_destructor_warnings") { |
| 178 | if (is_clang) { |
| 179 | cflags = [ |
| 180 | "-Wexit-time-destructors", |
| 181 | "-Wglobal-constructors", |
| 182 | ] |
| 183 | } |
| 184 | } |
| 185 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 186 | config("extra_warnings") { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 187 | cflags = [] |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 188 | |
Gert Wollny | 79f2411 | 2021-02-12 09:36:18 +0100 | [diff] [blame] | 189 | is_gcc = !is_clang && !is_win |
| 190 | |
Brian Salomon | e7496f5 | 2021-01-26 16:13:04 -0500 | [diff] [blame] | 191 | # Avoid failing builds for warnings enabled by Skia build. |
| 192 | if (defined(is_skia_standalone)) { |
| 193 | cflags += [ "-w" ] |
| 194 | } |
| 195 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 196 | # Enable more default warnings on Windows. |
| 197 | if (is_win) { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 198 | cflags += [ |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 199 | "/we4244", # Conversion: possible loss of data. |
Jamie Madill | 330c867 | 2020-08-28 17:44:13 -0400 | [diff] [blame] | 200 | "/we4312", # Conversion: greater size. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 201 | "/we4456", # Variable shadowing. |
Jamie Madill | 1db8a26 | 2016-09-22 13:53:47 -0400 | [diff] [blame] | 202 | "/we4458", # declaration hides class member. |
Ben Wagner | 1e06401 | 2019-04-12 14:10:17 -0400 | [diff] [blame] | 203 | "/we4715", # not all control paths return a value |
Geoff Lang | b944053 | 2017-11-28 13:26:34 -0500 | [diff] [blame] | 204 | "/we4800", # forcing value to bool. |
| 205 | "/we4838", # narrowing conversion. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 206 | ] |
| 207 | } |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 208 | if (is_clang) { |
Michael Spang | 229fc83 | 2019-01-21 18:09:15 -0500 | [diff] [blame] | 209 | cflags += [ |
Jamie Madill | c7217aa | 2020-08-28 14:45:14 -0400 | [diff] [blame] | 210 | "-Wbad-function-cast", |
Jamie Madill | 155947f | 2019-10-24 12:55:11 -0400 | [diff] [blame] | 211 | "-Wconditional-uninitialized", |
Jamie Madill | 44a0e73 | 2019-09-02 13:55:59 -0400 | [diff] [blame] | 212 | "-Wextra-semi-stmt", |
Jiacheng Lu | 73e5e9b | 2019-07-22 15:26:17 -0600 | [diff] [blame] | 213 | "-Wfloat-conversion", |
Jamie Madill | 16370a6 | 2019-10-24 12:55:11 -0400 | [diff] [blame] | 214 | "-Winconsistent-missing-destructor-override", |
Jamie Madill | a620685 | 2019-10-24 12:55:09 -0400 | [diff] [blame] | 215 | "-Wmissing-field-initializers", |
Stuart Morgan | 5dba723 | 2020-06-16 09:29:16 -0700 | [diff] [blame] | 216 | "-Wnewline-eof", |
Olli Etuaho | 8073a95 | 2018-05-09 16:41:39 +0300 | [diff] [blame] | 217 | "-Wnon-virtual-dtor", |
Jamie Madill | 68945f1 | 2019-10-24 12:55:09 -0400 | [diff] [blame] | 218 | "-Wredundant-parens", |
Adrian McCarthy | 462fb1e | 2021-02-17 13:46:43 -0800 | [diff] [blame] | 219 | "-Wreturn-std-move", |
Jamie Madill | cb87d78 | 2021-07-08 08:28:04 -0400 | [diff] [blame] | 220 | "-Wshadow", |
Jamie Madill | 859ca03 | 2019-10-24 12:55:08 -0400 | [diff] [blame] | 221 | "-Wshadow-field", |
Jamie Madill | fd58d22 | 2019-10-24 12:55:07 -0400 | [diff] [blame] | 222 | "-Wtautological-type-limit-compare", |
Jamie Madill | c017cee | 2019-10-24 12:55:10 -0400 | [diff] [blame] | 223 | "-Wundefined-reinterpret-cast", |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 224 | "-Wunneeded-internal-declaration", |
Peter Kasting | d4d6c23 | 2021-07-31 11:41:29 -0700 | [diff] [blame] | 225 | "-Wunused-but-set-variable", |
Sylvain Defresne | 30afc25 | 2021-11-03 17:59:19 +0100 | [diff] [blame] | 226 | "-Wsuggest-destructor-override", |
| 227 | "-Wsuggest-override", |
James Darpinian | efa898a | 2019-08-07 17:05:35 -0700 | [diff] [blame] | 228 | |
| 229 | # The below warnings are used by WebKit. We enable them to make rolling |
| 230 | # ANGLE in WebKit easier. |
| 231 | "-Wparentheses", |
| 232 | "-Wrange-loop-analysis", |
| 233 | "-Wstrict-prototypes", |
Peter Kasting | d4d6c23 | 2021-07-31 11:41:29 -0700 | [diff] [blame] | 234 | "-Wunreachable-code-aggressive", |
James Darpinian | 7e48c9e | 2019-08-06 17:17:19 -0700 | [diff] [blame] | 235 | "-Wshorten-64-to-32", |
Nico Weber | 79de62c | 2018-01-31 10:47:14 -0500 | [diff] [blame] | 236 | ] |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 237 | } |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 238 | |
Gert Wollny | 79f2411 | 2021-02-12 09:36:18 +0100 | [diff] [blame] | 239 | if (is_gcc) { |
| 240 | cflags_cc = [ "-Wdeprecated-copy" ] |
| 241 | } |
| 242 | |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 243 | if (angle_is_winuwp) { |
angle-autoroll | 66c89b0 | 2021-10-06 16:28:42 +0000 | [diff] [blame] | 244 | cflags += [ |
| 245 | "/wd4091", # keyword ignored on left of type when no variable is declared |
| 246 | "/wd4447", # 'main' signature found without threading model. |
| 247 | ] |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 248 | } |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 249 | } |
| 250 | |
Courtney Goeltzenleuchter | 4607148 | 2018-05-15 13:35:15 -0600 | [diff] [blame] | 251 | # This config adds build-ids to the associated library. |
| 252 | # -Wl is a special option that indicates that clang should pass the associated |
| 253 | # option --build-id to the linker. This will cause a build-id section to be added |
| 254 | # to the associated library. The build-id makes it possible for a debugger to |
| 255 | # find the right symbol file to use. |
| 256 | config("build_id_config") { |
| 257 | ldflags = [ "-Wl,--build-id" ] |
| 258 | } |
| 259 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 260 | _use_copy_compiler_dll = angle_has_build && is_win && target_cpu != "arm64" |
| 261 | |
Tom Tan | 5c31753 | 2018-11-30 17:01:01 -0800 | [diff] [blame] | 262 | # Windows ARM64 is available since 10.0.16299 so no need to copy |
| 263 | # d3dcompiler_47.dll because this file is available as inbox. |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 264 | if (_use_copy_compiler_dll) { |
Jamie Madill | d09546e | 2019-02-22 10:24:44 -0500 | [diff] [blame] | 265 | # We also ship an older DLL for compatiblity with Windows 7 machines without |
| 266 | # the UCRT. This DLL isn't available in the standard SDK distribution. |
| 267 | _old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll" |
| 268 | _has_old_compiler = |
| 269 | exec_script("scripts/file_exists.py", [ _old_compiler ], "value") |
| 270 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 271 | copy("copy_compiler_dll") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 272 | sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ] |
Jamie Madill | d09546e | 2019-02-22 10:24:44 -0500 | [diff] [blame] | 273 | |
| 274 | if (_has_old_compiler) { |
| 275 | sources += [ _old_compiler ] |
| 276 | } |
| 277 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 278 | outputs = [ "$root_out_dir/{{source_file_part}}" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 279 | } |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 280 | } |
| 281 | |
Jamie Madill | 55959b0 | 2019-03-05 10:07:41 -0500 | [diff] [blame] | 282 | # Holds the shared includes so we only need to list them once. |
Jamie Madill | cd4f1fb | 2019-02-07 15:26:10 -0500 | [diff] [blame] | 283 | config("includes_config") { |
| 284 | include_dirs = [ "include" ] |
| 285 | } |
| 286 | |
James Clarke | 06d194e | 2021-01-10 14:29:44 -0800 | [diff] [blame] | 287 | config("angle_uwp_env") { |
| 288 | if (angle_is_winuwp) { |
| 289 | defines = [ "WINAPI_FAMILY=WINAPI_FAMILY_PC_APP" ] |
| 290 | } |
| 291 | } |
| 292 | |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 293 | angle_source_set("cl_includes") { |
| 294 | sources = cl_includes |
John Plate | dfe208f | 2021-04-28 18:26:00 +0100 | [diff] [blame] | 295 | public_configs = [ ":external_config" ] |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 296 | } |
| 297 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 298 | angle_source_set("includes") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 299 | sources = libangle_includes |
Jamie Madill | 8d412db | 2020-08-29 22:25:18 +0000 | [diff] [blame] | 300 | public_configs = [ ":includes_config" ] |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 301 | if (angle_enable_cl) { |
| 302 | public_deps = [ ":cl_includes" ] |
| 303 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 304 | } |
| 305 | |
Peter Kasting | 1bffabe | 2021-06-29 18:13:39 -0700 | [diff] [blame] | 306 | config("disable_unreachable_code_break_warning") { |
| 307 | if (is_clang) { |
| 308 | cflags = [ "-Wno-unreachable-code-break" ] |
| 309 | } |
| 310 | } |
| 311 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 312 | angle_static_library("preprocessor") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 313 | sources = angle_preprocessor_sources |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 314 | |
Peter Kasting | 1bffabe | 2021-06-29 18:13:39 -0700 | [diff] [blame] | 315 | # preprocessor_tab_autogen.cpp contains an instance of this. |
| 316 | configs += [ ":disable_unreachable_code_break_warning" ] |
| 317 | |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 318 | public_deps = [ |
| 319 | ":angle_common", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 320 | ":angle_translator_headers", |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 321 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 322 | } |
| 323 | |
Tobin Ehlis | 5546fb4 | 2019-01-17 12:25:54 -0500 | [diff] [blame] | 324 | config("angle_disable_pool_alloc") { |
| 325 | defines = [ "ANGLE_DISABLE_POOL_ALLOC" ] |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 326 | } |
| 327 | |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 328 | config("debug_annotations_config") { |
Jamie Madill | 786d38a | 2021-09-10 17:58:39 +0300 | [diff] [blame] | 329 | defines = [] |
Corentin Wallez | 105bc9d | 2019-03-06 16:32:40 +0000 | [diff] [blame] | 330 | if (is_debug) { |
Jamie Madill | 786d38a | 2021-09-10 17:58:39 +0300 | [diff] [blame] | 331 | defines += [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ] |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 332 | } |
Jamie Madill | 06a9d52 | 2020-11-04 19:57:27 -0500 | [diff] [blame] | 333 | if (angle_enable_annotator_run_time_checks) { |
Ian Elliott | e2ecb2d | 2020-11-03 19:26:00 -0700 | [diff] [blame] | 334 | # When used with angle_enable_trace, enables debug markers for AGI with run-time checks to |
| 335 | # filter out EVENT() messages when the debug annotator is disabled. |
Jamie Madill | 786d38a | 2021-09-10 17:58:39 +0300 | [diff] [blame] | 336 | defines += [ "ANGLE_ENABLE_ANNOTATOR_RUN_TIME_CHECKS" ] |
Jamie Madill | 06a9d52 | 2020-11-04 19:57:27 -0500 | [diff] [blame] | 337 | } |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 338 | } |
| 339 | |
Jamie Madill | 2b86e2d | 2021-07-19 10:30:57 -0400 | [diff] [blame] | 340 | config("angle_asserts_config") { |
| 341 | if (angle_assert_always_on) { |
| 342 | defines = [ "ANGLE_ASSERT_ALWAYS_ON" ] |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 343 | } |
| 344 | } |
| 345 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 346 | config("angle_common_config") { |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 347 | include_dirs = [ "src/common/third_party/base" ] |
Yuly Novikov | e762400 | 2018-01-27 18:27:07 -0500 | [diff] [blame] | 348 | if (is_android) { |
| 349 | libs = [ "log" ] |
| 350 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 351 | } |
| 352 | |
Alexis Hetu | a20f5b1 | 2020-08-18 11:26:50 -0400 | [diff] [blame] | 353 | # Silences the "indirect call of a function with wrong dynamic type" cfi error |
| 354 | config("angle_no_cfi_icall") { |
| 355 | if (is_cfi && use_cfi_icall && current_toolchain == default_toolchain) { |
| 356 | cflags = [ "-fno-sanitize=cfi-icall" ] |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | # Silences the "cast from void* or another unrelated type to the wrong dynamic type" cfi error |
| 361 | config("angle_no_cfi_unrelated_cast") { |
| 362 | if (is_cfi && use_cfi_cast && current_toolchain == default_toolchain) { |
| 363 | cflags = [ "-fno-sanitize=cfi-unrelated-cast" ] |
| 364 | } |
| 365 | } |
| 366 | |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 367 | angle_source_set("xxhash") { |
| 368 | sources = xxhash_sources |
Jamie Madill | 5fde632 | 2020-08-28 14:45:17 -0400 | [diff] [blame] | 369 | if (is_clang) { |
| 370 | cflags_c = [ "-Wno-implicit-fallthrough" ] |
| 371 | } |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 372 | } |
| 373 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 374 | if (angle_has_build) { |
| 375 | fuzzer_test("xxhash_fuzzer") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 376 | sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ] |
| 377 | deps = [ ":xxhash" ] |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 378 | } |
Jamie Madill | 238c19e | 2019-02-07 09:09:41 -0500 | [diff] [blame] | 379 | } |
| 380 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 381 | angle_static_library("angle_common") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 382 | sources = libangle_common_sources |
John Plate | 05fb227 | 2021-04-27 19:31:31 +0100 | [diff] [blame] | 383 | if (angle_enable_cl) { |
| 384 | sources += libangle_common_cl_sources |
| 385 | } |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 386 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 387 | configs += [ |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 388 | ":angle_common_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 389 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 390 | ] |
Jeremy Roman | 06feb81 | 2016-04-06 16:39:52 -0400 | [diff] [blame] | 391 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 392 | deps = [ ":xxhash" ] |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 393 | |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 394 | public_deps = [ |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 395 | ":angle_abseil", |
Jamie Madill | 8d986bf | 2018-02-21 08:28:01 -0500 | [diff] [blame] | 396 | ":includes", |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 397 | ] |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 398 | public_configs += [ ":angle_common_config" ] |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 399 | if (angle_has_build && use_fuzzing_engine) { |
Jamie Madill | 48aa52f | 2019-10-17 07:56:53 -0400 | [diff] [blame] | 400 | all_dependent_configs = [ ":angle_disable_pool_alloc" ] |
Tobin Ehlis | 5546fb4 | 2019-01-17 12:25:54 -0500 | [diff] [blame] | 401 | } |
Tim Van Patten | e99b8bc | 2020-10-23 18:50:33 -0600 | [diff] [blame] | 402 | |
Jamie Madill | 9528641 | 2020-11-23 15:47:09 -0500 | [diff] [blame] | 403 | if (is_linux || is_chromeos) { |
| 404 | libs = [ "dl" ] |
| 405 | } |
| 406 | |
Tim Van Patten | e99b8bc | 2020-10-23 18:50:33 -0600 | [diff] [blame] | 407 | if (is_android && (angle_enable_gl || angle_enable_vulkan)) { |
| 408 | # In API level 26 ANativeWindow APIs were moved from libandroid.so |
| 409 | # into a separate library, libnativewindow.so |
| 410 | if (ndk_api_level_at_least_26) { |
| 411 | libs = [ "nativewindow" ] |
| 412 | } else { |
| 413 | libs = [ "android" ] |
| 414 | } |
| 415 | } |
Tim Van Patten | bbed881 | 2021-03-05 17:40:27 -0700 | [diff] [blame] | 416 | |
| 417 | if (angle_expose_non_conformant_extensions_and_versions) { |
| 418 | defines = [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ] |
| 419 | } |
Jamie Madill | 89e3de9 | 2021-11-11 10:18:36 -0500 | [diff] [blame] | 420 | |
Jamie Madill | 6a70398 | 2021-11-19 09:41:58 -0500 | [diff] [blame] | 421 | if (using_sanitizer && !build_with_chromium) { |
Jamie Madill | 89e3de9 | 2021-11-11 10:18:36 -0500 | [diff] [blame] | 422 | data_deps = [ "//build/config/clang:llvm-symbolizer_data($host_toolchain)" ] |
| 423 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 424 | } |
| 425 | |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 426 | config("angle_image_util_config") { |
| 427 | include_dirs = [ |
| 428 | "include", |
| 429 | "src", |
| 430 | ] |
| 431 | } |
| 432 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 433 | angle_source_set("angle_image_util_headers") { |
| 434 | sources = libangle_image_util_headers |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 435 | public_deps = [ ":angle_common" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 436 | } |
| 437 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 438 | angle_static_library("angle_image_util") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 439 | sources = libangle_image_util_sources |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 440 | public_configs += [ ":angle_image_util_config" ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 441 | public_deps = [ ":angle_image_util_headers" ] |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 442 | } |
| 443 | |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 444 | config("angle_gl_visibility_config") { |
| 445 | if (is_win) { |
| 446 | defines = [ |
| 447 | "GL_APICALL=", |
| 448 | "GL_API=", |
| 449 | ] |
| 450 | } else { |
| 451 | defines = [ |
| 452 | "GL_APICALL=__attribute__((visibility(\"default\")))", |
| 453 | "GL_API=__attribute__((visibility(\"default\")))", |
| 454 | ] |
Courtney Goeltzenleuchter | e7ece9e | 2018-10-08 16:43:43 -0600 | [diff] [blame] | 455 | } |
Ian Elliott | abcb2b3 | 2018-08-29 17:04:15 -0600 | [diff] [blame] | 456 | } |
| 457 | |
Antonio Caggiano | 7b0f631 | 2022-03-30 14:16:02 +0200 | [diff] [blame] | 458 | config("angle_vulkan_wayland_config") { |
| 459 | if (angle_enable_vulkan && angle_use_wayland && |
| 460 | defined(vulkan_wayland_include_dirs)) { |
| 461 | include_dirs = vulkan_wayland_include_dirs |
| 462 | } |
| 463 | } |
| 464 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 465 | config("angle_gpu_info_util_config") { |
| 466 | include_dirs = [ |
| 467 | "include", |
| 468 | "src", |
| 469 | ] |
| 470 | } |
| 471 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 472 | angle_static_library("angle_gpu_info_util") { |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 473 | public_configs += [ |
| 474 | ":angle_gpu_info_util_config", |
| 475 | ":angle_backend_config", |
| 476 | ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 477 | public_deps = [ ":angle_common" ] |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 478 | sources = libangle_gpu_info_util_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 479 | deps = [] |
| 480 | libs = [] |
| 481 | defines = [] |
| 482 | |
Jamie Madill | d27552f | 2021-11-11 11:43:30 -0500 | [diff] [blame] | 483 | if (angle_build_vulkan_system_info) { |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 484 | sources += libangle_gpu_info_util_vulkan_sources |
Jamie Madill | 48da1c3 | 2021-07-16 13:24:34 -0400 | [diff] [blame] | 485 | deps += [ |
Jamie Madill | 48da1c3 | 2021-07-16 13:24:34 -0400 | [diff] [blame] | 486 | "$angle_vulkan_headers_dir:vulkan_headers", |
Jamie Madill | d27552f | 2021-11-11 11:43:30 -0500 | [diff] [blame] | 487 | "src/common/vulkan:angle_libvulkan_loader", |
| 488 | "src/common/vulkan:angle_vulkan_icd", |
Jamie Madill | 48da1c3 | 2021-07-16 13:24:34 -0400 | [diff] [blame] | 489 | ] |
Geoff Lang | 48da7e7 | 2021-09-07 15:49:07 -0400 | [diff] [blame] | 490 | if (angle_enable_vulkan_system_info) { |
Jamie Madill | d27552f | 2021-11-11 11:43:30 -0500 | [diff] [blame] | 491 | defines += [ "ANGLE_USE_VULKAN_SYSTEM_INFO" ] |
Geoff Lang | 48da7e7 | 2021-09-07 15:49:07 -0400 | [diff] [blame] | 492 | } |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 493 | } |
| 494 | |
Ian Elliott | d07c52e | 2018-06-22 15:42:09 -0600 | [diff] [blame] | 495 | if (is_android) { |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 496 | sources += libangle_gpu_info_util_android_sources |
| 497 | } |
| 498 | |
| 499 | if (is_fuchsia) { |
| 500 | sources += libangle_gpu_info_util_fuchsia_sources |
Antonio Maiorano | 13816d2 | 2020-06-16 14:27:04 -0400 | [diff] [blame] | 501 | deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ] |
Ian Elliott | d07c52e | 2018-06-22 15:42:09 -0600 | [diff] [blame] | 502 | } |
| 503 | |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 504 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 505 | sources += libangle_gpu_info_util_win_sources |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 506 | if (!angle_is_winuwp) { |
| 507 | libs += [ "setupapi.lib" ] |
| 508 | } |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 509 | libs += [ "dxgi.lib" ] |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 510 | } |
| 511 | |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 512 | if (is_linux || is_chromeos) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 513 | sources += libangle_gpu_info_util_linux_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 514 | |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 515 | if (angle_use_x11 && angle_has_build) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 516 | sources += libangle_gpu_info_util_x11_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 517 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
| 518 | defines += [ "GPU_INFO_USE_X11" ] |
| 519 | libs += [ |
| 520 | "X11", |
| 521 | "Xi", |
| 522 | "Xext", |
| 523 | ] |
| 524 | } |
Antonio Caggiano | f6cdd02 | 2021-12-09 16:52:35 +0100 | [diff] [blame] | 525 | |
| 526 | if (angle_use_wayland && angle_has_build) { |
| 527 | public_deps += [ ":angle_wayland" ] |
| 528 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 529 | } |
| 530 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 531 | if (use_libpci) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 532 | sources += libangle_gpu_info_util_libpci_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 533 | defines += [ "GPU_INFO_USE_LIBPCI" ] |
| 534 | libs += [ "pci" ] |
| 535 | } |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 536 | |
Shahbaz Youssefi | 5b8dec5 | 2021-01-12 04:11:56 +0000 | [diff] [blame] | 537 | if (is_apple) { |
Sylvain Defresne | bae95f8 | 2020-07-02 17:19:14 +0200 | [diff] [blame] | 538 | frameworks = [ |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 539 | "IOKit.framework", |
| 540 | "CoreFoundation.framework", |
Corentin Wallez | 163965d | 2017-10-11 11:38:55 -0400 | [diff] [blame] | 541 | "CoreGraphics.framework", |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 542 | ] |
James Darpinian | dea8629 | 2020-12-02 16:26:03 -0800 | [diff] [blame] | 543 | if (angle_enable_eagl) { |
| 544 | frameworks += [ "OpenGLES.framework" ] |
| 545 | } else if (angle_enable_cgl) { |
| 546 | frameworks += [ "OpenGL.framework" ] |
| 547 | } |
| 548 | if (is_mac || angle_enable_cgl) { |
| 549 | sources += libangle_gpu_info_util_mac_sources |
| 550 | } |
| 551 | if (is_ios && !angle_enable_cgl) { |
| 552 | sources += libangle_gpu_info_util_ios_sources |
| 553 | } |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 554 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 555 | } |
| 556 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 557 | angle_source_set("angle_translator_headers") { |
| 558 | sources = angle_translator_exported_headers |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 559 | public_deps = [ ":includes" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 560 | } |
| 561 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 562 | template("translator_lib") { |
| 563 | angle_static_library(target_name) { |
| 564 | sources = angle_translator_sources |
| 565 | defines = [] |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 566 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 567 | _needs_glsl_base = false |
| 568 | _needs_glsl_and_vulkan_base = false |
| 569 | _uses_spirv = false |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 570 | |
Shahbaz Youssefi | 58930a7 | 2021-08-07 22:05:27 -0400 | [diff] [blame] | 571 | # Frontend support: |
| 572 | if (angle_enable_desktop_glsl) { |
| 573 | sources += angle_translator_glsl_symbol_table_sources |
| 574 | } else { |
| 575 | sources += angle_translator_essl_symbol_table_sources |
| 576 | } |
| 577 | |
| 578 | # Backend support: |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 579 | if (angle_enable_essl || use_fuzzing_engine) { |
| 580 | _needs_glsl_base = true |
| 581 | sources += angle_translator_essl_sources |
| 582 | defines += [ "ANGLE_ENABLE_ESSL" ] |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 583 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 584 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 585 | if (angle_enable_glsl || use_fuzzing_engine) { |
| 586 | _needs_glsl_base = true |
| 587 | _needs_glsl_and_vulkan_base = true |
| 588 | sources += angle_translator_glsl_sources |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 589 | defines += [ "ANGLE_ENABLE_GLSL" ] |
| 590 | } |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 591 | |
Shahbaz Youssefi | b8d6f8a | 2021-07-22 22:31:29 -0400 | [diff] [blame] | 592 | if (angle_enable_apple_translator_workarounds) { |
| 593 | sources += angle_translator_apple_sources |
| 594 | defines += [ "ANGLE_ENABLE_APPLE_WORKAROUNDS" ] |
| 595 | } |
| 596 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 597 | if (angle_enable_hlsl || use_fuzzing_engine) { |
| 598 | sources += angle_translator_hlsl_sources |
| 599 | defines += [ "ANGLE_ENABLE_HLSL" ] |
| 600 | } |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 601 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 602 | if (!invoker.gl_d3d_only) { |
| 603 | if (angle_enable_vulkan || use_fuzzing_engine || angle_enable_metal) { |
| 604 | _needs_glsl_base = true |
| 605 | _needs_glsl_and_vulkan_base = true |
| 606 | _uses_spirv = true |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 607 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 608 | # This translator is needed by metal backend also. |
| 609 | sources += angle_translator_lib_vulkan_sources |
| 610 | } |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 611 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 612 | if (angle_enable_vulkan || use_fuzzing_engine) { |
| 613 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 614 | } |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 615 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 616 | if (angle_enable_metal) { |
| 617 | sources += angle_translator_lib_metal_sources |
Kyle Piddington | d7aa013 | 2021-04-26 16:56:15 -0700 | [diff] [blame] | 618 | defines += [ |
| 619 | "ANGLE_ENABLE_METAL", |
| 620 | "ANGLE_ENABLE_METAL_SPIRV", |
| 621 | ] |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 622 | } |
| 623 | } |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 624 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 625 | if (_needs_glsl_base) { |
| 626 | sources += angle_translator_glsl_base_sources |
| 627 | } |
| 628 | if (_needs_glsl_and_vulkan_base) { |
| 629 | sources += angle_translator_glsl_and_vulkan_base_sources |
| 630 | } |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 631 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 632 | public_configs += [ ":external_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 633 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 634 | deps = [ |
| 635 | ":includes", |
| 636 | ":preprocessor", |
Shahbaz Youssefi | 81f03cc | 2021-04-07 15:23:32 -0400 | [diff] [blame] | 637 | "$angle_root/src/common/spirv:angle_spirv_headers", |
Shahbaz Youssefi | 776c601 | 2021-02-26 00:00:57 -0500 | [diff] [blame] | 638 | ] |
Shahbaz Youssefi | 776c601 | 2021-02-26 00:00:57 -0500 | [diff] [blame] | 639 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 640 | if (_uses_spirv) { |
| 641 | deps += [ |
| 642 | "$angle_root/src/common/spirv:angle_spirv_base", |
Shahbaz Youssefi | 9bc837f | 2021-04-07 15:24:12 -0400 | [diff] [blame] | 643 | "$angle_root/src/common/spirv:angle_spirv_builder", |
Shahbaz Youssefi | 9bc837f | 2021-04-07 15:24:12 -0400 | [diff] [blame] | 644 | "${angle_spirv_headers_dir}:spv_headers", |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 645 | "${angle_spirv_tools_dir}:spvtools_headers", |
| 646 | "${angle_spirv_tools_dir}:spvtools_val", |
| 647 | ] |
Shahbaz Youssefi | f3d5dac | 2021-08-23 17:25:15 -0400 | [diff] [blame] | 648 | |
| 649 | if (angle_enable_spirv_gen_through_glslang) { |
| 650 | defines += [ "ANGLE_ENABLE_SPIRV_GENERATION_THROUGH_GLSLANG" ] |
| 651 | sources += [ "src/compiler/translator/glslang_wrapper.cpp" ] |
| 652 | deps += [ |
| 653 | "${angle_glslang_dir}:glslang_default_resource_limits_sources", |
| 654 | "${angle_glslang_dir}:glslang_lib_sources", |
| 655 | ] |
| 656 | } |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 657 | } |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 658 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 659 | public_deps = [ |
| 660 | ":angle_common", |
| 661 | ":angle_translator_headers", |
| 662 | ] |
| 663 | |
| 664 | if (is_win) { |
| 665 | # Necessary to suppress some system header xtree warnings in Release. |
| 666 | # For some reason this warning doesn't get triggered in Chromium |
| 667 | cflags = [ "/wd4718" ] |
| 668 | } |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 669 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 670 | } |
| 671 | |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 672 | translator_lib("translator") { |
| 673 | gl_d3d_only = false |
| 674 | } |
| 675 | |
Shahbaz Youssefi | e2c87b4 | 2021-05-04 11:46:36 -0400 | [diff] [blame] | 676 | if (angle_enable_essl || angle_enable_glsl || angle_enable_hlsl) { |
| 677 | translator_lib("translator_gl_d3d_only") { |
| 678 | gl_d3d_only = true |
| 679 | } |
Shahbaz Youssefi | 0973dd6 | 2021-03-31 11:11:26 -0400 | [diff] [blame] | 680 | } |
| 681 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 682 | angle_source_set("translator_fuzzer") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 683 | sources = [ "src/compiler/fuzz/translator_fuzzer.cpp" ] |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 684 | |
| 685 | include_dirs = [ |
| 686 | "include", |
| 687 | "src", |
| 688 | ] |
| 689 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 690 | deps = [ ":translator" ] |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 691 | } |
| 692 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 693 | config("angle_commit_id_config") { |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 694 | include_dirs = [ "$root_gen_dir/angle" ] |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 695 | visibility = [ ":angle_commit_id" ] |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 696 | } |
| 697 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 698 | action("angle_commit_id") { |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 699 | _commit_id_header = "$root_gen_dir/angle/angle_commit.h" |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 700 | script = "src/commit_id.py" |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 701 | outputs = [ _commit_id_header ] |
| 702 | |
| 703 | visibility = [ ":angle_version" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 704 | |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 705 | # Add git as a dependency if it is available. |
Geoff Lang | 20c6973 | 2020-03-06 11:02:31 -0500 | [diff] [blame] | 706 | if (angle_enable_commit_id && |
| 707 | exec_script("src/commit_id.py", [ "check" ], "value") == 1) { |
Geoff Lang | dd19d55 | 2020-03-02 09:41:22 -0500 | [diff] [blame] | 708 | # commit id should depend on angle's HEAD revision |
| 709 | inputs = [ ".git/HEAD" ] |
Jamie Madill | 5f2ba63 | 2020-08-15 23:50:59 -0400 | [diff] [blame] | 710 | branch = read_file(".git/HEAD", "string") |
| 711 | result = string_split(branch) |
| 712 | if (result[0] == "ref:") { |
Shahbaz Youssefi | 955b462 | 2021-07-01 22:55:59 -0400 | [diff] [blame] | 713 | _ref_file = result[1] |
| 714 | |
| 715 | # If git has packed the contents of .git/refs/heads/ in .git/packed-refs, |
| 716 | # unpack the head before depending on it. |
| 717 | exec_script("src/commit_id.py", |
| 718 | [ |
| 719 | "unpack", |
| 720 | _ref_file, |
| 721 | ], |
| 722 | "") |
| 723 | inputs += [ ".git/" + _ref_file ] |
Jamie Madill | 5f2ba63 | 2020-08-15 23:50:59 -0400 | [diff] [blame] | 724 | } |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 725 | } |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 726 | |
| 727 | args = [ |
| 728 | "gen", |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 729 | rebase_path(_commit_id_header, root_build_dir), |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 730 | ] |
| 731 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 732 | public_configs = [ ":angle_commit_id_config" ] |
| 733 | } |
| 734 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 735 | angle_source_set("angle_version") { |
Jamie Madill | 1b104dd | 2021-05-26 14:29:01 -0400 | [diff] [blame] | 736 | sources = [ "src/common/angle_version.h" ] |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 737 | public_deps = [ ":angle_commit_id" ] |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 738 | visibility = [ ":angle_version_info" ] |
| 739 | |
| 740 | # The version headers are used directly in Windows .RC files. |
| 741 | if (is_win) { |
| 742 | visibility += [ |
| 743 | ":libEGL", |
| 744 | ":libGL", |
| 745 | ":libGLESv1_CM", |
| 746 | ":libGLESv2", |
| 747 | ":libGLESv2_capture_complement", |
| 748 | ] |
| 749 | } |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 750 | } |
| 751 | |
| 752 | angle_source_set("angle_version_info") { |
| 753 | sources = [ |
| 754 | "src/common/angle_version_info.cpp", |
| 755 | "src/common/angle_version_info.h", |
| 756 | ] |
| 757 | deps = [ ":angle_version" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 758 | } |
| 759 | |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 760 | config("angle_backend_config") { |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 761 | defines = [] |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 762 | |
Etienne Bergeron | 9e83c15 | 2020-06-04 19:53:36 -0400 | [diff] [blame] | 763 | if (angle_delegate_workers) { |
| 764 | defines += [ "ANGLE_DELEGATE_WORKERS" ] |
| 765 | } |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 766 | |
Jamie Madill | 54dfb62 | 2021-04-07 12:33:31 -0400 | [diff] [blame] | 767 | if (angle_force_context_check_every_call) { |
| 768 | defines += [ "ANGLE_FORCE_CONTEXT_CHECK_EVERY_CALL=1" ] |
| 769 | } |
| 770 | |
Tim Van Patten | 085044d | 2021-04-08 18:49:05 -0600 | [diff] [blame] | 771 | if (angle_expose_non_conformant_extensions_and_versions) { |
| 772 | defines += [ "ANGLE_EXPOSE_NON_CONFORMANT_EXTENSIONS_AND_VERSIONS" ] |
| 773 | } |
| 774 | |
Brandon Schade | 1760ce3 | 2022-03-03 17:29:12 -0800 | [diff] [blame] | 775 | if (angle_use_spirv_gen_through_glslang) { |
| 776 | defines += [ "ANGLE_USE_SPIRV_GENERATION_THROUGH_GLSLANG" ] |
| 777 | } |
| 778 | |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 779 | configs = [] |
| 780 | |
Jamie Madill | bb96aef | 2020-09-11 13:50:09 -0400 | [diff] [blame] | 781 | if (angle_enable_d3d11) { |
| 782 | configs += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend_config" ] |
| 783 | } |
| 784 | |
| 785 | if (angle_enable_d3d9) { |
| 786 | configs += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend_config" ] |
| 787 | } |
| 788 | |
Jamie Madill | 2d74170 | 2020-09-11 12:30:04 -0400 | [diff] [blame] | 789 | if (angle_enable_gl) { |
| 790 | configs += [ "src/libANGLE/renderer/gl:angle_gl_backend_config" ] |
| 791 | } |
| 792 | |
Jamie Madill | 852f61f | 2020-09-11 11:54:35 -0400 | [diff] [blame] | 793 | if (angle_enable_null) { |
| 794 | configs += [ "src/libANGLE/renderer/null:angle_null_backend_config" ] |
| 795 | } |
| 796 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 797 | if (angle_enable_metal) { |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 798 | configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ] |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 799 | } |
| 800 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 801 | if (angle_enable_vulkan) { |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 802 | configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 803 | } |
James Clarke | 06d194e | 2021-01-10 14:29:44 -0800 | [diff] [blame] | 804 | |
John Plate | 16a919b | 2021-04-27 11:36:11 +0100 | [diff] [blame] | 805 | if (angle_enable_cl_passthrough) { |
| 806 | configs += [ "src/libANGLE/renderer/cl:angle_cl_backend_config" ] |
| 807 | } |
| 808 | |
James Clarke | 06d194e | 2021-01-10 14:29:44 -0800 | [diff] [blame] | 809 | if (angle_is_winuwp) { |
| 810 | configs += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp_config" ] |
| 811 | } |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 812 | } |
| 813 | |
| 814 | config("libANGLE_config") { |
| 815 | cflags = [] |
| 816 | defines = [] |
| 817 | libs = [] |
| 818 | ldflags = [] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 819 | defines += [ "LIBANGLE_IMPLEMENTATION" ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 820 | |
| 821 | if (is_win) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 822 | cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics |
| 823 | # are not enabled. |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 824 | } |
Yuly Novikov | b29fccf | 2018-11-28 10:09:39 -0500 | [diff] [blame] | 825 | |
| 826 | if (is_android && (angle_enable_gl || angle_enable_vulkan)) { |
Yuly Novikov | 8edc68e | 2019-02-12 12:41:01 -0500 | [diff] [blame] | 827 | # In API level 26 ANativeWindow APIs were moved from libandroid.so |
| 828 | # into a separate library, libnativewindow.so |
| 829 | if (ndk_api_level_at_least_26) { |
Yuly Novikov | b29fccf | 2018-11-28 10:09:39 -0500 | [diff] [blame] | 830 | libs += [ "nativewindow" ] |
| 831 | } else { |
| 832 | libs += [ "android" ] |
| 833 | } |
| 834 | } |
Michael Spang | 7cd5f64 | 2019-08-21 20:03:49 -0400 | [diff] [blame] | 835 | |
Ethan Lee | d22b8be | 2019-11-15 12:26:39 -0500 | [diff] [blame] | 836 | if (angle_use_x11) { |
Michael Spang | 7cd5f64 | 2019-08-21 20:03:49 -0400 | [diff] [blame] | 837 | defines += [ "ANGLE_USE_X11" ] |
| 838 | } |
Jamie Madill | af5e382 | 2020-01-28 10:05:36 -0500 | [diff] [blame] | 839 | |
Antonio Caggiano | f6cdd02 | 2021-12-09 16:52:35 +0100 | [diff] [blame] | 840 | if (angle_use_wayland) { |
| 841 | defines += [ "ANGLE_USE_WAYLAND" ] |
| 842 | } |
| 843 | |
Jamie Madill | af5e382 | 2020-01-28 10:05:36 -0500 | [diff] [blame] | 844 | if (angle_enable_overlay) { |
| 845 | defines += [ "ANGLE_ENABLE_OVERLAY=1" ] |
| 846 | } |
Tim Van Patten | ee4e086 | 2020-09-24 11:39:49 -0600 | [diff] [blame] | 847 | if (angle_enable_perf_counter_output) { |
| 848 | defines += [ "ANGLE_ENABLE_PERF_COUNTER_OUTPUT=1" ] |
| 849 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 850 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 851 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 852 | angle_source_set("libANGLE_headers") { |
| 853 | sources = libangle_headers |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 854 | if (angle_enable_cl) { |
| 855 | sources += libangle_cl_headers |
| 856 | } |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 857 | public_deps = [ |
| 858 | ":angle_common", |
| 859 | ":angle_translator_headers", |
| 860 | ] |
Jamie Madill | af5e382 | 2020-01-28 10:05:36 -0500 | [diff] [blame] | 861 | public_configs += [ ":libANGLE_config" ] |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 862 | } |
| 863 | |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 864 | # Don't even try to build glslang if Metal and Vulkan are disabled. |
| 865 | if (angle_enable_vulkan || angle_enable_metal) { |
| 866 | angle_source_set("angle_glslang_wrapper") { |
| 867 | sources = [ |
Kyle Piddington | c4a9d41 | 2022-01-05 15:28:11 -0800 | [diff] [blame] | 868 | "src/libANGLE/renderer/ShaderInterfaceVariableInfoMap.cpp", |
| 869 | "src/libANGLE/renderer/ShaderInterfaceVariableInfoMap.h", |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 870 | "src/libANGLE/renderer/glslang_wrapper_utils.cpp", |
| 871 | "src/libANGLE/renderer/glslang_wrapper_utils.h", |
| 872 | ] |
| 873 | deps = [ |
| 874 | ":libANGLE_headers", |
Shahbaz Youssefi | da4aa8b | 2021-02-25 16:26:53 -0500 | [diff] [blame] | 875 | "$angle_root/src/common/spirv:angle_spirv_base", |
Shahbaz Youssefi | 6689a54 | 2021-01-21 00:36:14 -0500 | [diff] [blame] | 876 | "$angle_root/src/common/spirv:angle_spirv_builder", |
Shahbaz Youssefi | 81f03cc | 2021-04-07 15:23:32 -0400 | [diff] [blame] | 877 | "$angle_root/src/common/spirv:angle_spirv_headers", |
Shahbaz Youssefi | 6689a54 | 2021-01-21 00:36:14 -0500 | [diff] [blame] | 878 | "$angle_root/src/common/spirv:angle_spirv_parser", |
Shahbaz Youssefi | 71e6afb | 2020-01-14 14:12:31 -0500 | [diff] [blame] | 879 | "${angle_spirv_headers_dir}:spv_headers", |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 880 | ] |
| 881 | } |
Le Quyen | a48f95a | 2019-10-14 14:49:49 +0800 | [diff] [blame] | 882 | } |
| 883 | |
Jamie Madill | 23b1674 | 2021-09-14 10:29:14 -0400 | [diff] [blame] | 884 | if ((is_win && angle_enable_gl) || angle_enable_d3d11 || angle_enable_d3d9) { |
Jamie Madill | 4d3a0f6 | 2020-09-11 12:36:05 -0400 | [diff] [blame] | 885 | angle_source_set("angle_d3d_format_tables") { |
| 886 | sources = [ |
| 887 | "src/libANGLE/renderer/dxgi_format_map.h", |
| 888 | "src/libANGLE/renderer/dxgi_format_map_autogen.cpp", |
| 889 | "src/libANGLE/renderer/dxgi_support_table.h", |
| 890 | "src/libANGLE/renderer/dxgi_support_table_autogen.cpp", |
| 891 | ] |
| 892 | |
| 893 | if (!angle_is_winuwp) { |
| 894 | sources += [ |
| 895 | "src/libANGLE/renderer/d3d_format.cpp", |
| 896 | "src/libANGLE/renderer/d3d_format.h", |
| 897 | ] |
| 898 | } |
| 899 | |
| 900 | public_deps = [ ":libANGLE_headers" ] |
| 901 | configs += [ ":angle_backend_config" ] |
| 902 | } |
| 903 | } |
| 904 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 905 | angle_source_set("libANGLE_base") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 906 | sources = libangle_sources |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 907 | if (angle_enable_cl) { |
| 908 | sources += libangle_cl_sources |
| 909 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 910 | |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 911 | include_dirs = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 912 | libs = [] |
Corentin Wallez | 64598b5 | 2016-11-11 08:25:44 -0500 | [diff] [blame] | 913 | defines = [] |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 914 | if (angle_link_glx) { |
| 915 | libs += [ "GL" ] |
| 916 | defines += [ "ANGLE_LINK_GLX" ] |
| 917 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 918 | public_deps = [ |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 919 | ":angle_common", |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 920 | ":angle_gpu_info_util", |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 921 | ":angle_version_info", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 922 | ":libANGLE_headers", |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 923 | ":translator", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 924 | ] |
| 925 | deps = [ |
Tim Van Patten | b55f0f7 | 2020-06-02 18:01:24 -0600 | [diff] [blame] | 926 | ":angle_compression", |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 927 | ":angle_image_util", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 928 | ":includes", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 929 | ] |
| 930 | |
James Clarke | 06d194e | 2021-01-10 14:29:44 -0800 | [diff] [blame] | 931 | if (is_win && !angle_is_winuwp) { |
Jamie Madill | e55374f | 2019-10-24 12:55:12 -0400 | [diff] [blame] | 932 | libs += [ |
Jamie Madill | e55374f | 2019-10-24 12:55:12 -0400 | [diff] [blame] | 933 | "gdi32.lib", |
| 934 | "user32.lib", |
| 935 | ] |
| 936 | } |
| 937 | |
Jamie Madill | bb96aef | 2020-09-11 13:50:09 -0400 | [diff] [blame] | 938 | if (angle_enable_d3d11) { |
| 939 | public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend" ] |
| 940 | } |
| 941 | |
| 942 | if (angle_enable_d3d9) { |
| 943 | public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend" ] |
| 944 | } |
| 945 | |
Jamie Madill | 2d74170 | 2020-09-11 12:30:04 -0400 | [diff] [blame] | 946 | if (angle_enable_gl) { |
| 947 | public_deps += [ "src/libANGLE/renderer/gl:angle_gl_backend" ] |
| 948 | } |
| 949 | |
Jamie Madill | 852f61f | 2020-09-11 11:54:35 -0400 | [diff] [blame] | 950 | if (angle_enable_null) { |
| 951 | public_deps += [ "src/libANGLE/renderer/null:angle_null_backend" ] |
| 952 | } |
| 953 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 954 | if (angle_enable_vulkan) { |
| 955 | public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ] |
| 956 | } |
| 957 | |
James Clarke | 06d194e | 2021-01-10 14:29:44 -0800 | [diff] [blame] | 958 | if (angle_is_winuwp) { |
| 959 | public_deps += [ "src/libANGLE/renderer/d3d:angle_enable_winuwp" ] |
| 960 | } |
| 961 | |
| 962 | if (angle_enable_d3d11) { |
| 963 | libs += [ "dxguid.lib" ] |
| 964 | } |
| 965 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 966 | if (angle_enable_metal) { |
| 967 | public_deps += [ "src/libANGLE/renderer/metal:angle_metal_backend" ] |
| 968 | } |
| 969 | |
John Plate | 16a919b | 2021-04-27 11:36:11 +0100 | [diff] [blame] | 970 | if (angle_enable_cl_passthrough) { |
| 971 | public_deps += [ "src/libANGLE/renderer/cl:angle_cl_backend" ] |
| 972 | } |
| 973 | |
Jamie Madill | ab2bfa8 | 2019-01-15 19:06:47 -0500 | [diff] [blame] | 974 | # Enable extra Chromium style warnings for libANGLE. |
Sylvain Defresne | 5ae7342 | 2021-11-09 16:26:10 +0100 | [diff] [blame] | 975 | if (is_clang && angle_has_build) { |
Jamie Madill | ab2bfa8 | 2019-01-15 19:06:47 -0500 | [diff] [blame] | 976 | suppressed_configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 977 | } |
| 978 | |
Shahbaz Youssefi | 5b8dec5 | 2021-01-12 04:11:56 +0000 | [diff] [blame] | 979 | if (is_apple) { |
Geoff Lang | ecd2e3b | 2019-07-09 15:39:39 -0400 | [diff] [blame] | 980 | sources += libangle_mac_sources |
| 981 | } |
| 982 | |
Kyle Piddington | d33a222 | 2021-04-26 16:56:15 -0700 | [diff] [blame] | 983 | if (is_ios) { |
| 984 | sources += [ "src/libANGLE/renderer/driver_utils_ios.mm" ] |
| 985 | } |
| 986 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 987 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 988 | defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 989 | } |
| 990 | |
Tim Van Patten | e28083a | 2021-11-09 18:00:17 -0700 | [diff] [blame] | 991 | # If VVL are enabled, enable RenderDoc capture as well. |
| 992 | if (angle_enable_vulkan_validation_layers) { |
| 993 | defines += [ "ANGLE_TEST_ENABLE_RENDERDOC_CAPTURE" ] |
| 994 | } |
| 995 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 996 | configs += [ ":debug_annotations_config" ] |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 997 | public_configs += [ |
| 998 | ":libANGLE_config", |
| 999 | ":angle_backend_config", |
| 1000 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1001 | |
Tom Tan | 5c31753 | 2018-11-30 17:01:01 -0800 | [diff] [blame] | 1002 | # Windows ARM64 is available since 10.0.16299 so no need to copy |
| 1003 | # d3dcompiler_47.dll because this file is available as inbox. |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1004 | if (_use_copy_compiler_dll) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1005 | data_deps = [ ":copy_compiler_dll" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1006 | } |
| 1007 | } |
| 1008 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1009 | config("angle_frame_capture_disabled") { |
| 1010 | defines = [ "ANGLE_CAPTURE_ENABLED=0" ] |
| 1011 | } |
| 1012 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1013 | angle_source_set("libANGLE") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1014 | public_deps = [ ":libANGLE_base" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1015 | public_configs = [ ":angle_frame_capture_disabled" ] |
Jamie Madill | 67e4aff | 2021-04-02 13:17:00 -0400 | [diff] [blame] | 1016 | sources = [ |
| 1017 | "src/libANGLE/capture/FrameCapture_mock.cpp", |
| 1018 | "src/libANGLE/capture/frame_capture_utils_mock.cpp", |
| 1019 | ] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 1020 | |
| 1021 | # gl_enum_utils defaults included in with_capture build |
Jamie Madill | 8d412db | 2020-08-29 22:25:18 +0000 | [diff] [blame] | 1022 | deps = [] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 1023 | if (angle_enable_trace || is_debug) { |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 1024 | deps += [ ":angle_gl_enum_utils" ] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 1025 | } |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1026 | } |
| 1027 | |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 1028 | angle_source_set("angle_gl_enum_utils") { |
Alexey Knyazev | 47279c7 | 2021-08-15 23:20:32 +0400 | [diff] [blame] | 1029 | deps = [ ":angle_common" ] |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 1030 | sources = [ |
Jamie Madill | 6fc1038 | 2021-02-10 11:20:16 -0500 | [diff] [blame] | 1031 | "src/libANGLE/capture/gl_enum_utils.cpp", |
Alexey Knyazev | 47279c7 | 2021-08-15 23:20:32 +0400 | [diff] [blame] | 1032 | "src/libANGLE/capture/gl_enum_utils.h", |
Jamie Madill | 6fc1038 | 2021-02-10 11:20:16 -0500 | [diff] [blame] | 1033 | "src/libANGLE/capture/gl_enum_utils_autogen.cpp", |
Alexey Knyazev | 47279c7 | 2021-08-15 23:20:32 +0400 | [diff] [blame] | 1034 | "src/libANGLE/capture/gl_enum_utils_autogen.h", |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 1035 | ] |
| 1036 | } |
| 1037 | |
Antonio Caggiano | f6cdd02 | 2021-12-09 16:52:35 +0100 | [diff] [blame] | 1038 | if (angle_use_wayland) { |
| 1039 | config("angle_wayland_config") { |
| 1040 | if (!defined(use_system_libwayland) || use_system_libwayland) { |
| 1041 | libs = [ |
| 1042 | "wayland-client", |
| 1043 | "wayland-egl", |
| 1044 | ] |
| 1045 | } |
| 1046 | |
| 1047 | include_dirs = [ |
| 1048 | "$angle_wayland_dir/egl", |
| 1049 | "$angle_wayland_dir/src", |
| 1050 | |
| 1051 | # In case we are building with chromium, we need to take into account the case |
| 1052 | # where wayland-egl-backend.h is not installed in the system include directories |
| 1053 | "//third_party/wayland/src/egl", |
| 1054 | ] |
| 1055 | } |
| 1056 | |
| 1057 | group("angle_wayland") { |
| 1058 | public_configs = [ ":angle_wayland_config" ] |
| 1059 | |
| 1060 | if (defined(use_system_libwayland) && !use_system_libwayland) { |
| 1061 | # Use chromium third-party targets |
| 1062 | public_deps = [ |
| 1063 | "//third_party/wayland:wayland_client", |
| 1064 | "//third_party/wayland:wayland_egl", |
| 1065 | ] |
| 1066 | } |
| 1067 | } |
| 1068 | } |
| 1069 | |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 1070 | if (!defined(angle_abseil_cpp_dir)) { |
| 1071 | angle_abseil_cpp_dir = "//third_party/abseil-cpp" |
| 1072 | } |
| 1073 | |
| 1074 | config("angle_abseil_config") { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 1075 | if (angle_enable_abseil) { |
| 1076 | defines = [ "ANGLE_USE_ABSEIL" ] |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 1077 | |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 1078 | configs = [ |
| 1079 | "$angle_abseil_cpp_dir:absl_define_config", |
| 1080 | "$angle_abseil_cpp_dir:absl_include_config", |
| 1081 | ] |
| 1082 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 1083 | } |
| 1084 | |
| 1085 | group("angle_abseil") { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 1086 | if (angle_enable_abseil) { |
| 1087 | # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while |
| 1088 | # we can be more specific when building standalone ANGLE. |
Tim Van Patten | 36f0464 | 2020-10-08 14:45:51 -0600 | [diff] [blame] | 1089 | if (build_with_chromium || is_component_build) { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 1090 | public_deps = [ "$angle_abseil_cpp_dir:absl" ] |
| 1091 | } else { |
Shahbaz Youssefi | 8f77e0b | 2021-07-29 15:54:26 -0400 | [diff] [blame] | 1092 | public_deps = [ |
| 1093 | "$angle_abseil_cpp_dir/absl/container:flat_hash_map", |
| 1094 | "$angle_abseil_cpp_dir/absl/container:flat_hash_set", |
| 1095 | ] |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 1096 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 1097 | |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 1098 | public_configs = [ ":angle_abseil_config" ] |
| 1099 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 1100 | } |
| 1101 | |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 1102 | config("angle_compression_config") { |
| 1103 | include_dirs = [ "//third_party/zlib/google" ] |
| 1104 | } |
| 1105 | |
| 1106 | group("angle_compression") { |
| 1107 | public_configs = [ |
| 1108 | ":angle_compression_config", |
| 1109 | "//third_party/zlib:zlib_config", |
| 1110 | ] |
Jamie Madill | 35d3c41 | 2020-08-26 12:59:18 -0400 | [diff] [blame] | 1111 | public_deps = |
| 1112 | [ "$angle_zlib_compression_utils_dir:compression_utils_portable" ] |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 1113 | } |
| 1114 | |
Tim Van Patten | 7753c83 | 2021-06-18 14:25:40 -0600 | [diff] [blame] | 1115 | if (angle_has_rapidjson) { |
Jamie Madill | 67e4aff | 2021-04-02 13:17:00 -0400 | [diff] [blame] | 1116 | config("angle_rapidjson_config") { |
| 1117 | defines = [ "ANGLE_HAS_RAPIDJSON" ] |
Gert Wollny | b3a8033 | 2021-03-31 09:34:00 +0200 | [diff] [blame] | 1118 | } |
Jamie Madill | 67e4aff | 2021-04-02 13:17:00 -0400 | [diff] [blame] | 1119 | angle_source_set("angle_json_serializer") { |
| 1120 | public_deps = [ |
Jamie Madill | 0004ecc | 2021-09-22 13:39:55 -0400 | [diff] [blame] | 1121 | ":angle_common", |
Jamie Madill | 67e4aff | 2021-04-02 13:17:00 -0400 | [diff] [blame] | 1122 | "$angle_root/third_party/rapidjson", |
| 1123 | ] |
| 1124 | sources = [ |
Jamie Madill | 1af5c46 | 2021-09-14 14:40:49 -0400 | [diff] [blame] | 1125 | "src/common/serializer/JsonSerializer.cpp", |
| 1126 | "src/common/serializer/JsonSerializer.h", |
Jamie Madill | 67e4aff | 2021-04-02 13:17:00 -0400 | [diff] [blame] | 1127 | ] |
| 1128 | public_configs = [ ":angle_rapidjson_config" ] |
| 1129 | } |
Gert Wollny | e0b9d4f | 2021-03-15 11:25:39 +0100 | [diff] [blame] | 1130 | } |
| 1131 | |
Jamie Madill | 1a3b17d | 2021-09-09 17:26:56 -0400 | [diff] [blame] | 1132 | assert(angle_has_frame_capture || !angle_with_capture_by_default) |
| 1133 | if (angle_has_frame_capture) { |
| 1134 | config("angle_frame_capture_enabled") { |
| 1135 | defines = [ "ANGLE_CAPTURE_ENABLED=1" ] |
| 1136 | } |
Jamie Madill | 67e4aff | 2021-04-02 13:17:00 -0400 | [diff] [blame] | 1137 | |
Jamie Madill | 1a3b17d | 2021-09-09 17:26:56 -0400 | [diff] [blame] | 1138 | angle_source_set("libANGLE_with_capture") { |
| 1139 | public_deps = [ ":libANGLE_base" ] |
| 1140 | deps = [ ":angle_compression" ] |
| 1141 | public_configs = [ ":angle_frame_capture_enabled" ] |
| 1142 | sources = libangle_capture_sources |
| 1143 | |
| 1144 | if (angle_has_rapidjson) { |
| 1145 | public_deps += [ ":angle_json_serializer" ] |
| 1146 | sources += [ "src/libANGLE/capture/frame_capture_utils.cpp" ] |
| 1147 | } else { |
| 1148 | sources += [ "src/libANGLE/capture/frame_capture_utils_mock.cpp" ] |
| 1149 | } |
Jamie Madill | 67e4aff | 2021-04-02 13:17:00 -0400 | [diff] [blame] | 1150 | } |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1151 | } |
| 1152 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 1153 | config("shared_library_public_config") { |
James Darpinian | 0dbe7cd | 2020-12-08 12:24:35 -0800 | [diff] [blame] | 1154 | if (is_mac && !is_component_build) { |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 1155 | # Executable targets that depend on the shared libraries below need to have |
| 1156 | # the rpath setup in non-component build configurations. |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 1157 | ldflags = [ |
| 1158 | "-rpath", |
| 1159 | "@executable_path/", |
| 1160 | ] |
Jonah Ryan-Davis | 90a8af3 | 2020-03-05 13:48:47 -0500 | [diff] [blame] | 1161 | if (build_with_chromium) { |
| 1162 | ldflags += [ |
| 1163 | # Path for loading shared libraries for unbundled binaries. |
| 1164 | # From //build/config/mac/BUILD.gn, this is only added for |
| 1165 | # component builds. However, since ANGLE always dynamically |
| 1166 | # links to libvulkan, it should be re-added for non-component |
| 1167 | # builds. (anglebug.com/4455) |
| 1168 | "-Wl,-rpath,@loader_path/.", |
| 1169 | ] |
| 1170 | } |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 1171 | } |
Josh Matthews | 732c9d0 | 2019-11-29 13:59:03 -0500 | [diff] [blame] | 1172 | |
| 1173 | if (angle_is_winuwp) { |
| 1174 | ldflags = [ |
| 1175 | "/APPCONTAINER", |
| 1176 | |
| 1177 | # Disable warning about invalid subsystem number. |
| 1178 | # A default appropriate subsystem is selected automatically. |
| 1179 | "/IGNORE:4010", |
| 1180 | ] |
| 1181 | } |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 1182 | } |
| 1183 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1184 | config("library_name_config") { |
Yuly Novikov | 8b8dc56 | 2020-02-26 19:09:31 -0500 | [diff] [blame] | 1185 | if (is_component_build && is_android) { |
| 1186 | defines = [ |
| 1187 | "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}.cr\"", |
| 1188 | "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}.cr\"", |
| 1189 | ] |
| 1190 | } else { |
| 1191 | defines = [ |
| 1192 | "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"", |
| 1193 | "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"", |
| 1194 | ] |
| 1195 | } |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1196 | } |
| 1197 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1198 | # This config controls export definitions on ANGLE API calls. |
| 1199 | config("angle_static") { |
| 1200 | defines = [ |
| 1201 | "ANGLE_EXPORT=", |
Peng Huang | e99828e | 2021-02-16 19:13:44 -0500 | [diff] [blame] | 1202 | "ANGLE_STATIC=1", |
Jamie Madill | ba319ba | 2018-12-29 10:29:33 -0500 | [diff] [blame] | 1203 | "ANGLE_UTIL_EXPORT=", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1204 | "EGLAPI=", |
| 1205 | "GL_APICALL=", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1206 | "GL_API=", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1207 | ] |
| 1208 | } |
| 1209 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1210 | set_defaults("angle_libGLESv2") { |
| 1211 | sources = [] |
| 1212 | output_name = "libGLESv2" |
| 1213 | } |
| 1214 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1215 | template("angle_libGLESv2") { |
| 1216 | angle_shared_library(target_name) { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1217 | sources = libglesv2_sources + invoker.sources |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 1218 | if (angle_enable_cl) { |
| 1219 | sources += libglesv2_cl_sources |
| 1220 | } |
Shahbaz Youssefi | 7defdb6 | 2021-10-19 14:07:07 +0000 | [diff] [blame] | 1221 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1222 | output_name = "${invoker.output_name}${angle_libs_suffix}" |
Craig Stout | 2413621 | 2021-11-08 14:01:34 -0800 | [diff] [blame] | 1223 | if (angle_glesv2_extension != "") { |
| 1224 | output_extension = angle_glesv2_extension |
| 1225 | } |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1226 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1227 | configs += [ |
| 1228 | ":angle_gl_visibility_config", |
| 1229 | ":debug_annotations_config", |
| 1230 | ":gl_prototypes", |
| 1231 | ] |
| 1232 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1233 | defines = [ "LIBGLESV2_IMPLEMENTATION" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1234 | |
Shahbaz Youssefi | 7defdb6 | 2021-10-19 14:07:07 +0000 | [diff] [blame] | 1235 | deps = invoker.deps + [ ":includes" ] |
| 1236 | |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 1237 | if (is_win) { |
| 1238 | sources += [ |
| 1239 | "src/libGLESv2/${invoker.output_name}_autogen.def", |
| 1240 | "src/libGLESv2/libGLESv2.rc", |
| 1241 | ] |
| 1242 | deps += [ ":angle_version" ] |
| 1243 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 1244 | } |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1245 | } |
John Abd-El-Malek | 657cd68 | 2014-11-05 14:04:19 -0800 | [diff] [blame] | 1246 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1247 | angle_libGLESv2("libGLESv2") { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1248 | if (angle_with_capture_by_default) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1249 | deps = [ ":libANGLE_with_capture" ] |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 1250 | } else { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1251 | deps = [ ":libANGLE" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1252 | } |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1253 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 1254 | |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 1255 | # Output capture lib when `angle_with_capture_by_default` disabled, vice versa. |
Jamie Madill | 1a3b17d | 2021-09-09 17:26:56 -0400 | [diff] [blame] | 1256 | if (angle_has_frame_capture) { |
| 1257 | angle_libGLESv2("libGLESv2_capture_complement") { |
| 1258 | if (angle_with_capture_by_default) { |
| 1259 | deps = [ ":libANGLE" ] |
| 1260 | output_name += "_no_capture" |
| 1261 | } else { |
| 1262 | deps = [ ":libANGLE_with_capture" ] |
| 1263 | output_name += "_with_capture" |
| 1264 | } |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 1265 | } |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1266 | } |
| 1267 | |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 1268 | if (is_win && !angle_is_winuwp) { |
Clemen Deng | cb8b4a5 | 2019-07-04 16:05:25 -0400 | [diff] [blame] | 1269 | angle_shared_library("libGL") { |
| 1270 | sources = libgl_sources |
Clemen Deng | 663b048 | 2019-07-11 12:37:35 -0400 | [diff] [blame] | 1271 | |
Clemen Deng | 6e7dd1e | 2019-07-16 13:41:59 -0400 | [diff] [blame] | 1272 | output_name = "openGL32" |
| 1273 | output_dir = "$root_out_dir/angle_libs" |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 1274 | |
| 1275 | configs += [ |
| 1276 | ":angle_gl_visibility_config", |
| 1277 | ":debug_annotations_config", |
| 1278 | ":gl_prototypes", |
| 1279 | ] |
| 1280 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1281 | defines = [ |
| 1282 | "ANGLE_CAPTURE_ENABLED=0", |
Clemen Deng | cb8b4a5 | 2019-07-04 16:05:25 -0400 | [diff] [blame] | 1283 | "LIBGL_IMPLEMENTATION", |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1284 | ] |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 1285 | |
| 1286 | deps = [ |
| 1287 | ":includes", |
| 1288 | ":libANGLE", |
| 1289 | ] |
Shahbaz Youssefi | 7defdb6 | 2021-10-19 14:07:07 +0000 | [diff] [blame] | 1290 | |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 1291 | if (is_win) { |
| 1292 | deps += [ ":angle_version" ] |
| 1293 | } |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 1294 | } |
| 1295 | } |
| 1296 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1297 | angle_static_library("libGLESv2_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1298 | sources = libglesv2_sources |
John Plate | e25f3b1 | 2021-04-21 21:43:46 +0100 | [diff] [blame] | 1299 | if (angle_enable_cl) { |
| 1300 | sources += libglesv2_cl_sources |
| 1301 | } |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1302 | configs += [ ":debug_annotations_config" ] |
James Clarke | 06d194e | 2021-01-10 14:29:44 -0800 | [diff] [blame] | 1303 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1304 | public_configs += [ ":angle_static" ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1305 | deps = [ ":includes" ] |
| 1306 | public_deps = [ ":libANGLE" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1307 | } |
| 1308 | |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1309 | angle_shared_library("libGLESv1_CM") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1310 | sources = libglesv1_cm_sources |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1311 | output_name = "libGLESv1_CM${angle_libs_suffix}" |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1312 | |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1313 | configs += [ |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 1314 | ":angle_gl_visibility_config", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1315 | ":debug_annotations_config", |
Jamie Madill | ba319ba | 2018-12-29 10:29:33 -0500 | [diff] [blame] | 1316 | ":gl_prototypes", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1317 | ] |
| 1318 | |
| 1319 | defines = [] |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1320 | |
| 1321 | deps = [ |
| 1322 | ":includes", |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1323 | ":libGLESv2", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1324 | ] |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 1325 | |
| 1326 | if (is_win) { |
| 1327 | sources += [ "src/libGLESv1_CM/libGLESv1_CM.def" ] |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 1328 | deps += [ ":angle_version" ] |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 1329 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1330 | } |
| 1331 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1332 | config("libEGL_egl_loader_config") { |
| 1333 | defines = [ "ANGLE_USE_EGL_LOADER" ] |
| 1334 | } |
| 1335 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1336 | angle_source_set("libEGL_egl_loader") { |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1337 | sources = [ |
| 1338 | "src/libEGL/egl_loader_autogen.cpp", |
| 1339 | "src/libEGL/egl_loader_autogen.h", |
| 1340 | ] |
| 1341 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1342 | public_configs += [ |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1343 | ":libEGL_egl_loader_config", |
| 1344 | ":gl_prototypes", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1345 | ] |
| 1346 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1347 | deps = [ ":includes" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1348 | } |
| 1349 | |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1350 | angle_shared_library("libEGL") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1351 | sources = libegl_sources |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 1352 | if (is_win) { |
| 1353 | sources += [ "src/libEGL/libEGL.rc" ] |
| 1354 | } |
| 1355 | |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1356 | output_name = "libEGL${angle_libs_suffix}" |
Craig Stout | 2413621 | 2021-11-08 14:01:34 -0800 | [diff] [blame] | 1357 | if (angle_egl_extension != "") { |
| 1358 | output_extension = angle_egl_extension |
| 1359 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1360 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1361 | configs += [ |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 1362 | ":debug_annotations_config", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1363 | ":library_name_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1364 | ] |
| 1365 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 1366 | defines = [ "LIBEGL_IMPLEMENTATION" ] |
Yuly Novikov | a4ab580 | 2016-12-19 17:44:22 -0500 | [diff] [blame] | 1367 | if (is_win) { |
| 1368 | defines += [ "EGLAPI=" ] |
| 1369 | } else { |
| 1370 | defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ] |
| 1371 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1372 | |
| 1373 | deps = [ |
James Darpinian | 22ec7dc | 2019-08-06 10:10:52 -0700 | [diff] [blame] | 1374 | ":angle_common", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1375 | ":libEGL_egl_loader", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1376 | ] |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 1377 | |
Jamie Madill | d8c18ac | 2021-10-08 13:00:19 -0400 | [diff] [blame] | 1378 | if (is_win) { |
| 1379 | sources += [ "src/libEGL/libEGL_autogen.def" ] |
| 1380 | deps += [ ":angle_version" ] |
| 1381 | } |
| 1382 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1383 | public_deps = [ ":includes" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1384 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1385 | data_deps = [ ":libGLESv2" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1386 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 1387 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1388 | angle_static_library("libEGL_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1389 | sources = libegl_sources |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 1390 | configs += [ |
| 1391 | ":debug_annotations_config", |
| 1392 | ":library_name_config", |
| 1393 | ] |
| 1394 | public_configs += [ ":angle_static" ] |
| 1395 | deps = [ |
| 1396 | ":includes", |
| 1397 | ":libGLESv2_static", |
| 1398 | ] |
| 1399 | } |
| 1400 | |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1401 | # Convenience targets for some of the samples so they can be built |
| 1402 | # with Chromium's toolchain. |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1403 | angle_executable("angle_shader_translator") { |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1404 | testonly = true |
| 1405 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1406 | sources = [ "samples/shader_translator/shader_translator.cpp" ] |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1407 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1408 | deps = [ ":translator" ] |
Shahbaz Youssefi | 776c601 | 2021-02-26 00:00:57 -0500 | [diff] [blame] | 1409 | |
| 1410 | defines = [] |
| 1411 | |
| 1412 | if (angle_enable_vulkan) { |
| 1413 | deps += [ |
| 1414 | "${angle_spirv_tools_dir}:spvtools_headers", |
| 1415 | "${angle_spirv_tools_dir}:spvtools_val", |
| 1416 | ] |
| 1417 | |
| 1418 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 1419 | } |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1420 | } |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 1421 | |
Stephen White | f4cd174 | 2020-12-21 09:57:58 -0500 | [diff] [blame] | 1422 | if (angle_standalone || build_with_chromium) { |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1423 | config("angle_feature_support_config") { |
| 1424 | include_dirs = [ |
| 1425 | "include", |
| 1426 | "src", |
| 1427 | ] |
| 1428 | defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ] |
| 1429 | if (is_debug) { |
| 1430 | defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ] |
| 1431 | } |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1432 | } |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 1433 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1434 | angle_shared_library("libfeature_support") { |
| 1435 | output_name = "libfeature_support${angle_libs_suffix}" |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1436 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1437 | if (is_android) { |
| 1438 | libs = [ "log" ] |
| 1439 | } |
| 1440 | |
Yuly Novikov | 52afb6f | 2021-01-26 22:22:07 -0500 | [diff] [blame] | 1441 | configs += [ |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1442 | ":angle_feature_support_config", |
| 1443 | "${angle_jsoncpp_dir}:jsoncpp_config", |
| 1444 | ] |
| 1445 | |
Shahbaz Youssefi | 5b8dec5 | 2021-01-12 04:11:56 +0000 | [diff] [blame] | 1446 | if (is_apple && !is_component_build) { |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1447 | ldflags = [ |
| 1448 | "-install_name", |
| 1449 | "@rpath/${target_name}.dylib", |
| 1450 | ] |
| 1451 | } |
| 1452 | |
| 1453 | sources = [ |
| 1454 | "src/feature_support_util/feature_support_util.cpp", |
| 1455 | "src/feature_support_util/feature_support_util.h", |
| 1456 | ] |
| 1457 | |
| 1458 | deps = [ |
| 1459 | ":angle_gpu_info_util", |
| 1460 | "${angle_jsoncpp_dir}:jsoncpp", |
Cezary Kulakowski | 4fb738f | 2019-02-01 10:53:44 +0100 | [diff] [blame] | 1461 | ] |
| 1462 | } |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1463 | } |
| 1464 | |
Kimmo Kinnunen | ba04fcf | 2022-03-11 13:58:52 +0200 | [diff] [blame] | 1465 | if (angle_enable_cgl) { |
| 1466 | config("supports_automatic_graphics_switching") { |
| 1467 | # For discussion about config, inputs, etc, see: |
| 1468 | # https://bugs.chromium.org/p/chromium/issues/detail?id=781858 |
| 1469 | _plist_file = "util/osx/supports_automatic_graphics_switching.plist" |
| 1470 | inputs = [ _plist_file ] |
| 1471 | ldflags = [ |
| 1472 | "-sectcreate", |
| 1473 | "__TEXT", |
| 1474 | "__info_plist", |
| 1475 | rebase_path(_plist_file, root_build_dir), |
| 1476 | ] |
| 1477 | } |
| 1478 | } |
| 1479 | |
Yuly Novikov | 3ad3a9a | 2021-04-01 17:40:26 -0400 | [diff] [blame] | 1480 | if (is_android && symbol_level != 0) { |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1481 | action_foreach("compressed_symbols") { |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1482 | sources = [] |
| 1483 | foreach(_library, angle_libraries) { |
Yuly Novikov | 3ad3a9a | 2021-04-01 17:40:26 -0400 | [diff] [blame] | 1484 | if (is_component_build) { |
| 1485 | sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.cr.so" ] |
| 1486 | } else { |
| 1487 | sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.so" ] |
| 1488 | } |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1489 | } |
| 1490 | if (angle_enable_vulkan_validation_layers) { |
| 1491 | foreach(_layer, vulkan_validation_layers) { |
Yuly Novikov | 3ad3a9a | 2021-04-01 17:40:26 -0400 | [diff] [blame] | 1492 | if (is_component_build) { |
| 1493 | sources += [ "$root_out_dir/lib${_layer}.cr.so" ] |
| 1494 | } else { |
| 1495 | sources += [ "$root_out_dir/lib${_layer}.so" ] |
| 1496 | } |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1497 | } |
| 1498 | } |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1499 | |
| 1500 | script = rebase_path("${root_build_dir}/android/compress_symbols.py", |
| 1501 | root_build_dir) |
| 1502 | |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1503 | deps = [] |
| 1504 | foreach(_library, angle_libraries) { |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1505 | deps += [ ":$_library" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1506 | } |
| 1507 | |
| 1508 | if (angle_enable_vulkan_validation_layers) { |
| 1509 | foreach(_layer, vulkan_validation_layers) { |
Jamie Madill | 328f72a | 2020-12-15 19:25:50 -0500 | [diff] [blame] | 1510 | deps += [ "$angle_vulkan_validation_layers_dir:${_layer}" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1511 | } |
| 1512 | } |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1513 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1514 | outputs = [ "$root_out_dir/lib.compressed/{{source_file_part}}" ] |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1515 | |
| 1516 | android_nm = "${android_tool_prefix}nm" |
Tim Van Patten | 73e17bf | 2019-05-14 10:42:25 -0600 | [diff] [blame] | 1517 | android_strip = "${android_tool_prefix}strip" |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1518 | |
| 1519 | args = [ |
| 1520 | "--objcopy", |
| 1521 | rebase_path(android_objcopy, root_build_dir), |
| 1522 | "--nm", |
| 1523 | rebase_path(android_nm, root_build_dir), |
Tim Van Patten | 73e17bf | 2019-05-14 10:42:25 -0600 | [diff] [blame] | 1524 | "--strip", |
| 1525 | rebase_path(android_strip, root_build_dir), |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1526 | "--unstrippedsofile", |
| 1527 | "{{source_dir}}/lib.unstripped/{{source_file_part}}", |
| 1528 | "--output", |
| 1529 | "{{source_dir}}/lib.compressed/{{source_file_part}}", |
| 1530 | ] |
| 1531 | } |
| 1532 | } |
| 1533 | |
Tim Van Patten | 57202fb | 2021-04-30 13:56:11 -0600 | [diff] [blame] | 1534 | if ((angle_standalone || build_with_chromium) && is_android && |
| 1535 | current_toolchain == default_toolchain) { |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1536 | apk_version_code = "0" |
| 1537 | if (angle_enable_commit_id) { |
| 1538 | apk_version_code = |
| 1539 | exec_script("src/commit_id.py", [ "position" ], "trim string") |
| 1540 | } |
| 1541 | |
| 1542 | # Package ANGLE libraries for normal use on Android |
Cody Northrop | 8cbd321 | 2019-04-23 13:25:20 -0600 | [diff] [blame] | 1543 | angle_apk("angle_chromium_apk") { |
Tobin Ehlis | 736c43a | 2020-08-31 10:23:27 -0600 | [diff] [blame] | 1544 | package_name = "org.chromium.angle" |
Tim Van Patten | ee4fa07 | 2019-02-21 19:21:09 +0000 | [diff] [blame] | 1545 | apk_name = "AngleLibraries" |
Jamie Madill | 7bed2a5 | 2020-09-22 23:37:54 -0400 | [diff] [blame] | 1546 | version_name = "ANGLE Developer Build" |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1547 | version_code = apk_version_code |
| 1548 | } |
Jamie Madill | 7bed2a5 | 2020-09-22 23:37:54 -0400 | [diff] [blame] | 1549 | |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1550 | # Package ANGLE libraries for AGI use on Android |
| 1551 | angle_apk("angle_agi_chromium_apk") { |
| 1552 | package_name = "org.chromium.angle.agi" |
| 1553 | apk_name = "AngleAgiLibraries" |
| 1554 | version_name = "ANGLE AGI Build" |
| 1555 | version_code = apk_version_code |
Cody Northrop | 8e63644 | 2018-11-30 16:24:11 -0700 | [diff] [blame] | 1556 | } |
| 1557 | |
| 1558 | group("angle_apks") { |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1559 | deps = [ |
| 1560 | ":angle_agi_chromium_apk", |
| 1561 | ":angle_chromium_apk", |
| 1562 | ] |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 1563 | } |
| 1564 | } |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1565 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1566 | group("angle") { |
| 1567 | data_deps = [ |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1568 | ":libEGL", |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 1569 | ":libGLESv1_CM", |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1570 | ":libGLESv2", |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1571 | ] |
| 1572 | } |