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