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