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 | |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 5 | # import the use_x11 variable |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 6 | import("gni/angle.gni") |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 7 | if (angle_has_build) { |
| 8 | import("//build/config/linux/pkg_config.gni") |
| 9 | import("//build/config/ui.gni") |
| 10 | import("//testing/libfuzzer/fuzzer_test.gni") |
| 11 | |
| 12 | if (is_android) { |
| 13 | # android/rules.gni can only be imported for Android targets |
| 14 | import("//build/config/android/config.gni") |
| 15 | import("//build/config/android/rules.gni") |
| 16 | import("android/angle_apk.gni") |
| 17 | } |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 18 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 19 | |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 20 | declare_args() { |
| 21 | # Use the PCI lib to collect GPU information on Linux. |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 22 | use_libpci = |
| 23 | (is_linux || is_chromeos) && (!is_chromecast || is_cast_desktop_build) && |
| 24 | (angle_use_x11 || use_ozone) && angle_has_build |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 25 | |
| 26 | # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md. |
| 27 | angle_link_glx = false |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 28 | |
| 29 | # Defaults to capture building to $root_out_dir/angle_libs/with_capture. |
| 30 | # Switch on to build capture to $root_out_dir. |
| 31 | angle_with_capture_by_default = false |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 32 | |
| 33 | # Don't build extra (test, samples etc) for Windows UWP. We don't have |
| 34 | # infrastructure (e.g. windowing helper functions) in place to run them. |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 35 | angle_build_all = !build_with_chromium && !angle_is_winuwp && angle_has_build |
Geoff Lang | e888356 | 2020-03-06 09:32:18 -0500 | [diff] [blame] | 36 | |
| 37 | # Enable generating current commit information using git |
| 38 | angle_enable_commit_id = true |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 39 | |
| 40 | # Abseil has trouble supporting MSVC, particularly regarding component builds. |
| 41 | # http://crbug.com/1126524 |
| 42 | angle_enable_abseil = angle_has_build && is_clang |
Jamie Madill | 06a9d52 | 2020-11-04 19:57:27 -0500 | [diff] [blame] | 43 | |
| 44 | # Adds run-time checks to filter out EVENT() messages when the debug annotator is disabled. |
| 45 | angle_enable_annotator_run_time_checks = false |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 46 | } |
| 47 | |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 48 | if (angle_build_all) { |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 49 | group("all") { |
| 50 | testonly = true |
| 51 | deps = [ |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 52 | ":angle", |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 53 | ":angle_shader_translator", |
| 54 | ":translator_fuzzer", |
Jamie Madill | 238c19e | 2019-02-07 09:09:41 -0500 | [diff] [blame] | 55 | ":xxhash_fuzzer", |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 56 | "$angle_root/samples:angle_samples", |
| 57 | "$angle_root/src/tests:angle_tests", |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 58 | ] |
| 59 | } |
| 60 | } |
| 61 | |
Tim Van Patten | c4e0a1e | 2018-11-28 16:08:11 +0000 | [diff] [blame] | 62 | import("src/compiler.gni") |
Tim Van Patten | fdccaa3 | 2018-11-01 17:47:10 -0600 | [diff] [blame] | 63 | import("src/libGLESv2.gni") |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 64 | |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 65 | # This config is exported to dependent targets (and also applied to internal |
| 66 | # ones). |
| 67 | config("external_config") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 68 | include_dirs = [ "include" ] |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 69 | } |
| 70 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 71 | # Prevent the GL headers from redeclaring ANGLE entry points. |
| 72 | config("no_gl_prototypes") { |
| 73 | defines = [ |
| 74 | "GL_GLES_PROTOTYPES=0", |
| 75 | "EGL_EGL_PROTOTYPES=0", |
| 76 | ] |
| 77 | } |
| 78 | |
| 79 | config("gl_prototypes") { |
| 80 | defines = [ |
| 81 | "GL_GLES_PROTOTYPES=1", |
| 82 | "EGL_EGL_PROTOTYPES=1", |
| 83 | "GL_GLEXT_PROTOTYPES", |
| 84 | "EGL_EGLEXT_PROTOTYPES", |
| 85 | ] |
| 86 | } |
| 87 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 88 | # This config is applied to internal Angle targets (not pushed to dependents). |
| 89 | config("internal_config") { |
| 90 | include_dirs = [ |
| 91 | "include", |
| 92 | "src", |
| 93 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 94 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 95 | defines = [] |
Jamie Madill | 6de5185 | 2017-04-12 09:53:01 -0400 | [diff] [blame] | 96 | |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 97 | if (angle_64bit_current_cpu) { |
Yuly Novikov | c4f1dd8 | 2017-10-25 17:02:29 -0400 | [diff] [blame] | 98 | defines += [ "ANGLE_IS_64_BIT_CPU" ] |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 99 | } else { |
| 100 | defines += [ "ANGLE_IS_32_BIT_CPU" ] |
Jamie Madill | 6de5185 | 2017-04-12 09:53:01 -0400 | [diff] [blame] | 101 | } |
Geoff Lang | b02fc66 | 2018-08-21 09:48:01 -0400 | [diff] [blame] | 102 | |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 103 | if (is_win) { |
| 104 | defines += [ "ANGLE_IS_WIN" ] |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 105 | } else if (is_linux || is_chromeos) { |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 106 | defines += [ "ANGLE_IS_LINUX" ] |
| 107 | } |
| 108 | |
Ian Elliott | e2ecb2d | 2020-11-03 19:26:00 -0700 | [diff] [blame] | 109 | # Enables debug/trace-related functionality, including logging every GLES/EGL API command to the |
| 110 | # "angle_debug.txt" file on desktop. Enables debug markers for AGI, but must also set |
| 111 | # angle_enable_annotator_run_time_checks to improve performance. |
Tobin Ehlis | 573f76b | 2018-05-03 11:10:44 -0600 | [diff] [blame] | 112 | if (angle_enable_trace) { |
| 113 | defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ] |
| 114 | } |
Tobin Ehlis | 93121f3 | 2019-10-17 08:18:16 -0600 | [diff] [blame] | 115 | |
Ian Elliott | e2ecb2d | 2020-11-03 19:26:00 -0700 | [diff] [blame] | 116 | # When used with angle_enable_trace, enables logging every GLES/EGL API command to Android logcat |
| 117 | # Enables debug markers for AGI regardless of run-time checks. |
| 118 | if (angle_enable_trace_android_logcat) { |
| 119 | defines += [ "ANGLE_ENABLE_TRACE_ANDROID_LOGCAT=1" ] |
| 120 | } |
| 121 | |
Tobin Ehlis | 93121f3 | 2019-10-17 08:18:16 -0600 | [diff] [blame] | 122 | if (is_chromeos) { |
| 123 | defines += [ "ANGLE_PLATFORM_CHROMEOS" ] |
| 124 | } |
Ethan Lee | fcef6dc | 2020-01-24 22:41:35 -0500 | [diff] [blame] | 125 | |
| 126 | if (is_ggp) { |
| 127 | defines += [ "__ggp__" ] |
| 128 | } |
Xiaoxuan Liu | 61180d0 | 2020-10-12 16:40:13 +0800 | [diff] [blame] | 129 | |
| 130 | if (angle_use_vulkan_display) { |
Xiaoxuan Liu | d0f99d5 | 2020-12-03 11:06:56 +0800 | [diff] [blame] | 131 | defines += [ |
| 132 | "ANGLE_USE_VULKAN_DISPLAY", |
| 133 | "EGL_NO_X11", |
| 134 | ] |
Xiaoxuan Liu | 61180d0 | 2020-10-12 16:40:13 +0800 | [diff] [blame] | 135 | if (angle_vulkan_display_mode == "simple") { |
| 136 | defines += [ "ANGLE_VULKAN_DISPLAY_MODE_SIMPLE" ] |
| 137 | } else if (angle_vulkan_display_mode == "headless") { |
| 138 | defines += [ "ANGLE_VULKAN_DISPLAY_MODE_HEADLESS" ] |
| 139 | } |
| 140 | } |
Alexis Hetu | f2a1548 | 2020-12-04 14:07:24 -0500 | [diff] [blame] | 141 | |
| 142 | if (is_lsan) { |
| 143 | defines += [ "ANGLE_WITH_LSAN" ] |
| 144 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 145 | } |
| 146 | |
Jamie Madill | a9f11bf | 2019-10-21 08:39:14 -0400 | [diff] [blame] | 147 | config("constructor_and_destructor_warnings") { |
| 148 | if (is_clang) { |
| 149 | cflags = [ |
| 150 | "-Wexit-time-destructors", |
| 151 | "-Wglobal-constructors", |
| 152 | ] |
| 153 | } |
| 154 | } |
| 155 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 156 | config("extra_warnings") { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 157 | cflags = [] |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 158 | |
Brian Salomon | e7496f5 | 2021-01-26 16:13:04 -0500 | [diff] [blame] | 159 | # Avoid failing builds for warnings enabled by Skia build. |
| 160 | if (defined(is_skia_standalone)) { |
| 161 | cflags += [ "-w" ] |
| 162 | } |
| 163 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 164 | # Enable more default warnings on Windows. |
| 165 | if (is_win) { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 166 | cflags += [ |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 167 | "/we4244", # Conversion: possible loss of data. |
Jamie Madill | 330c867 | 2020-08-28 17:44:13 -0400 | [diff] [blame] | 168 | "/we4312", # Conversion: greater size. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 169 | "/we4456", # Variable shadowing. |
Jamie Madill | 1db8a26 | 2016-09-22 13:53:47 -0400 | [diff] [blame] | 170 | "/we4458", # declaration hides class member. |
Ben Wagner | 1e06401 | 2019-04-12 14:10:17 -0400 | [diff] [blame] | 171 | "/we4715", # not all control paths return a value |
Geoff Lang | b944053 | 2017-11-28 13:26:34 -0500 | [diff] [blame] | 172 | "/we4800", # forcing value to bool. |
| 173 | "/we4838", # narrowing conversion. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 174 | ] |
| 175 | } |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 176 | if (is_clang) { |
Michael Spang | 229fc83 | 2019-01-21 18:09:15 -0500 | [diff] [blame] | 177 | cflags += [ |
Jamie Madill | c7217aa | 2020-08-28 14:45:14 -0400 | [diff] [blame] | 178 | "-Wbad-function-cast", |
Jamie Madill | 155947f | 2019-10-24 12:55:11 -0400 | [diff] [blame] | 179 | "-Wconditional-uninitialized", |
Jamie Madill | 44a0e73 | 2019-09-02 13:55:59 -0400 | [diff] [blame] | 180 | "-Wextra-semi-stmt", |
Jiacheng Lu | 73e5e9b | 2019-07-22 15:26:17 -0600 | [diff] [blame] | 181 | "-Wfloat-conversion", |
Jamie Madill | 16370a6 | 2019-10-24 12:55:11 -0400 | [diff] [blame] | 182 | "-Winconsistent-missing-destructor-override", |
Jamie Madill | a620685 | 2019-10-24 12:55:09 -0400 | [diff] [blame] | 183 | "-Wmissing-field-initializers", |
Stuart Morgan | 5dba723 | 2020-06-16 09:29:16 -0700 | [diff] [blame] | 184 | "-Wnewline-eof", |
Olli Etuaho | 8073a95 | 2018-05-09 16:41:39 +0300 | [diff] [blame] | 185 | "-Wnon-virtual-dtor", |
Jamie Madill | 68945f1 | 2019-10-24 12:55:09 -0400 | [diff] [blame] | 186 | "-Wredundant-parens", |
Jamie Madill | 1ab8b75 | 2020-08-28 14:45:15 -0400 | [diff] [blame] | 187 | "-Wreturn-std-move-in-c++11", |
Jamie Madill | 859ca03 | 2019-10-24 12:55:08 -0400 | [diff] [blame] | 188 | "-Wshadow-field", |
Jamie Madill | fd58d22 | 2019-10-24 12:55:07 -0400 | [diff] [blame] | 189 | "-Wtautological-type-limit-compare", |
Jamie Madill | c017cee | 2019-10-24 12:55:10 -0400 | [diff] [blame] | 190 | "-Wundefined-reinterpret-cast", |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 191 | "-Wunneeded-internal-declaration", |
Jamie Madill | 3486ec9 | 2020-09-10 17:55:28 -0400 | [diff] [blame] | 192 | "-Wweak-template-vtables", |
James Darpinian | efa898a | 2019-08-07 17:05:35 -0700 | [diff] [blame] | 193 | |
| 194 | # The below warnings are used by WebKit. We enable them to make rolling |
| 195 | # ANGLE in WebKit easier. |
| 196 | "-Wparentheses", |
| 197 | "-Wrange-loop-analysis", |
| 198 | "-Wstrict-prototypes", |
| 199 | "-Wunreachable-code", |
James Darpinian | 7e48c9e | 2019-08-06 17:17:19 -0700 | [diff] [blame] | 200 | "-Wshorten-64-to-32", |
Nico Weber | 79de62c | 2018-01-31 10:47:14 -0500 | [diff] [blame] | 201 | ] |
James Darpinian | dea8629 | 2020-12-02 16:26:03 -0800 | [diff] [blame] | 202 | if (!use_xcode_clang) { |
| 203 | # Mac catalyst uses a clang version that doesn't have these. |
| 204 | cflags += [ |
| 205 | "-Wdeprecated-copy", |
| 206 | "-Wsuggest-destructor-override", |
| 207 | "-Wsuggest-override", |
| 208 | ] |
| 209 | } |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 210 | } |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 211 | |
| 212 | if (angle_is_winuwp) { |
| 213 | cflags += [ "/wd4447" ] # 'main' signature found without threading model. |
| 214 | } |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 215 | } |
| 216 | |
Courtney Goeltzenleuchter | 4607148 | 2018-05-15 13:35:15 -0600 | [diff] [blame] | 217 | # This config adds build-ids to the associated library. |
| 218 | # -Wl is a special option that indicates that clang should pass the associated |
| 219 | # option --build-id to the linker. This will cause a build-id section to be added |
| 220 | # to the associated library. The build-id makes it possible for a debugger to |
| 221 | # find the right symbol file to use. |
| 222 | config("build_id_config") { |
| 223 | ldflags = [ "-Wl,--build-id" ] |
| 224 | } |
| 225 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 226 | _use_copy_compiler_dll = angle_has_build && is_win && target_cpu != "arm64" |
| 227 | |
Tom Tan | 5c31753 | 2018-11-30 17:01:01 -0800 | [diff] [blame] | 228 | # Windows ARM64 is available since 10.0.16299 so no need to copy |
| 229 | # d3dcompiler_47.dll because this file is available as inbox. |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 230 | if (_use_copy_compiler_dll) { |
Jamie Madill | d09546e | 2019-02-22 10:24:44 -0500 | [diff] [blame] | 231 | # We also ship an older DLL for compatiblity with Windows 7 machines without |
| 232 | # the UCRT. This DLL isn't available in the standard SDK distribution. |
| 233 | _old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll" |
| 234 | _has_old_compiler = |
| 235 | exec_script("scripts/file_exists.py", [ _old_compiler ], "value") |
| 236 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 237 | copy("copy_compiler_dll") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 238 | sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ] |
Jamie Madill | d09546e | 2019-02-22 10:24:44 -0500 | [diff] [blame] | 239 | |
| 240 | if (_has_old_compiler) { |
| 241 | sources += [ _old_compiler ] |
| 242 | } |
| 243 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 244 | outputs = [ "$root_out_dir/{{source_file_part}}" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 245 | } |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 246 | } |
| 247 | |
Jamie Madill | 55959b0 | 2019-03-05 10:07:41 -0500 | [diff] [blame] | 248 | # Holds the shared includes so we only need to list them once. |
Jamie Madill | cd4f1fb | 2019-02-07 15:26:10 -0500 | [diff] [blame] | 249 | config("includes_config") { |
| 250 | include_dirs = [ "include" ] |
| 251 | } |
| 252 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 253 | angle_source_set("includes") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 254 | sources = libangle_includes |
Jamie Madill | 8d412db | 2020-08-29 22:25:18 +0000 | [diff] [blame] | 255 | public_configs = [ ":includes_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 256 | } |
| 257 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 258 | angle_static_library("preprocessor") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 259 | sources = angle_preprocessor_sources |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 260 | |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 261 | public_deps = [ |
| 262 | ":angle_common", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 263 | ":angle_translator_headers", |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 264 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 265 | } |
| 266 | |
Tobin Ehlis | 5546fb4 | 2019-01-17 12:25:54 -0500 | [diff] [blame] | 267 | config("angle_disable_pool_alloc") { |
| 268 | defines = [ "ANGLE_DISABLE_POOL_ALLOC" ] |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 269 | } |
| 270 | |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 271 | config("debug_annotations_config") { |
Corentin Wallez | 105bc9d | 2019-03-06 16:32:40 +0000 | [diff] [blame] | 272 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 273 | defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ] |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 274 | } |
Jamie Madill | 06a9d52 | 2020-11-04 19:57:27 -0500 | [diff] [blame] | 275 | if (angle_enable_annotator_run_time_checks) { |
Ian Elliott | e2ecb2d | 2020-11-03 19:26:00 -0700 | [diff] [blame] | 276 | # When used with angle_enable_trace, enables debug markers for AGI with run-time checks to |
| 277 | # filter out EVENT() messages when the debug annotator is disabled. |
Jamie Madill | 06a9d52 | 2020-11-04 19:57:27 -0500 | [diff] [blame] | 278 | defines = [ "ANGLE_ENABLE_ANNOTATOR_RUN_TIME_CHECKS" ] |
| 279 | } |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 280 | } |
| 281 | |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 282 | config("angle_release_asserts_config") { |
| 283 | if (dcheck_always_on) { |
| 284 | defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ] |
| 285 | } |
| 286 | } |
| 287 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 288 | config("angle_common_config") { |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 289 | include_dirs = [ "src/common/third_party/base" ] |
Yuly Novikov | e762400 | 2018-01-27 18:27:07 -0500 | [diff] [blame] | 290 | if (is_android) { |
| 291 | libs = [ "log" ] |
| 292 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 293 | } |
| 294 | |
Alexis Hetu | a20f5b1 | 2020-08-18 11:26:50 -0400 | [diff] [blame] | 295 | # Silences the "indirect call of a function with wrong dynamic type" cfi error |
| 296 | config("angle_no_cfi_icall") { |
| 297 | if (is_cfi && use_cfi_icall && current_toolchain == default_toolchain) { |
| 298 | cflags = [ "-fno-sanitize=cfi-icall" ] |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | # Silences the "cast from void* or another unrelated type to the wrong dynamic type" cfi error |
| 303 | config("angle_no_cfi_unrelated_cast") { |
| 304 | if (is_cfi && use_cfi_cast && current_toolchain == default_toolchain) { |
| 305 | cflags = [ "-fno-sanitize=cfi-unrelated-cast" ] |
| 306 | } |
| 307 | } |
| 308 | |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 309 | angle_source_set("xxhash") { |
| 310 | sources = xxhash_sources |
Jamie Madill | 5fde632 | 2020-08-28 14:45:17 -0400 | [diff] [blame] | 311 | if (is_clang) { |
| 312 | cflags_c = [ "-Wno-implicit-fallthrough" ] |
| 313 | } |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 314 | } |
| 315 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 316 | if (angle_has_build) { |
| 317 | fuzzer_test("xxhash_fuzzer") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 318 | sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ] |
| 319 | deps = [ ":xxhash" ] |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 320 | } |
Jamie Madill | 238c19e | 2019-02-07 09:09:41 -0500 | [diff] [blame] | 321 | } |
| 322 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 323 | angle_static_library("angle_common") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 324 | sources = libangle_common_sources |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 325 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 326 | configs += [ |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 327 | ":angle_common_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 328 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 329 | ] |
Jeremy Roman | 06feb81 | 2016-04-06 16:39:52 -0400 | [diff] [blame] | 330 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 331 | deps = [ ":xxhash" ] |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 332 | |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 333 | public_deps = [ |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 334 | ":angle_abseil", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 335 | ":angle_version", |
Jamie Madill | 8d986bf | 2018-02-21 08:28:01 -0500 | [diff] [blame] | 336 | ":includes", |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 337 | ] |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 338 | public_configs += [ ":angle_common_config" ] |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 339 | if (angle_has_build && use_fuzzing_engine) { |
Jamie Madill | 48aa52f | 2019-10-17 07:56:53 -0400 | [diff] [blame] | 340 | all_dependent_configs = [ ":angle_disable_pool_alloc" ] |
Tobin Ehlis | 5546fb4 | 2019-01-17 12:25:54 -0500 | [diff] [blame] | 341 | } |
Tim Van Patten | e99b8bc | 2020-10-23 18:50:33 -0600 | [diff] [blame] | 342 | |
Jamie Madill | 9528641 | 2020-11-23 15:47:09 -0500 | [diff] [blame] | 343 | if (is_linux || is_chromeos) { |
| 344 | libs = [ "dl" ] |
| 345 | } |
| 346 | |
Tim Van Patten | e99b8bc | 2020-10-23 18:50:33 -0600 | [diff] [blame] | 347 | if (is_android && (angle_enable_gl || angle_enable_vulkan)) { |
| 348 | # In API level 26 ANativeWindow APIs were moved from libandroid.so |
| 349 | # into a separate library, libnativewindow.so |
| 350 | if (ndk_api_level_at_least_26) { |
| 351 | libs = [ "nativewindow" ] |
| 352 | } else { |
| 353 | libs = [ "android" ] |
| 354 | } |
| 355 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 356 | } |
| 357 | |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 358 | config("angle_image_util_config") { |
| 359 | include_dirs = [ |
| 360 | "include", |
| 361 | "src", |
| 362 | ] |
| 363 | } |
| 364 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 365 | angle_source_set("angle_image_util_headers") { |
| 366 | sources = libangle_image_util_headers |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 367 | public_deps = [ ":angle_common" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 368 | } |
| 369 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 370 | angle_static_library("angle_image_util") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 371 | sources = libangle_image_util_sources |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 372 | public_configs += [ ":angle_image_util_config" ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 373 | public_deps = [ ":angle_image_util_headers" ] |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 374 | } |
| 375 | |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 376 | config("angle_gl_visibility_config") { |
| 377 | if (is_win) { |
| 378 | defines = [ |
| 379 | "GL_APICALL=", |
| 380 | "GL_API=", |
| 381 | ] |
| 382 | } else { |
| 383 | defines = [ |
| 384 | "GL_APICALL=__attribute__((visibility(\"default\")))", |
| 385 | "GL_API=__attribute__((visibility(\"default\")))", |
| 386 | ] |
Courtney Goeltzenleuchter | e7ece9e | 2018-10-08 16:43:43 -0600 | [diff] [blame] | 387 | } |
Ian Elliott | abcb2b3 | 2018-08-29 17:04:15 -0600 | [diff] [blame] | 388 | } |
| 389 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 390 | config("angle_gpu_info_util_config") { |
| 391 | include_dirs = [ |
| 392 | "include", |
| 393 | "src", |
| 394 | ] |
| 395 | } |
| 396 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 397 | angle_static_library("angle_gpu_info_util") { |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 398 | public_configs += [ |
| 399 | ":angle_gpu_info_util_config", |
| 400 | ":angle_backend_config", |
| 401 | ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 402 | public_deps = [ ":angle_common" ] |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 403 | sources = libangle_gpu_info_util_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 404 | deps = [] |
| 405 | libs = [] |
| 406 | defines = [] |
| 407 | |
Jamie Madill | b09f16e | 2020-10-01 10:02:07 -0400 | [diff] [blame] | 408 | if (!is_chromeos && angle_has_build) { |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 409 | sources += libangle_gpu_info_util_vulkan_sources |
Jamie Madill | 4798c8c | 2020-12-14 16:35:27 -0500 | [diff] [blame] | 410 | deps += [ "$angle_vulkan_headers_dir:vulkan_headers" ] |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 411 | } |
| 412 | |
Ian Elliott | d07c52e | 2018-06-22 15:42:09 -0600 | [diff] [blame] | 413 | if (is_android) { |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 414 | sources += libangle_gpu_info_util_android_sources |
| 415 | } |
| 416 | |
| 417 | if (is_fuchsia) { |
| 418 | sources += libangle_gpu_info_util_fuchsia_sources |
Antonio Maiorano | 13816d2 | 2020-06-16 14:27:04 -0400 | [diff] [blame] | 419 | deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ] |
Ian Elliott | d07c52e | 2018-06-22 15:42:09 -0600 | [diff] [blame] | 420 | } |
| 421 | |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 422 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 423 | sources += libangle_gpu_info_util_win_sources |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 424 | if (!angle_is_winuwp) { |
| 425 | libs += [ "setupapi.lib" ] |
| 426 | } |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 427 | libs += [ "dxgi.lib" ] |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 428 | } |
| 429 | |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 430 | if (is_linux || is_chromeos) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 431 | sources += libangle_gpu_info_util_linux_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 432 | |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 433 | if (angle_use_x11 && angle_has_build) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 434 | sources += libangle_gpu_info_util_x11_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 435 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
| 436 | defines += [ "GPU_INFO_USE_X11" ] |
| 437 | libs += [ |
| 438 | "X11", |
| 439 | "Xi", |
| 440 | "Xext", |
| 441 | ] |
| 442 | } |
| 443 | } |
| 444 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 445 | if (use_libpci) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 446 | sources += libangle_gpu_info_util_libpci_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 447 | defines += [ "GPU_INFO_USE_LIBPCI" ] |
| 448 | libs += [ "pci" ] |
| 449 | } |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 450 | |
Shahbaz Youssefi | 5b8dec5 | 2021-01-12 04:11:56 +0000 | [diff] [blame] | 451 | if (is_apple) { |
Sylvain Defresne | bae95f8 | 2020-07-02 17:19:14 +0200 | [diff] [blame] | 452 | frameworks = [ |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 453 | "IOKit.framework", |
| 454 | "CoreFoundation.framework", |
Corentin Wallez | 163965d | 2017-10-11 11:38:55 -0400 | [diff] [blame] | 455 | "CoreGraphics.framework", |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 456 | ] |
James Darpinian | dea8629 | 2020-12-02 16:26:03 -0800 | [diff] [blame] | 457 | if (angle_enable_eagl) { |
| 458 | frameworks += [ "OpenGLES.framework" ] |
| 459 | } else if (angle_enable_cgl) { |
| 460 | frameworks += [ "OpenGL.framework" ] |
| 461 | } |
| 462 | if (is_mac || angle_enable_cgl) { |
| 463 | sources += libangle_gpu_info_util_mac_sources |
| 464 | } |
| 465 | if (is_ios && !angle_enable_cgl) { |
| 466 | sources += libangle_gpu_info_util_ios_sources |
| 467 | } |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 468 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 469 | } |
| 470 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 471 | angle_source_set("angle_translator_headers") { |
| 472 | sources = angle_translator_exported_headers |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 473 | public_deps = [ ":includes" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 474 | } |
| 475 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 476 | angle_static_library("translator") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 477 | sources = angle_translator_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 478 | defines = [] |
| 479 | |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 480 | _needs_glsl_base = false |
| 481 | needs_glsl_and_vulkan_base = false |
| 482 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 483 | if (angle_enable_essl || use_fuzzing_engine) { |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 484 | _needs_glsl_base = true |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 485 | sources += angle_translator_essl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 486 | defines += [ "ANGLE_ENABLE_ESSL" ] |
| 487 | } |
| 488 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 489 | if (angle_enable_glsl || use_fuzzing_engine) { |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 490 | _needs_glsl_base = true |
| 491 | needs_glsl_and_vulkan_base = true |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 492 | sources += angle_translator_glsl_sources |
Shahbaz Youssefi | 5b8dec5 | 2021-01-12 04:11:56 +0000 | [diff] [blame] | 493 | if (is_apple) { |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 494 | sources += angle_translator_glsl_mac_sources |
| 495 | } |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 496 | defines += [ "ANGLE_ENABLE_GLSL" ] |
| 497 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 498 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 499 | if (angle_enable_hlsl || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 500 | sources += angle_translator_hlsl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 501 | defines += [ "ANGLE_ENABLE_HLSL" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 502 | } |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 503 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 504 | if (angle_enable_vulkan || use_fuzzing_engine || angle_enable_metal) { |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 505 | _needs_glsl_base = true |
| 506 | needs_glsl_and_vulkan_base = true |
| 507 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 508 | # This translator is needed by metal backend also. |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 509 | sources += angle_translator_lib_vulkan_sources |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 510 | } |
| 511 | |
Shahbaz Youssefi | 382bf28 | 2020-12-24 23:56:39 -0500 | [diff] [blame] | 512 | if (_needs_glsl_base) { |
| 513 | sources += angle_translator_glsl_base_sources |
| 514 | } |
| 515 | if (needs_glsl_and_vulkan_base) { |
| 516 | sources += angle_translator_glsl_and_vulkan_base_sources |
| 517 | } |
| 518 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 519 | if (angle_enable_vulkan || use_fuzzing_engine) { |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 520 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 521 | } |
| 522 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 523 | if (angle_enable_metal) { |
| 524 | sources += angle_translator_lib_metal_sources |
| 525 | defines += [ "ANGLE_ENABLE_METAL" ] |
| 526 | } |
| 527 | |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 528 | if (angle_enable_swiftshader) { |
| 529 | defines += [ "ANGLE_ENABLE_SWIFTSHADER" ] |
| 530 | } |
| 531 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 532 | public_configs += [ ":external_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 533 | |
| 534 | deps = [ |
| 535 | ":includes", |
| 536 | ":preprocessor", |
| 537 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 538 | |
| 539 | public_deps = [ |
| 540 | ":angle_common", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 541 | ":angle_translator_headers", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 542 | ] |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 543 | |
| 544 | if (is_win) { |
| 545 | # Necessary to suppress some system header xtree warnigns in Release. |
| 546 | # For some reason this warning doesn't get triggered in Chromium |
| 547 | cflags = [ "/wd4718" ] |
| 548 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 549 | } |
| 550 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 551 | angle_source_set("translator_fuzzer") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 552 | sources = [ "src/compiler/fuzz/translator_fuzzer.cpp" ] |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 553 | |
| 554 | include_dirs = [ |
| 555 | "include", |
| 556 | "src", |
| 557 | ] |
| 558 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 559 | deps = [ ":translator" ] |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 560 | } |
| 561 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 562 | config("angle_commit_id_config") { |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 563 | include_dirs = [ "$root_gen_dir/angle" ] |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 564 | visibility = [ ":angle_commit_id" ] |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 565 | } |
| 566 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 567 | _commit_id_output_file = "$root_gen_dir/angle/angle_commit.h" |
| 568 | action("angle_commit_id") { |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 569 | script = "src/commit_id.py" |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 570 | outputs = [ _commit_id_output_file ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 571 | |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 572 | # Add git as a dependency if it is available. |
Geoff Lang | 20c6973 | 2020-03-06 11:02:31 -0500 | [diff] [blame] | 573 | if (angle_enable_commit_id && |
| 574 | exec_script("src/commit_id.py", [ "check" ], "value") == 1) { |
Geoff Lang | dd19d55 | 2020-03-02 09:41:22 -0500 | [diff] [blame] | 575 | # commit id should depend on angle's HEAD revision |
| 576 | inputs = [ ".git/HEAD" ] |
Jamie Madill | 5f2ba63 | 2020-08-15 23:50:59 -0400 | [diff] [blame] | 577 | branch = read_file(".git/HEAD", "string") |
| 578 | result = string_split(branch) |
| 579 | if (result[0] == "ref:") { |
| 580 | inputs += [ ".git/" + result[1] ] |
| 581 | } |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 582 | } |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 583 | |
| 584 | args = [ |
| 585 | "gen", |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 586 | rebase_path(_commit_id_output_file, root_build_dir), |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 587 | ] |
| 588 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 589 | public_configs = [ ":angle_commit_id_config" ] |
| 590 | } |
| 591 | |
| 592 | # TODO(jmadill): Remove this. http://b/168736059 |
| 593 | group("commit_id") { |
| 594 | data_deps = [ ":angle_commit_id" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 595 | } |
| 596 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 597 | angle_source_set("angle_version") { |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 598 | # TODO(jmadill): Remove version.h. http://b/168736059 |
| 599 | sources = [ |
| 600 | "src/common/angle_version.h", |
| 601 | "src/common/version.h", |
| 602 | ] |
| 603 | public_deps = [ ":angle_commit_id" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 604 | } |
| 605 | |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 606 | config("angle_backend_config") { |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 607 | defines = [] |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 608 | |
Etienne Bergeron | 9e83c15 | 2020-06-04 19:53:36 -0400 | [diff] [blame] | 609 | if (angle_delegate_workers) { |
| 610 | defines += [ "ANGLE_DELEGATE_WORKERS" ] |
| 611 | } |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 612 | |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 613 | configs = [] |
| 614 | |
Jamie Madill | bb96aef | 2020-09-11 13:50:09 -0400 | [diff] [blame] | 615 | if (angle_enable_d3d11) { |
| 616 | configs += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend_config" ] |
Trevor David Black | 192a014 | 2020-10-08 16:47:35 -0700 | [diff] [blame] | 617 | defines += [ "ANGLE_FORCE_CONTEXT_CHECK_EVERY_CALL=1" ] |
Jamie Madill | bb96aef | 2020-09-11 13:50:09 -0400 | [diff] [blame] | 618 | } |
| 619 | |
| 620 | if (angle_enable_d3d9) { |
| 621 | configs += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend_config" ] |
| 622 | } |
| 623 | |
Jamie Madill | 2d74170 | 2020-09-11 12:30:04 -0400 | [diff] [blame] | 624 | if (angle_enable_gl) { |
| 625 | configs += [ "src/libANGLE/renderer/gl:angle_gl_backend_config" ] |
| 626 | } |
| 627 | |
Jamie Madill | 852f61f | 2020-09-11 11:54:35 -0400 | [diff] [blame] | 628 | if (angle_enable_null) { |
| 629 | configs += [ "src/libANGLE/renderer/null:angle_null_backend_config" ] |
| 630 | } |
| 631 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 632 | if (angle_enable_metal) { |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 633 | configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ] |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 634 | } |
| 635 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 636 | if (angle_enable_vulkan) { |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 637 | configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 638 | } |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 639 | } |
| 640 | |
| 641 | config("libANGLE_config") { |
| 642 | cflags = [] |
| 643 | defines = [] |
| 644 | libs = [] |
| 645 | ldflags = [] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 646 | defines += [ "LIBANGLE_IMPLEMENTATION" ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 647 | |
| 648 | if (is_win) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 649 | cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics |
| 650 | # are not enabled. |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 651 | } |
Yuly Novikov | b29fccf | 2018-11-28 10:09:39 -0500 | [diff] [blame] | 652 | |
| 653 | if (is_android && (angle_enable_gl || angle_enable_vulkan)) { |
Yuly Novikov | 8edc68e | 2019-02-12 12:41:01 -0500 | [diff] [blame] | 654 | # In API level 26 ANativeWindow APIs were moved from libandroid.so |
| 655 | # into a separate library, libnativewindow.so |
| 656 | if (ndk_api_level_at_least_26) { |
Yuly Novikov | b29fccf | 2018-11-28 10:09:39 -0500 | [diff] [blame] | 657 | libs += [ "nativewindow" ] |
| 658 | } else { |
| 659 | libs += [ "android" ] |
| 660 | } |
| 661 | } |
Michael Spang | 7cd5f64 | 2019-08-21 20:03:49 -0400 | [diff] [blame] | 662 | |
Ethan Lee | d22b8be | 2019-11-15 12:26:39 -0500 | [diff] [blame] | 663 | if (angle_use_x11) { |
Michael Spang | 7cd5f64 | 2019-08-21 20:03:49 -0400 | [diff] [blame] | 664 | defines += [ "ANGLE_USE_X11" ] |
| 665 | } |
Jamie Madill | af5e382 | 2020-01-28 10:05:36 -0500 | [diff] [blame] | 666 | |
| 667 | if (angle_enable_overlay) { |
| 668 | defines += [ "ANGLE_ENABLE_OVERLAY=1" ] |
| 669 | } |
Tim Van Patten | ee4e086 | 2020-09-24 11:39:49 -0600 | [diff] [blame] | 670 | if (angle_enable_perf_counter_output) { |
| 671 | defines += [ "ANGLE_ENABLE_PERF_COUNTER_OUTPUT=1" ] |
| 672 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 673 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 674 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 675 | angle_source_set("libANGLE_headers") { |
| 676 | sources = libangle_headers |
| 677 | public_deps = [ |
| 678 | ":angle_common", |
| 679 | ":angle_translator_headers", |
| 680 | ] |
Jamie Madill | af5e382 | 2020-01-28 10:05:36 -0500 | [diff] [blame] | 681 | public_configs += [ ":libANGLE_config" ] |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 682 | } |
| 683 | |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 684 | # Don't even try to build glslang if Metal and Vulkan are disabled. |
| 685 | if (angle_enable_vulkan || angle_enable_metal) { |
| 686 | angle_source_set("angle_glslang_wrapper") { |
| 687 | sources = [ |
| 688 | "src/libANGLE/renderer/glslang_wrapper_utils.cpp", |
| 689 | "src/libANGLE/renderer/glslang_wrapper_utils.h", |
| 690 | ] |
| 691 | deps = [ |
| 692 | ":libANGLE_headers", |
Shahbaz Youssefi | 6689a54 | 2021-01-21 00:36:14 -0500 | [diff] [blame] | 693 | "$angle_root/src/common/spirv:angle_spirv_builder", |
| 694 | "$angle_root/src/common/spirv:angle_spirv_parser", |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 695 | "${angle_glslang_dir}:glslang_default_resource_limits_sources", |
Shahbaz Youssefi | b291ad0 | 2020-07-03 23:53:10 -0400 | [diff] [blame] | 696 | "${angle_glslang_dir}:glslang_lib_sources", |
Shahbaz Youssefi | 71e6afb | 2020-01-14 14:12:31 -0500 | [diff] [blame] | 697 | "${angle_spirv_headers_dir}:spv_headers", |
| 698 | "${angle_spirv_tools_dir}:spvtools_headers", |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 699 | ] |
| 700 | } |
Le Quyen | a48f95a | 2019-10-14 14:49:49 +0800 | [diff] [blame] | 701 | } |
| 702 | |
Jamie Madill | 4d3a0f6 | 2020-09-11 12:36:05 -0400 | [diff] [blame] | 703 | if (is_win) { |
| 704 | angle_source_set("angle_d3d_format_tables") { |
| 705 | sources = [ |
| 706 | "src/libANGLE/renderer/dxgi_format_map.h", |
| 707 | "src/libANGLE/renderer/dxgi_format_map_autogen.cpp", |
| 708 | "src/libANGLE/renderer/dxgi_support_table.h", |
| 709 | "src/libANGLE/renderer/dxgi_support_table_autogen.cpp", |
| 710 | ] |
| 711 | |
| 712 | if (!angle_is_winuwp) { |
| 713 | sources += [ |
| 714 | "src/libANGLE/renderer/d3d_format.cpp", |
| 715 | "src/libANGLE/renderer/d3d_format.h", |
| 716 | ] |
| 717 | } |
| 718 | |
| 719 | public_deps = [ ":libANGLE_headers" ] |
| 720 | configs += [ ":angle_backend_config" ] |
| 721 | } |
| 722 | } |
| 723 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 724 | angle_source_set("libANGLE_base") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 725 | sources = libangle_sources |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 726 | |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 727 | include_dirs = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 728 | libs = [] |
Corentin Wallez | 64598b5 | 2016-11-11 08:25:44 -0500 | [diff] [blame] | 729 | defines = [] |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 730 | if (angle_link_glx) { |
| 731 | libs += [ "GL" ] |
| 732 | defines += [ "ANGLE_LINK_GLX" ] |
| 733 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 734 | public_deps = [ |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 735 | ":angle_common", |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 736 | ":angle_gpu_info_util", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 737 | ":angle_version", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 738 | ":libANGLE_headers", |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 739 | ":translator", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 740 | ] |
| 741 | deps = [ |
Tim Van Patten | b55f0f7 | 2020-06-02 18:01:24 -0600 | [diff] [blame] | 742 | ":angle_compression", |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 743 | ":angle_image_util", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 744 | ":includes", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 745 | ] |
| 746 | |
Austin Eng | 0739f07 | 2021-01-19 23:54:20 +0000 | [diff] [blame] | 747 | if (is_win) { |
Jamie Madill | e55374f | 2019-10-24 12:55:12 -0400 | [diff] [blame] | 748 | libs += [ |
Jamie Madill | e55374f | 2019-10-24 12:55:12 -0400 | [diff] [blame] | 749 | "gdi32.lib", |
| 750 | "user32.lib", |
| 751 | ] |
| 752 | } |
| 753 | |
Jamie Madill | bb96aef | 2020-09-11 13:50:09 -0400 | [diff] [blame] | 754 | if (angle_enable_d3d11) { |
| 755 | public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend" ] |
| 756 | } |
| 757 | |
| 758 | if (angle_enable_d3d9) { |
| 759 | public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend" ] |
| 760 | } |
| 761 | |
Jamie Madill | 2d74170 | 2020-09-11 12:30:04 -0400 | [diff] [blame] | 762 | if (angle_enable_gl) { |
| 763 | public_deps += [ "src/libANGLE/renderer/gl:angle_gl_backend" ] |
| 764 | } |
| 765 | |
Jamie Madill | 852f61f | 2020-09-11 11:54:35 -0400 | [diff] [blame] | 766 | if (angle_enable_null) { |
| 767 | public_deps += [ "src/libANGLE/renderer/null:angle_null_backend" ] |
| 768 | } |
| 769 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 770 | if (angle_enable_vulkan) { |
| 771 | public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ] |
| 772 | } |
| 773 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 774 | if (angle_enable_metal) { |
| 775 | public_deps += [ "src/libANGLE/renderer/metal:angle_metal_backend" ] |
| 776 | } |
| 777 | |
Jamie Madill | ab2bfa8 | 2019-01-15 19:06:47 -0500 | [diff] [blame] | 778 | # Enable extra Chromium style warnings for libANGLE. |
James Darpinian | dea8629 | 2020-12-02 16:26:03 -0800 | [diff] [blame] | 779 | if (is_clang && angle_has_build && !use_xcode_clang) { |
Jamie Madill | ab2bfa8 | 2019-01-15 19:06:47 -0500 | [diff] [blame] | 780 | suppressed_configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 781 | } |
| 782 | |
Shahbaz Youssefi | 5b8dec5 | 2021-01-12 04:11:56 +0000 | [diff] [blame] | 783 | if (is_apple) { |
Geoff Lang | ecd2e3b | 2019-07-09 15:39:39 -0400 | [diff] [blame] | 784 | sources += libangle_mac_sources |
| 785 | } |
| 786 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 787 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 788 | defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 789 | } |
| 790 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 791 | configs += [ ":debug_annotations_config" ] |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 792 | public_configs += [ |
| 793 | ":libANGLE_config", |
| 794 | ":angle_backend_config", |
| 795 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 796 | |
Tom Tan | 5c31753 | 2018-11-30 17:01:01 -0800 | [diff] [blame] | 797 | # Windows ARM64 is available since 10.0.16299 so no need to copy |
| 798 | # d3dcompiler_47.dll because this file is available as inbox. |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 799 | if (_use_copy_compiler_dll) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 800 | data_deps = [ ":copy_compiler_dll" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 801 | } |
| 802 | } |
| 803 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 804 | config("angle_frame_capture_disabled") { |
| 805 | defines = [ "ANGLE_CAPTURE_ENABLED=0" ] |
| 806 | } |
| 807 | |
| 808 | config("angle_frame_capture_enabled") { |
| 809 | defines = [ "ANGLE_CAPTURE_ENABLED=1" ] |
| 810 | } |
| 811 | |
| 812 | angle_source_set("libANGLE") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 813 | public_deps = [ ":libANGLE_base" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 814 | public_configs = [ ":angle_frame_capture_disabled" ] |
Jamie Madill | 6fc1038 | 2021-02-10 11:20:16 -0500 | [diff] [blame] | 815 | sources = [ "src/libANGLE/capture/FrameCapture_mock.cpp" ] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 816 | |
| 817 | # gl_enum_utils defaults included in with_capture build |
Jamie Madill | 8d412db | 2020-08-29 22:25:18 +0000 | [diff] [blame] | 818 | deps = [] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 819 | if (angle_enable_trace || is_debug) { |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 820 | deps += [ ":angle_gl_enum_utils" ] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 821 | } |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 822 | } |
| 823 | |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 824 | angle_source_set("angle_gl_enum_utils") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 825 | public_deps = [ ":libANGLE_base" ] |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 826 | sources = [ |
Jamie Madill | 6fc1038 | 2021-02-10 11:20:16 -0500 | [diff] [blame] | 827 | "src/libANGLE/capture/gl_enum_utils.cpp", |
| 828 | "src/libANGLE/capture/gl_enum_utils_autogen.cpp", |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 829 | ] |
| 830 | } |
| 831 | |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 832 | if (!defined(angle_abseil_cpp_dir)) { |
| 833 | angle_abseil_cpp_dir = "//third_party/abseil-cpp" |
| 834 | } |
| 835 | |
| 836 | config("angle_abseil_config") { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 837 | if (angle_enable_abseil) { |
| 838 | defines = [ "ANGLE_USE_ABSEIL" ] |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 839 | |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 840 | configs = [ |
| 841 | "$angle_abseil_cpp_dir:absl_define_config", |
| 842 | "$angle_abseil_cpp_dir:absl_include_config", |
| 843 | ] |
| 844 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 845 | } |
| 846 | |
| 847 | group("angle_abseil") { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 848 | if (angle_enable_abseil) { |
| 849 | # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while |
| 850 | # we can be more specific when building standalone ANGLE. |
Tim Van Patten | 36f0464 | 2020-10-08 14:45:51 -0600 | [diff] [blame] | 851 | if (build_with_chromium || is_component_build) { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 852 | public_deps = [ "$angle_abseil_cpp_dir:absl" ] |
| 853 | } else { |
| 854 | public_deps = [ "$angle_abseil_cpp_dir/absl/container:flat_hash_map" ] |
| 855 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 856 | |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 857 | public_configs = [ ":angle_abseil_config" ] |
| 858 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 859 | } |
| 860 | |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 861 | config("angle_compression_config") { |
| 862 | include_dirs = [ "//third_party/zlib/google" ] |
| 863 | } |
| 864 | |
| 865 | group("angle_compression") { |
| 866 | public_configs = [ |
| 867 | ":angle_compression_config", |
| 868 | "//third_party/zlib:zlib_config", |
| 869 | ] |
Jamie Madill | 35d3c41 | 2020-08-26 12:59:18 -0400 | [diff] [blame] | 870 | public_deps = |
| 871 | [ "$angle_zlib_compression_utils_dir:compression_utils_portable" ] |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 872 | } |
| 873 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 874 | angle_source_set("libANGLE_with_capture") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 875 | public_deps = [ ":libANGLE_base" ] |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 876 | deps = [ ":angle_compression" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 877 | public_configs = [ ":angle_frame_capture_enabled" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 878 | sources = libangle_capture_sources |
| 879 | } |
| 880 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 881 | config("shared_library_public_config") { |
James Darpinian | 0dbe7cd | 2020-12-08 12:24:35 -0800 | [diff] [blame] | 882 | if (is_mac && !is_component_build) { |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 883 | # Executable targets that depend on the shared libraries below need to have |
| 884 | # the rpath setup in non-component build configurations. |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 885 | ldflags = [ |
| 886 | "-rpath", |
| 887 | "@executable_path/", |
| 888 | ] |
Jonah Ryan-Davis | 90a8af3 | 2020-03-05 13:48:47 -0500 | [diff] [blame] | 889 | if (build_with_chromium) { |
| 890 | ldflags += [ |
| 891 | # Path for loading shared libraries for unbundled binaries. |
| 892 | # From //build/config/mac/BUILD.gn, this is only added for |
| 893 | # component builds. However, since ANGLE always dynamically |
| 894 | # links to libvulkan, it should be re-added for non-component |
| 895 | # builds. (anglebug.com/4455) |
| 896 | "-Wl,-rpath,@loader_path/.", |
| 897 | ] |
| 898 | } |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 899 | } |
Josh Matthews | 732c9d0 | 2019-11-29 13:59:03 -0500 | [diff] [blame] | 900 | |
| 901 | if (angle_is_winuwp) { |
| 902 | ldflags = [ |
| 903 | "/APPCONTAINER", |
| 904 | |
| 905 | # Disable warning about invalid subsystem number. |
| 906 | # A default appropriate subsystem is selected automatically. |
| 907 | "/IGNORE:4010", |
| 908 | ] |
| 909 | } |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 910 | } |
| 911 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 912 | config("library_name_config") { |
Yuly Novikov | 8b8dc56 | 2020-02-26 19:09:31 -0500 | [diff] [blame] | 913 | if (is_component_build && is_android) { |
| 914 | defines = [ |
| 915 | "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}.cr\"", |
| 916 | "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}.cr\"", |
| 917 | ] |
| 918 | } else { |
| 919 | defines = [ |
| 920 | "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"", |
| 921 | "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"", |
| 922 | ] |
| 923 | } |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 924 | } |
| 925 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 926 | # This config controls export definitions on ANGLE API calls. |
| 927 | config("angle_static") { |
| 928 | defines = [ |
| 929 | "ANGLE_EXPORT=", |
Peng Huang | e99828e | 2021-02-16 19:13:44 -0500 | [diff] [blame^] | 930 | "ANGLE_STATIC=1", |
Jamie Madill | ba319ba | 2018-12-29 10:29:33 -0500 | [diff] [blame] | 931 | "ANGLE_UTIL_EXPORT=", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 932 | "EGLAPI=", |
| 933 | "GL_APICALL=", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 934 | "GL_API=", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 935 | ] |
| 936 | } |
| 937 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 938 | set_defaults("angle_libGLESv2") { |
| 939 | sources = [] |
| 940 | output_name = "libGLESv2" |
| 941 | } |
| 942 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 943 | template("angle_libGLESv2") { |
| 944 | angle_shared_library(target_name) { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 945 | sources = libglesv2_sources + invoker.sources |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 946 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 947 | if (is_win) { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 948 | sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 949 | } |
| 950 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 951 | output_name = "${invoker.output_name}${angle_libs_suffix}" |
| 952 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 953 | configs += [ |
| 954 | ":angle_gl_visibility_config", |
| 955 | ":debug_annotations_config", |
| 956 | ":gl_prototypes", |
| 957 | ] |
| 958 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 959 | defines = [ "LIBGLESV2_IMPLEMENTATION" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 960 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 961 | deps = invoker.deps + [ ":includes" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 962 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 963 | public_deps = [ ":angle_version" ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 964 | } |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 965 | } |
John Abd-El-Malek | 657cd68 | 2014-11-05 14:04:19 -0800 | [diff] [blame] | 966 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 967 | angle_libGLESv2("libGLESv2") { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 968 | if (angle_with_capture_by_default) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 969 | deps = [ ":libANGLE_with_capture" ] |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 970 | } else { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 971 | deps = [ ":libANGLE" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 972 | } |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 973 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 974 | |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 975 | # Output capture lib when `angle_with_capture_by_default` disabled, vice versa. |
| 976 | angle_libGLESv2("libGLESv2_capture_complement") { |
| 977 | if (angle_with_capture_by_default) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 978 | deps = [ ":libANGLE" ] |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 979 | output_name += "_no_capture" |
| 980 | } else { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 981 | deps = [ ":libANGLE_with_capture" ] |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 982 | output_name += "_with_capture" |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 983 | } |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 984 | } |
| 985 | |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 986 | if (is_win && !angle_is_winuwp) { |
Clemen Deng | cb8b4a5 | 2019-07-04 16:05:25 -0400 | [diff] [blame] | 987 | angle_shared_library("libGL") { |
| 988 | sources = libgl_sources |
Clemen Deng | 663b048 | 2019-07-11 12:37:35 -0400 | [diff] [blame] | 989 | |
Clemen Deng | 6e7dd1e | 2019-07-16 13:41:59 -0400 | [diff] [blame] | 990 | output_name = "openGL32" |
| 991 | output_dir = "$root_out_dir/angle_libs" |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 992 | |
| 993 | configs += [ |
| 994 | ":angle_gl_visibility_config", |
| 995 | ":debug_annotations_config", |
| 996 | ":gl_prototypes", |
| 997 | ] |
| 998 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 999 | defines = [ |
| 1000 | "ANGLE_CAPTURE_ENABLED=0", |
Clemen Deng | cb8b4a5 | 2019-07-04 16:05:25 -0400 | [diff] [blame] | 1001 | "LIBGL_IMPLEMENTATION", |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 1002 | ] |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 1003 | |
| 1004 | deps = [ |
| 1005 | ":includes", |
| 1006 | ":libANGLE", |
| 1007 | ] |
| 1008 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1009 | public_deps = [ ":angle_version" ] |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 1010 | } |
| 1011 | } |
| 1012 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1013 | angle_static_library("libGLESv2_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1014 | sources = libglesv2_sources |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1015 | configs += [ ":debug_annotations_config" ] |
| 1016 | public_configs += [ ":angle_static" ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1017 | deps = [ ":includes" ] |
| 1018 | public_deps = [ ":libANGLE" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1019 | } |
| 1020 | |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 1021 | angle_static_library("libGLESv2_with_capture_static") { |
| 1022 | sources = libglesv2_sources |
| 1023 | configs += [ ":debug_annotations_config" ] |
| 1024 | public_configs += [ ":angle_static" ] |
| 1025 | deps = [ ":includes" ] |
| 1026 | public_deps = [ ":libANGLE_with_capture" ] |
| 1027 | } |
| 1028 | |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1029 | angle_shared_library("libGLESv1_CM") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1030 | sources = libglesv1_cm_sources |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1031 | output_name = "libGLESv1_CM${angle_libs_suffix}" |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1032 | |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1033 | configs += [ |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 1034 | ":angle_gl_visibility_config", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1035 | ":debug_annotations_config", |
Jamie Madill | ba319ba | 2018-12-29 10:29:33 -0500 | [diff] [blame] | 1036 | ":gl_prototypes", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1037 | ] |
| 1038 | |
| 1039 | defines = [] |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1040 | |
| 1041 | deps = [ |
| 1042 | ":includes", |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1043 | ":libGLESv2", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1044 | ] |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 1045 | |
| 1046 | if (is_win) { |
| 1047 | sources += [ "src/libGLESv1_CM/libGLESv1_CM.def" ] |
| 1048 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1049 | } |
| 1050 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1051 | angle_static_library("libGLESv1_CM_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1052 | sources = libglesv1_cm_sources |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1053 | configs += [ ":debug_annotations_config" ] |
| 1054 | public_configs += [ ":angle_static" ] |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1055 | deps = [ |
| 1056 | ":includes", |
| 1057 | ":libGLESv2_static", |
| 1058 | ] |
| 1059 | } |
| 1060 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1061 | config("libEGL_egl_loader_config") { |
| 1062 | defines = [ "ANGLE_USE_EGL_LOADER" ] |
| 1063 | } |
| 1064 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1065 | angle_source_set("libEGL_egl_loader") { |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1066 | sources = [ |
| 1067 | "src/libEGL/egl_loader_autogen.cpp", |
| 1068 | "src/libEGL/egl_loader_autogen.h", |
| 1069 | ] |
| 1070 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1071 | public_configs += [ |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1072 | ":libEGL_egl_loader_config", |
| 1073 | ":gl_prototypes", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1074 | ] |
| 1075 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1076 | deps = [ ":includes" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1077 | } |
| 1078 | |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1079 | angle_shared_library("libEGL") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1080 | sources = libegl_sources |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1081 | output_name = "libEGL${angle_libs_suffix}" |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1082 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1083 | configs += [ |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 1084 | ":debug_annotations_config", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1085 | ":library_name_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1086 | ] |
| 1087 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 1088 | defines = [ "LIBEGL_IMPLEMENTATION" ] |
Yuly Novikov | a4ab580 | 2016-12-19 17:44:22 -0500 | [diff] [blame] | 1089 | if (is_win) { |
| 1090 | defines += [ "EGLAPI=" ] |
| 1091 | } else { |
| 1092 | defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ] |
| 1093 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1094 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1095 | if (is_win) { |
Jamie Madill | 23d4b64 | 2020-11-22 13:01:36 -0500 | [diff] [blame] | 1096 | sources += [ "src/libEGL/libEGL_autogen.def" ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1097 | } |
| 1098 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1099 | deps = [ |
James Darpinian | 22ec7dc | 2019-08-06 10:10:52 -0700 | [diff] [blame] | 1100 | ":angle_common", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1101 | ":angle_version", |
| 1102 | ":libEGL_egl_loader", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1103 | ] |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 1104 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1105 | public_deps = [ ":includes" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1106 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1107 | data_deps = [ ":libGLESv2" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1108 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 1109 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1110 | angle_static_library("libEGL_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1111 | sources = libegl_sources |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 1112 | configs += [ |
| 1113 | ":debug_annotations_config", |
| 1114 | ":library_name_config", |
| 1115 | ] |
| 1116 | public_configs += [ ":angle_static" ] |
| 1117 | deps = [ |
| 1118 | ":includes", |
| 1119 | ":libGLESv2_static", |
| 1120 | ] |
| 1121 | } |
| 1122 | |
| 1123 | angle_static_library("libEGL_with_capture_static") { |
| 1124 | sources = libegl_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1125 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1126 | configs += [ |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1127 | ":debug_annotations_config", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1128 | ":library_name_config", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1129 | ] |
| 1130 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1131 | public_configs += [ ":angle_static" ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1132 | |
| 1133 | deps = [ |
| 1134 | ":includes", |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 1135 | ":libGLESv2_with_capture_static", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1136 | ] |
| 1137 | } |
| 1138 | |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1139 | # Convenience targets for some of the samples so they can be built |
| 1140 | # with Chromium's toolchain. |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1141 | angle_executable("angle_shader_translator") { |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1142 | testonly = true |
| 1143 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1144 | sources = [ "samples/shader_translator/shader_translator.cpp" ] |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1145 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1146 | deps = [ ":translator" ] |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1147 | } |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 1148 | |
Stephen White | f4cd174 | 2020-12-21 09:57:58 -0500 | [diff] [blame] | 1149 | if (angle_standalone || build_with_chromium) { |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1150 | config("angle_feature_support_config") { |
| 1151 | include_dirs = [ |
| 1152 | "include", |
| 1153 | "src", |
| 1154 | ] |
| 1155 | defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ] |
| 1156 | if (is_debug) { |
| 1157 | defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ] |
| 1158 | } |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1159 | } |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 1160 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1161 | angle_shared_library("libfeature_support") { |
| 1162 | output_name = "libfeature_support${angle_libs_suffix}" |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1163 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1164 | if (is_android) { |
| 1165 | libs = [ "log" ] |
| 1166 | } |
| 1167 | |
Yuly Novikov | 52afb6f | 2021-01-26 22:22:07 -0500 | [diff] [blame] | 1168 | configs += [ |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1169 | ":angle_feature_support_config", |
| 1170 | "${angle_jsoncpp_dir}:jsoncpp_config", |
| 1171 | ] |
| 1172 | |
Shahbaz Youssefi | 5b8dec5 | 2021-01-12 04:11:56 +0000 | [diff] [blame] | 1173 | if (is_apple && !is_component_build) { |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1174 | ldflags = [ |
| 1175 | "-install_name", |
| 1176 | "@rpath/${target_name}.dylib", |
| 1177 | ] |
| 1178 | } |
| 1179 | |
| 1180 | sources = [ |
| 1181 | "src/feature_support_util/feature_support_util.cpp", |
| 1182 | "src/feature_support_util/feature_support_util.h", |
| 1183 | ] |
| 1184 | |
| 1185 | deps = [ |
| 1186 | ":angle_gpu_info_util", |
| 1187 | "${angle_jsoncpp_dir}:jsoncpp", |
Cezary Kulakowski | 4fb738f | 2019-02-01 10:53:44 +0100 | [diff] [blame] | 1188 | ] |
| 1189 | } |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1190 | } |
| 1191 | |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1192 | if (!is_component_build && is_android && symbol_level != 0) { |
| 1193 | action_foreach("compressed_symbols") { |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1194 | sources = [] |
| 1195 | foreach(_library, angle_libraries) { |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1196 | sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.so" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1197 | } |
| 1198 | if (angle_enable_vulkan_validation_layers) { |
| 1199 | foreach(_layer, vulkan_validation_layers) { |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1200 | sources += [ "$root_out_dir/lib${_layer}.so" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1201 | } |
| 1202 | } |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1203 | |
| 1204 | script = rebase_path("${root_build_dir}/android/compress_symbols.py", |
| 1205 | root_build_dir) |
| 1206 | |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1207 | deps = [] |
| 1208 | foreach(_library, angle_libraries) { |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1209 | deps += [ ":$_library" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1210 | } |
| 1211 | |
| 1212 | if (angle_enable_vulkan_validation_layers) { |
| 1213 | foreach(_layer, vulkan_validation_layers) { |
Jamie Madill | 328f72a | 2020-12-15 19:25:50 -0500 | [diff] [blame] | 1214 | deps += [ "$angle_vulkan_validation_layers_dir:${_layer}" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1215 | } |
| 1216 | } |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1217 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1218 | outputs = [ "$root_out_dir/lib.compressed/{{source_file_part}}" ] |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1219 | |
| 1220 | android_nm = "${android_tool_prefix}nm" |
Tim Van Patten | 73e17bf | 2019-05-14 10:42:25 -0600 | [diff] [blame] | 1221 | android_strip = "${android_tool_prefix}strip" |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1222 | |
| 1223 | args = [ |
| 1224 | "--objcopy", |
| 1225 | rebase_path(android_objcopy, root_build_dir), |
| 1226 | "--nm", |
| 1227 | rebase_path(android_nm, root_build_dir), |
Tim Van Patten | 73e17bf | 2019-05-14 10:42:25 -0600 | [diff] [blame] | 1228 | "--strip", |
| 1229 | rebase_path(android_strip, root_build_dir), |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1230 | "--unstrippedsofile", |
| 1231 | "{{source_dir}}/lib.unstripped/{{source_file_part}}", |
| 1232 | "--output", |
| 1233 | "{{source_dir}}/lib.compressed/{{source_file_part}}", |
| 1234 | ] |
| 1235 | } |
| 1236 | } |
| 1237 | |
Geoff Lang | 6e687af | 2019-10-17 14:36:41 -0400 | [diff] [blame] | 1238 | if (build_with_chromium && !is_component_build && is_android && |
Courtney Goeltzenleuchter | 92b16ea | 2018-12-12 17:06:47 -0700 | [diff] [blame] | 1239 | current_toolchain == default_toolchain) { |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1240 | apk_version_code = "0" |
| 1241 | if (angle_enable_commit_id) { |
| 1242 | apk_version_code = |
| 1243 | exec_script("src/commit_id.py", [ "position" ], "trim string") |
| 1244 | } |
| 1245 | |
| 1246 | # Package ANGLE libraries for normal use on Android |
Cody Northrop | 8cbd321 | 2019-04-23 13:25:20 -0600 | [diff] [blame] | 1247 | angle_apk("angle_chromium_apk") { |
Tobin Ehlis | 736c43a | 2020-08-31 10:23:27 -0600 | [diff] [blame] | 1248 | package_name = "org.chromium.angle" |
Tim Van Patten | ee4fa07 | 2019-02-21 19:21:09 +0000 | [diff] [blame] | 1249 | apk_name = "AngleLibraries" |
Jamie Madill | 7bed2a5 | 2020-09-22 23:37:54 -0400 | [diff] [blame] | 1250 | version_name = "ANGLE Developer Build" |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1251 | version_code = apk_version_code |
| 1252 | } |
Jamie Madill | 7bed2a5 | 2020-09-22 23:37:54 -0400 | [diff] [blame] | 1253 | |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1254 | # Package ANGLE libraries for AGI use on Android |
| 1255 | angle_apk("angle_agi_chromium_apk") { |
| 1256 | package_name = "org.chromium.angle.agi" |
| 1257 | apk_name = "AngleAgiLibraries" |
| 1258 | version_name = "ANGLE AGI Build" |
| 1259 | version_code = apk_version_code |
Cody Northrop | 8e63644 | 2018-11-30 16:24:11 -0700 | [diff] [blame] | 1260 | } |
| 1261 | |
| 1262 | group("angle_apks") { |
Ian Elliott | 7ec4d2d | 2021-02-09 11:48:32 -0700 | [diff] [blame] | 1263 | deps = [ |
| 1264 | ":angle_agi_chromium_apk", |
| 1265 | ":angle_chromium_apk", |
| 1266 | ] |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 1267 | } |
| 1268 | } |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1269 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1270 | group("angle") { |
| 1271 | data_deps = [ |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1272 | ":libEGL", |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 1273 | ":libGLESv1_CM", |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1274 | ":libGLESv2", |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1275 | ] |
| 1276 | } |