Corentin Wallez | d4bcfa2 | 2015-09-01 10:32:30 -0400 | [diff] [blame] | 1 | # Copyright 2014-2015 The Chromium 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 |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 6 | import("//build/config/dcheck_always_on.gni") |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 7 | import("//build/config/linux/pkg_config.gni") |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 8 | import("//build/config/ui.gni") |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 9 | import("//testing/libfuzzer/fuzzer_test.gni") |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 10 | import("gni/angle.gni") |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 11 | if (is_android) { |
| 12 | # android/rules.gni can only be imported for Android targets |
| 13 | import("//build/config/android/rules.gni") |
| 14 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 15 | |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 16 | declare_args() { |
| 17 | # Use the PCI lib to collect GPU information on Linux. |
| 18 | use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) && |
| 19 | (use_x11 || use_ozone) |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 20 | |
| 21 | # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md. |
| 22 | angle_link_glx = false |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 23 | } |
| 24 | |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 25 | if (!build_with_chromium) { |
| 26 | group("all") { |
| 27 | testonly = true |
| 28 | deps = [ |
| 29 | ":angle_shader_translator", |
| 30 | ":translator_fuzzer", |
| 31 | "//samples:all", |
| 32 | "//src/tests:all", |
| 33 | ] |
| 34 | } |
| 35 | } |
| 36 | |
Frank Henigman | e8d5c5c | 2016-07-07 13:17:47 -0400 | [diff] [blame] | 37 | if (ozone_platform_gbm) { |
Frank Henigman | 62ba962 | 2016-06-27 17:08:28 -0400 | [diff] [blame] | 38 | pkg_config("libdrm") { |
| 39 | packages = [ "libdrm" ] |
| 40 | } |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 41 | } |
| 42 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 43 | angle_git_is_present = exec_script("src/commit_id.py", |
| 44 | [ |
| 45 | "check", |
| 46 | rebase_path(".", root_build_dir), |
| 47 | ], |
| 48 | "value") |
| 49 | |
| 50 | angle_use_commit_id = angle_git_is_present == 1 |
| 51 | |
Frank Henigman | ddc4120 | 2018-08-23 22:11:55 -0400 | [diff] [blame] | 52 | import("src/libGLESv2.gni") |
| 53 | import("src/compiler.gni") |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 54 | |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 55 | # This config is exported to dependent targets (and also applied to internal |
| 56 | # ones). |
| 57 | config("external_config") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 58 | include_dirs = [ "include" ] |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 59 | } |
| 60 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 61 | # This config is applied to internal Angle targets (not pushed to dependents). |
| 62 | config("internal_config") { |
| 63 | include_dirs = [ |
| 64 | "include", |
| 65 | "src", |
| 66 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 67 | |
| 68 | # Prevent the GL headers from redeclaring ANGLE entry points. |
| 69 | defines = [ |
| 70 | "GL_GLEXT_PROTOTYPES", |
| 71 | "EGL_EGLEXT_PROTOTYPES", |
| 72 | ] |
Jamie Madill | 6de5185 | 2017-04-12 09:53:01 -0400 | [diff] [blame] | 73 | |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 74 | if (angle_64bit_current_cpu) { |
Yuly Novikov | c4f1dd8 | 2017-10-25 17:02:29 -0400 | [diff] [blame] | 75 | defines += [ "ANGLE_IS_64_BIT_CPU" ] |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 76 | } else { |
| 77 | defines += [ "ANGLE_IS_32_BIT_CPU" ] |
Jamie Madill | 6de5185 | 2017-04-12 09:53:01 -0400 | [diff] [blame] | 78 | } |
Geoff Lang | b02fc66 | 2018-08-21 09:48:01 -0400 | [diff] [blame^] | 79 | |
| 80 | if (angle_force_thread_safety) { |
| 81 | defines += [ "ANGLE_FORCE_THREAD_SAFETY=1" ] |
| 82 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 83 | } |
| 84 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 85 | config("extra_warnings") { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 86 | cflags = [] |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 87 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 88 | # Enable more default warnings on Windows. |
| 89 | if (is_win) { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 90 | cflags += [ |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 91 | "/we4244", # Conversion: possible loss of data. |
| 92 | "/we4456", # Variable shadowing. |
Jamie Madill | 1db8a26 | 2016-09-22 13:53:47 -0400 | [diff] [blame] | 93 | "/we4458", # declaration hides class member. |
Geoff Lang | b944053 | 2017-11-28 13:26:34 -0500 | [diff] [blame] | 94 | "/we4800", # forcing value to bool. |
| 95 | "/we4838", # narrowing conversion. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 96 | ] |
| 97 | } |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 98 | if (is_clang) { |
Nico Weber | 79de62c | 2018-01-31 10:47:14 -0500 | [diff] [blame] | 99 | cflags += [ |
| 100 | # Remove when crbug.com/428099 is resolved. |
| 101 | "-Winconsistent-missing-override", |
Courtney Goeltzenleuchter | 1521526 | 2018-04-11 12:14:55 -0600 | [diff] [blame] | 102 | "-Wunneeded-internal-declaration", |
Olli Etuaho | 8073a95 | 2018-05-09 16:41:39 +0300 | [diff] [blame] | 103 | "-Wnon-virtual-dtor", |
Nico Weber | 79de62c | 2018-01-31 10:47:14 -0500 | [diff] [blame] | 104 | ] |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 105 | } |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 106 | } |
| 107 | |
Courtney Goeltzenleuchter | 4607148 | 2018-05-15 13:35:15 -0600 | [diff] [blame] | 108 | # This config adds build-ids to the associated library. |
| 109 | # -Wl is a special option that indicates that clang should pass the associated |
| 110 | # option --build-id to the linker. This will cause a build-id section to be added |
| 111 | # to the associated library. The build-id makes it possible for a debugger to |
| 112 | # find the right symbol file to use. |
| 113 | config("build_id_config") { |
| 114 | ldflags = [ "-Wl,--build-id" ] |
| 115 | } |
| 116 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 117 | if (is_win) { |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 118 | copy("copy_compiler_dll") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 119 | sources = [ |
| 120 | "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll", |
| 121 | ] |
| 122 | outputs = [ |
| 123 | "$root_out_dir/d3dcompiler_47.dll", |
| 124 | ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 125 | } |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 126 | } |
| 127 | |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 128 | angle_undefine_configs = [ "//build/config/compiler:default_include_dirs" ] |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 129 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 130 | # Holds the shared includes so we only need to list them once. |
| 131 | source_set("includes") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 132 | sources = libangle_includes |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | static_library("preprocessor") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 136 | sources = angle_preprocessor_sources |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 137 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 138 | configs -= angle_undefine_configs |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 139 | configs += [ |
| 140 | ":extra_warnings", |
| 141 | ":internal_config", |
| 142 | ] |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 143 | |
| 144 | public_deps = [ |
| 145 | ":angle_common", |
| 146 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 147 | } |
| 148 | |
Corentin Wallez | a5615c6 | 2016-09-19 09:54:44 -0400 | [diff] [blame] | 149 | config("translator_disable_pool_alloc") { |
| 150 | defines = [ "ANGLE_TRANSLATOR_DISABLE_POOL_ALLOC" ] |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 151 | } |
| 152 | |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 153 | config("debug_annotations_config") { |
| 154 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 155 | defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ] |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 156 | } |
| 157 | } |
| 158 | |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 159 | config("angle_release_asserts_config") { |
| 160 | if (dcheck_always_on) { |
| 161 | defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ] |
| 162 | } |
| 163 | } |
| 164 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 165 | config("angle_common_config") { |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 166 | include_dirs = [ "src/common/third_party/base" ] |
Yuly Novikov | e762400 | 2018-01-27 18:27:07 -0500 | [diff] [blame] | 167 | if (is_android) { |
| 168 | libs = [ "log" ] |
| 169 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 170 | } |
| 171 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 172 | static_library("angle_common") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 173 | sources = libangle_common_sources |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 174 | |
Jamie Madill | d7ebfb9 | 2018-02-15 16:34:29 -0500 | [diff] [blame] | 175 | if (is_linux || is_android || is_fuchsia) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 176 | sources += libangle_common_linux_sources |
Jamie Madill | dcab56a | 2017-01-05 14:47:34 -0500 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | if (is_mac) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 180 | sources += libangle_common_mac_sources |
Jamie Madill | dcab56a | 2017-01-05 14:47:34 -0500 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 184 | sources += libangle_common_win_sources |
Jamie Madill | dcab56a | 2017-01-05 14:47:34 -0500 | [diff] [blame] | 185 | } |
| 186 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 187 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 188 | configs += [ |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 189 | ":angle_common_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 190 | ":debug_annotations_config", |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 191 | ":extra_warnings", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 192 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 193 | ] |
Jeremy Roman | 06feb81 | 2016-04-06 16:39:52 -0400 | [diff] [blame] | 194 | |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 195 | public_deps = [ |
| 196 | ":commit_id", |
Jamie Madill | 8d986bf | 2018-02-21 08:28:01 -0500 | [diff] [blame] | 197 | ":includes", |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 198 | ] |
Jamie Madill | e1fd475 | 2017-04-26 16:46:48 -0400 | [diff] [blame] | 199 | public_configs = [ ":angle_common_config" ] |
| 200 | all_dependent_configs = [ ":angle_release_asserts_config" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 201 | } |
| 202 | |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 203 | config("angle_image_util_config") { |
| 204 | include_dirs = [ |
| 205 | "include", |
| 206 | "src", |
| 207 | ] |
| 208 | } |
| 209 | |
Dirk Pranke | 313d944 | 2016-07-13 18:01:55 -0700 | [diff] [blame] | 210 | static_library("angle_image_util") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 211 | sources = libangle_image_util_sources |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 212 | |
| 213 | configs -= angle_undefine_configs |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 214 | configs += [ |
| 215 | ":internal_config", |
| 216 | ":extra_warnings", |
| 217 | ] |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 218 | |
| 219 | public_configs = [ ":angle_image_util_config" ] |
| 220 | |
| 221 | public_deps = [ |
| 222 | ":angle_common", |
| 223 | ] |
| 224 | } |
| 225 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 226 | config("angle_gpu_info_util_config") { |
| 227 | include_dirs = [ |
| 228 | "include", |
| 229 | "src", |
| 230 | ] |
| 231 | } |
| 232 | |
| 233 | static_library("angle_gpu_info_util") { |
| 234 | configs -= angle_undefine_configs |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 235 | configs += [ |
| 236 | ":internal_config", |
| 237 | ":extra_warnings", |
| 238 | ] |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 239 | |
| 240 | public_configs = [ ":angle_gpu_info_util_config" ] |
| 241 | |
| 242 | public_deps = [ |
| 243 | ":angle_common", |
| 244 | ] |
| 245 | |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 246 | sources = libangle_gpu_info_util_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 247 | deps = [] |
| 248 | libs = [] |
| 249 | defines = [] |
| 250 | |
Ian Elliott | d07c52e | 2018-06-22 15:42:09 -0600 | [diff] [blame] | 251 | if (is_android) { |
| 252 | sources += [ "src/gpu_info_util/SystemInfo_android.cpp" ] |
| 253 | } |
| 254 | |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 255 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 256 | sources += libangle_gpu_info_util_win_sources |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 257 | libs += [ "setupapi.lib" ] |
| 258 | defines += [ "GPU_INFO_USE_SETUPAPI" ] |
| 259 | } |
| 260 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 261 | if (is_linux) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 262 | sources += libangle_gpu_info_util_linux_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 263 | |
| 264 | if (use_x11) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 265 | sources += libangle_gpu_info_util_x11_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 266 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
| 267 | defines += [ "GPU_INFO_USE_X11" ] |
| 268 | libs += [ |
| 269 | "X11", |
| 270 | "Xi", |
| 271 | "Xext", |
| 272 | ] |
| 273 | } |
| 274 | } |
| 275 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 276 | if (use_libpci) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 277 | sources += libangle_gpu_info_util_libpci_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 278 | defines += [ "GPU_INFO_USE_LIBPCI" ] |
| 279 | libs += [ "pci" ] |
| 280 | } |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 281 | |
| 282 | if (is_mac) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 283 | sources += libangle_gpu_info_util_mac_sources |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 284 | libs += [ |
| 285 | "IOKit.framework", |
| 286 | "CoreFoundation.framework", |
Corentin Wallez | 163965d | 2017-10-11 11:38:55 -0400 | [diff] [blame] | 287 | "CoreGraphics.framework", |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 288 | ] |
| 289 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 290 | } |
| 291 | |
Yuly Novikov | ea58654 | 2016-11-10 17:33:43 -0500 | [diff] [blame] | 292 | static_library("translator") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 293 | sources = angle_translator_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 294 | defines = [] |
| 295 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 296 | if (angle_enable_essl || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 297 | sources += angle_translator_essl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 298 | defines += [ "ANGLE_ENABLE_ESSL" ] |
| 299 | } |
| 300 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 301 | if (angle_enable_glsl || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 302 | sources += angle_translator_glsl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 303 | defines += [ "ANGLE_ENABLE_GLSL" ] |
| 304 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 305 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 306 | if (angle_enable_hlsl || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 307 | sources += angle_translator_hlsl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 308 | defines += [ "ANGLE_ENABLE_HLSL" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 309 | } |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 310 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 311 | if (angle_enable_vulkan || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 312 | sources += angle_translator_lib_vulkan_sources |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 313 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 314 | } |
| 315 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 316 | configs -= angle_undefine_configs |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 317 | configs += [ |
| 318 | ":internal_config", |
| 319 | ":extra_warnings", |
| 320 | ] |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 321 | public_configs = [ ":external_config" ] |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 322 | if (use_fuzzing_engine) { |
Corentin Wallez | a5615c6 | 2016-09-19 09:54:44 -0400 | [diff] [blame] | 323 | all_dependent_configs = [ ":translator_disable_pool_alloc" ] |
| 324 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 325 | |
| 326 | deps = [ |
| 327 | ":includes", |
| 328 | ":preprocessor", |
| 329 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 330 | |
| 331 | public_deps = [ |
| 332 | ":angle_common", |
| 333 | ] |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 334 | |
| 335 | if (is_win) { |
| 336 | # Necessary to suppress some system header xtree warnigns in Release. |
| 337 | # For some reason this warning doesn't get triggered in Chromium |
| 338 | cflags = [ "/wd4718" ] |
| 339 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 340 | } |
| 341 | |
Corentin Wallez | 30e11ab | 2016-09-16 10:29:54 -0400 | [diff] [blame] | 342 | source_set("translator_fuzzer") { |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 343 | sources = [ |
| 344 | "src/compiler/fuzz/translator_fuzzer.cpp", |
| 345 | ] |
| 346 | |
| 347 | include_dirs = [ |
| 348 | "include", |
| 349 | "src", |
| 350 | ] |
| 351 | |
| 352 | deps = [ |
Yuly Novikov | e653403 | 2016-11-01 18:19:06 -0400 | [diff] [blame] | 353 | ":translator", |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 354 | ] |
| 355 | } |
| 356 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 357 | config("commit_id_config") { |
| 358 | include_dirs = [ "$root_gen_dir/angle" ] |
| 359 | } |
| 360 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 361 | commit_id_output_file = "$root_gen_dir/angle/id/commit.h" |
| 362 | if (angle_use_commit_id) { |
| 363 | action("commit_id") { |
| 364 | script = "src/commit_id.py" |
| 365 | outputs = [ |
| 366 | commit_id_output_file, |
| 367 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 368 | |
Takuto Ikuta | c93eeaa | 2018-08-07 16:25:42 +0900 | [diff] [blame] | 369 | # commit id should depend on angle's HEAD revision |
Frank Henigman | a7f97a2 | 2018-08-21 00:04:05 -0400 | [diff] [blame] | 370 | inputs = [ |
| 371 | ".git/HEAD", |
| 372 | ] |
Takuto Ikuta | c93eeaa | 2018-08-07 16:25:42 +0900 | [diff] [blame] | 373 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 374 | args = [ |
| 375 | "gen", |
| 376 | rebase_path(".", root_build_dir), |
| 377 | rebase_path(commit_id_output_file, root_build_dir), |
| 378 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 379 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 380 | public_configs = [ ":commit_id_config" ] |
| 381 | } |
| 382 | } else { |
| 383 | copy("commit_id") { |
| 384 | sources = [ |
| 385 | "src/commit.h", |
| 386 | ] |
| 387 | outputs = [ |
| 388 | commit_id_output_file, |
| 389 | ] |
| 390 | public_configs = [ ":commit_id_config" ] |
| 391 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 392 | } |
| 393 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 394 | config("libANGLE_config") { |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 395 | cflags = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 396 | defines = [] |
| 397 | if (angle_enable_d3d9) { |
| 398 | defines += [ "ANGLE_ENABLE_D3D9" ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 399 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 400 | if (angle_enable_d3d11) { |
| 401 | defines += [ "ANGLE_ENABLE_D3D11" ] |
| 402 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 403 | if (angle_enable_gl) { |
| 404 | defines += [ "ANGLE_ENABLE_OPENGL" ] |
Steven Bennetts | 369d03c | 2016-05-05 10:37:38 -0700 | [diff] [blame] | 405 | if (use_x11) { |
| 406 | defines += [ "ANGLE_USE_X11" ] |
| 407 | } |
Jamie Madill | 6d94f06 | 2017-10-21 22:19:40 -0400 | [diff] [blame] | 408 | if (angle_enable_gl_null) { |
| 409 | defines += [ "ANGLE_ENABLE_OPENGL_NULL" ] |
| 410 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 411 | } |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 412 | if (angle_enable_vulkan) { |
| 413 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 414 | } |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 415 | if (angle_enable_null) { |
| 416 | defines += [ "ANGLE_ENABLE_NULL" ] |
| 417 | } |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 418 | defines += [ "LIBANGLE_IMPLEMENTATION" ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 419 | |
| 420 | if (is_win) { |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 421 | cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled. |
| 422 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 423 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 424 | |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 425 | if (angle_enable_vulkan) { |
| 426 | # Use this target to include everything ANGLE needs for Vulkan. |
| 427 | group("angle_vulkan") { |
| 428 | deps = [ |
Jamie Madill | a1134ba | 2018-02-07 15:24:47 -0500 | [diff] [blame] | 429 | "$angle_root/third_party/glslang:glslang", |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 430 | ] |
| 431 | public_deps = [ |
Tobin Ehlis | b971f49 | 2018-05-24 10:56:17 -0600 | [diff] [blame] | 432 | "$angle_root/third_party/vulkan-headers:vulkan_headers", |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 433 | ] |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 434 | public_configs = [ |
Jamie Madill | a1134ba | 2018-02-07 15:24:47 -0500 | [diff] [blame] | 435 | "$angle_root/third_party/glslang:glslang_config", |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 436 | "$angle_root/third_party/vulkan-validation-layers:vulkan_config", |
| 437 | ] |
Courtney Goeltzenleuchter | e5db628 | 2018-04-26 08:05:18 -0600 | [diff] [blame] | 438 | data_deps = [] |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 439 | if (!is_android) { |
Tobin Ehlis | b971f49 | 2018-05-24 10:56:17 -0600 | [diff] [blame] | 440 | deps += [ "$angle_root/third_party/vulkan-loader:libvulkan" ] |
| 441 | data_deps += [ "$angle_root/third_party/vulkan-tools:VkICD_mock_icd" ] |
| 442 | public_configs += |
| 443 | [ "$angle_root/third_party/vulkan-loader:vulkan_loader_config" ] |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 444 | } |
Courtney Goeltzenleuchter | ec10096 | 2018-04-10 13:43:46 -0600 | [diff] [blame] | 445 | |
| 446 | if (angle_enable_vulkan_validation_layers) { |
Courtney Goeltzenleuchter | e5db628 | 2018-04-26 08:05:18 -0600 | [diff] [blame] | 447 | data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_validation_layers" ] |
Courtney Goeltzenleuchter | ec10096 | 2018-04-10 13:43:46 -0600 | [diff] [blame] | 448 | if (!is_android) { |
Courtney Goeltzenleuchter | e5db628 | 2018-04-26 08:05:18 -0600 | [diff] [blame] | 449 | data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_gen_json_files" ] |
Courtney Goeltzenleuchter | ec10096 | 2018-04-10 13:43:46 -0600 | [diff] [blame] | 450 | } |
| 451 | } |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 452 | } |
| 453 | } |
| 454 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 455 | static_library("libANGLE") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 456 | sources = libangle_sources |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 457 | |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 458 | include_dirs = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 459 | libs = [] |
Corentin Wallez | 64598b5 | 2016-11-11 08:25:44 -0500 | [diff] [blame] | 460 | defines = [] |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 461 | if (angle_link_glx) { |
| 462 | libs += [ "GL" ] |
| 463 | defines += [ "ANGLE_LINK_GLX" ] |
| 464 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 465 | public_deps = [ |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 466 | ":angle_common", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 467 | ] |
| 468 | deps = [ |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 469 | ":angle_gpu_info_util", |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 470 | ":angle_image_util", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 471 | ":commit_id", |
| 472 | ":includes", |
Yuly Novikov | e653403 | 2016-11-01 18:19:06 -0400 | [diff] [blame] | 473 | ":translator", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 474 | ] |
| 475 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 476 | # Shared D3D sources. |
| 477 | if (angle_enable_d3d9 || angle_enable_d3d11) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 478 | sources += libangle_d3d_shared_sources |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 479 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 480 | 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] | 481 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 482 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 483 | if (angle_enable_d3d9) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 484 | sources += libangle_d3d9_sources |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 485 | libs += [ "d3d9.lib" ] |
| 486 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 487 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 488 | if (angle_enable_d3d11) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 489 | sources += libangle_d3d11_sources |
| 490 | sources += libangle_d3d11_win32_sources |
Austin Kinross | 91e71ed | 2016-08-23 09:29:22 -0700 | [diff] [blame] | 491 | libs += [ "dxguid.lib" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 492 | } |
| 493 | |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 494 | if (angle_enable_gl) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 495 | sources += libangle_gl_sources |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 496 | include_dirs += [ "src/third_party/khronos" ] |
| 497 | |
Jamie Madill | 6d94f06 | 2017-10-21 22:19:40 -0400 | [diff] [blame] | 498 | if (angle_enable_gl_null) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 499 | sources += libangle_gl_null_sources |
Jamie Madill | 6d94f06 | 2017-10-21 22:19:40 -0400 | [diff] [blame] | 500 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 501 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 502 | sources += libangle_gl_wgl_sources |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 503 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 504 | if (use_x11) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 505 | sources += libangle_gl_glx_sources |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 506 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 507 | libs += [ |
| 508 | "X11", |
| 509 | "Xi", |
| 510 | "Xext", |
| 511 | ] |
Corentin Wallez | 47fc1fe | 2015-05-14 10:54:18 -0400 | [diff] [blame] | 512 | } |
Nico Weber | de44d3a | 2016-05-13 17:27:57 -0400 | [diff] [blame] | 513 | if (is_mac) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 514 | sources += libangle_gl_cgl_sources |
Nico Weber | de44d3a | 2016-05-13 17:27:57 -0400 | [diff] [blame] | 515 | libs += [ |
| 516 | "Cocoa.framework", |
| 517 | "IOSurface.framework", |
| 518 | "OpenGL.framework", |
| 519 | "QuartzCore.framework", |
| 520 | ] |
| 521 | } |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 522 | if (is_android) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 523 | sources += libangle_gl_egl_sources |
| 524 | sources += libangle_gl_egl_dl_sources |
| 525 | sources += libangle_gl_egl_android_sources |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 526 | if (ndk_supports_nativewindow) { |
| 527 | libs += [ "nativewindow" ] |
| 528 | } else { |
| 529 | libs += [ "android" ] |
| 530 | } |
| 531 | libs += [ "log" ] |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 532 | } |
Frank Henigman | e8d5c5c | 2016-07-07 13:17:47 -0400 | [diff] [blame] | 533 | if (ozone_platform_gbm) { |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 534 | configs += [ ":libdrm" ] |
| 535 | defines += [ "ANGLE_USE_OZONE" ] |
| 536 | deps += [ "//third_party/minigbm" ] |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 537 | sources += libangle_gl_egl_sources |
| 538 | sources += libangle_gl_egl_dl_sources |
| 539 | sources += libangle_gl_ozone_sources |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 540 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 541 | } |
| 542 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 543 | if (angle_enable_vulkan) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 544 | sources += libangle_vulkan_sources |
Frank Henigman | 29f148b | 2016-11-23 21:05:36 -0500 | [diff] [blame] | 545 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 546 | sources += libangle_vulkan_win32_sources |
Frank Henigman | 29f148b | 2016-11-23 21:05:36 -0500 | [diff] [blame] | 547 | } |
| 548 | if (is_linux) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 549 | sources += libangle_vulkan_xcb_sources |
Frank Henigman | 29f148b | 2016-11-23 21:05:36 -0500 | [diff] [blame] | 550 | } |
Yuly Novikov | 199f429 | 2018-01-19 19:04:05 -0500 | [diff] [blame] | 551 | if (is_android) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 552 | sources += libangle_vulkan_android_sources |
Yuly Novikov | 199f429 | 2018-01-19 19:04:05 -0500 | [diff] [blame] | 553 | } |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 554 | deps += [ ":angle_vulkan" ] |
Tobin Ehlis | b971f49 | 2018-05-24 10:56:17 -0600 | [diff] [blame] | 555 | public_deps += [ "$angle_root/third_party/vulkan-headers:vulkan_headers" ] |
Jamie Madill | d47044a | 2018-04-27 11:45:03 -0400 | [diff] [blame] | 556 | |
| 557 | # Include generated shaders. |
| 558 | import("src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.gni") |
| 559 | sources += angle_vulkan_internal_shaders |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 560 | } |
| 561 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 562 | if (angle_enable_null) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 563 | sources += libangle_null_sources |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 564 | } |
| 565 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 566 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 567 | defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 568 | } |
| 569 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 570 | configs -= angle_undefine_configs |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 571 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 572 | configs += [ |
| 573 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 574 | ":debug_annotations_config", |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 575 | ":extra_warnings", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 576 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 577 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 578 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 579 | public_configs = [ ":libANGLE_config" ] |
| 580 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 581 | if (is_win) { |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 582 | data_deps = [ |
| 583 | ":copy_compiler_dll", |
| 584 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 585 | } |
| 586 | } |
| 587 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 588 | config("shared_library_public_config") { |
| 589 | if (is_mac && !is_component_build) { |
| 590 | # Executable targets that depend on the shared libraries below need to have |
| 591 | # the rpath setup in non-component build configurations. |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 592 | ldflags = [ |
| 593 | "-rpath", |
| 594 | "@executable_path/", |
| 595 | ] |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 596 | } |
| 597 | } |
| 598 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 599 | # This config controls export definitions on ANGLE API calls. |
| 600 | config("angle_static") { |
| 601 | defines = [ |
| 602 | "ANGLE_EXPORT=", |
| 603 | "EGLAPI=", |
| 604 | "GL_APICALL=", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 605 | "GL_API=", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 606 | ] |
| 607 | } |
| 608 | |
Yuly Novikov | ad4f964 | 2018-02-08 17:58:46 -0500 | [diff] [blame] | 609 | shared_library("libGLESv2${angle_libs_suffix}") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 610 | sources = libglesv2_sources |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 611 | |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 612 | if (is_android) { |
| 613 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
Courtney Goeltzenleuchter | 4607148 | 2018-05-15 13:35:15 -0600 | [diff] [blame] | 614 | configs += [ ":build_id_config" ] |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 615 | } |
| 616 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 617 | if (is_win) { |
Jamie Madill | 74a7632 | 2018-05-14 09:11:51 -0400 | [diff] [blame] | 618 | ldflags = [ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2_autogen.def", |
| 619 | root_build_dir) ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 620 | } |
John Abd-El-Malek | 657cd68 | 2014-11-05 14:04:19 -0800 | [diff] [blame] | 621 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 622 | if (is_mac && !is_component_build) { |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 623 | ldflags = [ |
| 624 | "-install_name", |
| 625 | "@rpath/${target_name}.dylib", |
| 626 | ] |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 627 | public_configs = [ ":shared_library_public_config" ] |
| 628 | } |
| 629 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 630 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 631 | configs += [ |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 632 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 633 | ":debug_annotations_config", |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 634 | ":extra_warnings", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 635 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 636 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 637 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 638 | defines = [ "LIBGLESV2_IMPLEMENTATION" ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 639 | if (is_win) { |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 640 | defines += [ |
| 641 | "GL_APICALL=", |
| 642 | "GL_API=", |
| 643 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 644 | } else { |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 645 | defines += [ |
| 646 | "GL_APICALL=__attribute__((visibility(\"default\")))", |
| 647 | "GL_API=__attribute__((visibility(\"default\")))", |
| 648 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 649 | } |
| 650 | |
| 651 | deps = [ |
| 652 | ":includes", |
| 653 | ":libANGLE", |
| 654 | ] |
| 655 | } |
| 656 | |
| 657 | static_library("libGLESv2_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 658 | sources = libglesv2_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 659 | |
| 660 | configs -= angle_undefine_configs |
| 661 | configs += [ |
| 662 | ":commit_id_config", |
| 663 | ":debug_annotations_config", |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 664 | ":extra_warnings", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 665 | ":internal_config", |
| 666 | ] |
| 667 | |
| 668 | public_configs = [ ":angle_static" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 669 | |
| 670 | deps = [ |
| 671 | ":includes", |
| 672 | ":libANGLE", |
| 673 | ] |
| 674 | } |
| 675 | |
Yuly Novikov | ad4f964 | 2018-02-08 17:58:46 -0500 | [diff] [blame] | 676 | shared_library("libGLESv1_CM${angle_libs_suffix}") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 677 | sources = libglesv1_cm_sources |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 678 | |
| 679 | if (is_android) { |
| 680 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
Courtney Goeltzenleuchter | 4607148 | 2018-05-15 13:35:15 -0600 | [diff] [blame] | 681 | configs += [ ":build_id_config" ] |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 682 | } |
Lingfeng Yang | 4edce33 | 2018-02-14 19:01:31 -0800 | [diff] [blame] | 683 | |
| 684 | if (is_mac && !is_component_build) { |
| 685 | ldflags = [ |
| 686 | "-install_name", |
| 687 | "@rpath/${target_name}.dylib", |
| 688 | ] |
| 689 | public_configs = [ ":shared_library_public_config" ] |
| 690 | } |
| 691 | |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 692 | configs -= angle_undefine_configs |
| 693 | configs += [ |
| 694 | ":commit_id_config", |
| 695 | ":debug_annotations_config", |
| 696 | ":extra_warnings", |
| 697 | ":internal_config", |
| 698 | ] |
| 699 | |
| 700 | defines = [] |
| 701 | if (is_win) { |
| 702 | defines += [ |
| 703 | "GL_APICALL=", |
| 704 | "GL_API=", |
| 705 | ] |
| 706 | } else { |
| 707 | defines += [ |
| 708 | "GL_APICALL=__attribute__((visibility(\"default\")))", |
| 709 | "GL_API=__attribute__((visibility(\"default\")))", |
| 710 | ] |
| 711 | } |
| 712 | |
| 713 | deps = [ |
| 714 | ":includes", |
Yuly Novikov | ad4f964 | 2018-02-08 17:58:46 -0500 | [diff] [blame] | 715 | ":libGLESv2${angle_libs_suffix}", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 716 | ] |
| 717 | } |
| 718 | |
| 719 | static_library("libGLESv1_CM_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 720 | sources = libglesv1_cm_sources |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 721 | |
| 722 | configs -= angle_undefine_configs |
| 723 | configs += [ |
| 724 | ":commit_id_config", |
| 725 | ":debug_annotations_config", |
| 726 | ":extra_warnings", |
| 727 | ":internal_config", |
| 728 | ] |
| 729 | |
| 730 | public_configs = [ ":angle_static" ] |
| 731 | |
| 732 | deps = [ |
| 733 | ":includes", |
| 734 | ":libGLESv2_static", |
| 735 | ] |
| 736 | } |
| 737 | |
Yuly Novikov | ad4f964 | 2018-02-08 17:58:46 -0500 | [diff] [blame] | 738 | shared_library("libEGL${angle_libs_suffix}") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 739 | sources = libegl_sources |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 740 | |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 741 | if (is_android) { |
| 742 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
Courtney Goeltzenleuchter | 4607148 | 2018-05-15 13:35:15 -0600 | [diff] [blame] | 743 | configs += [ ":build_id_config" ] |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 744 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 745 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 746 | configs += [ |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 747 | ":commit_id_config", |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 748 | ":debug_annotations_config", |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 749 | ":extra_warnings", |
| 750 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 751 | ] |
| 752 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 753 | defines = [ "LIBEGL_IMPLEMENTATION" ] |
Yuly Novikov | a4ab580 | 2016-12-19 17:44:22 -0500 | [diff] [blame] | 754 | if (is_win) { |
| 755 | defines += [ "EGLAPI=" ] |
| 756 | } else { |
| 757 | defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ] |
| 758 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 759 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 760 | if (is_win) { |
| 761 | ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ] |
| 762 | } |
| 763 | |
| 764 | if (is_mac && !is_component_build) { |
| 765 | ldflags = [ |
| 766 | "-install_name", |
| 767 | "@rpath/${target_name}.dylib", |
| 768 | ] |
| 769 | public_configs = [ ":shared_library_public_config" ] |
| 770 | } |
| 771 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 772 | deps = [ |
| 773 | ":includes", |
Yuly Novikov | ad4f964 | 2018-02-08 17:58:46 -0500 | [diff] [blame] | 774 | ":libGLESv2${angle_libs_suffix}", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 775 | ] |
| 776 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 777 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 778 | static_library("libEGL_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 779 | sources = libegl_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 780 | |
| 781 | configs -= angle_undefine_configs |
| 782 | configs += [ |
| 783 | ":commit_id_config", |
| 784 | ":debug_annotations_config", |
| 785 | ":extra_warnings", |
| 786 | ":internal_config", |
| 787 | ] |
| 788 | |
| 789 | public_configs = [ ":angle_static" ] |
| 790 | |
| 791 | deps = [ |
| 792 | ":includes", |
| 793 | ":libGLESv2_static", |
| 794 | ] |
| 795 | } |
| 796 | |
Frank Henigman | ddc4120 | 2018-08-23 22:11:55 -0400 | [diff] [blame] | 797 | import("util/util.gni") |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 798 | |
| 799 | config("angle_util_config") { |
| 800 | include_dirs = [ "util" ] |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 801 | if (is_linux && use_x11) { |
Jamie Madill | 1fae355 | 2016-01-07 14:33:48 -0500 | [diff] [blame] | 802 | libs = [ "X11" ] |
| 803 | } |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 804 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 805 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 806 | foreach(is_shared_library, |
| 807 | [ |
| 808 | true, |
| 809 | false, |
| 810 | ]) { |
| 811 | if (is_shared_library) { |
| 812 | library_type = "shared_library" |
| 813 | library_name = "angle_util" |
Yuly Novikov | ad4f964 | 2018-02-08 17:58:46 -0500 | [diff] [blame] | 814 | dep_suffix = "${angle_libs_suffix}" |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 815 | } else { |
| 816 | library_type = "static_library" |
| 817 | library_name = "angle_util_static" |
| 818 | dep_suffix = "_static" |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 819 | } |
| 820 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 821 | target(library_type, library_name) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 822 | sources = util_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 823 | |
| 824 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 825 | sources += util_win32_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 826 | } |
| 827 | |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 828 | libs = [] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 829 | if (is_linux) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 830 | sources += util_linux_sources |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 831 | libs += [ |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 832 | "rt", |
| 833 | "dl", |
| 834 | ] |
| 835 | } |
| 836 | |
| 837 | if (is_mac) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 838 | sources += util_osx_sources |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 839 | libs += [ |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 840 | "AppKit.framework", |
| 841 | "QuartzCore.framework", |
| 842 | ] |
| 843 | } |
| 844 | |
| 845 | if (use_x11) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 846 | sources += util_x11_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 847 | } |
| 848 | |
| 849 | if (is_android) { |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 850 | if (is_shared_library) { |
| 851 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 852 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 853 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 854 | # To prevent linux sources filtering on android |
| 855 | set_sources_assignment_filter([]) |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 856 | sources += util_linux_sources |
| 857 | sources += util_android_sources |
Yuly Novikov | cd70aa4 | 2018-06-20 17:05:32 -0400 | [diff] [blame] | 858 | libs += [ |
| 859 | "android", |
| 860 | "log", |
| 861 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 862 | } |
| 863 | |
| 864 | if (use_ozone) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 865 | sources += util_ozone_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 866 | } |
| 867 | |
| 868 | configs += [ |
| 869 | ":debug_annotations_config", |
| 870 | ":extra_warnings", |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 871 | ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 872 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 873 | public_configs = [ |
| 874 | ":angle_util_config", |
| 875 | ":internal_config", |
Yuly Novikov | e3352f9 | 2016-08-12 20:40:14 -0400 | [diff] [blame] | 876 | ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 877 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 878 | deps = [ |
| 879 | ":angle_common", |
| 880 | ":libEGL${dep_suffix}", |
| 881 | ":libGLESv2${dep_suffix}", |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 882 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 883 | |
| 884 | if (is_shared_library) { |
| 885 | defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ] |
| 886 | |
| 887 | if (is_mac && !is_component_build) { |
| 888 | ldflags = [ |
| 889 | "-install_name", |
| 890 | "@rpath/lib${target_name}.dylib", |
| 891 | ] |
| 892 | public_configs += [ ":shared_library_public_config" ] |
| 893 | } |
| 894 | } |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 895 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 896 | } |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 897 | |
| 898 | # Convenience targets for some of the samples so they can be built |
| 899 | # with Chromium's toolchain. |
| 900 | |
| 901 | executable("angle_shader_translator") { |
| 902 | testonly = true |
| 903 | |
| 904 | sources = [ |
Yuly Novikov | f0be43f | 2017-06-29 21:25:56 -0400 | [diff] [blame] | 905 | "samples/shader_translator/shader_translator.cpp", |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 906 | ] |
| 907 | |
| 908 | deps = [ |
Yuly Novikov | f0be43f | 2017-06-29 21:25:56 -0400 | [diff] [blame] | 909 | ":translator", |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 910 | ] |
| 911 | } |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 912 | |
| 913 | if (is_android) { |
| 914 | # Package ANGLE libraries for pre-installed system image |
| 915 | android_apk("angle_apk") { |
| 916 | if (build_apk_secondary_abi && android_64bit_target_cpu) { |
| 917 | secondary_abi_shared_libraries = [ |
Courtney Goeltzenleuchter | e5db628 | 2018-04-26 08:05:18 -0600 | [diff] [blame] | 918 | "//third_party/angle:libEGL${angle_libs_suffix}($android_secondary_abi_toolchain)", |
Courtney Goeltzenleuchter | ddd7724 | 2018-04-30 10:31:18 -0600 | [diff] [blame] | 919 | "//third_party/angle:libGLESv1_CM${angle_libs_suffix}($android_secondary_abi_toolchain)", |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 920 | "//third_party/angle:libGLESv2${angle_libs_suffix}($android_secondary_abi_toolchain)", |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 921 | ] |
| 922 | } |
| 923 | |
| 924 | android_manifest = "AndroidManifest.xml" |
Courtney Goeltzenleuchter | e5db628 | 2018-04-26 08:05:18 -0600 | [diff] [blame] | 925 | |
| 926 | # requires_sdk_api_level_23 tells the apk tool that this apk is only |
| 927 | # supported on M or later releases (which is true for Vulkan). |
| 928 | # Allows tool to optimize for that. |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 929 | requires_sdk_api_level_23 = true |
Courtney Goeltzenleuchter | 8c1508b | 2018-07-30 09:46:27 -0600 | [diff] [blame] | 930 | apk_name = "ANGLEPrebuilt" |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 931 | uncompress_shared_libraries = true |
| 932 | shared_libraries = [ |
Courtney Goeltzenleuchter | e5db628 | 2018-04-26 08:05:18 -0600 | [diff] [blame] | 933 | "//third_party/angle:libEGL${angle_libs_suffix}", |
Courtney Goeltzenleuchter | ddd7724 | 2018-04-30 10:31:18 -0600 | [diff] [blame] | 934 | "//third_party/angle:libGLESv1_CM${angle_libs_suffix}", |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 935 | "//third_party/angle:libGLESv2${angle_libs_suffix}", |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 936 | ] |
| 937 | } |
| 938 | } |