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