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