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