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