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") |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 11 | |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 12 | declare_args() { |
| 13 | # Use the PCI lib to collect GPU information on Linux. |
| 14 | use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) && |
| 15 | (use_x11 || use_ozone) |
| 16 | } |
| 17 | |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 18 | if (!build_with_chromium) { |
| 19 | group("all") { |
| 20 | testonly = true |
| 21 | deps = [ |
| 22 | ":angle_shader_translator", |
| 23 | ":translator_fuzzer", |
| 24 | "//samples:all", |
| 25 | "//src/tests:all", |
| 26 | ] |
| 27 | } |
| 28 | } |
| 29 | |
Frank Henigman | e8d5c5c | 2016-07-07 13:17:47 -0400 | [diff] [blame] | 30 | if (ozone_platform_gbm) { |
Frank Henigman | 62ba962 | 2016-06-27 17:08:28 -0400 | [diff] [blame] | 31 | pkg_config("libdrm") { |
| 32 | packages = [ "libdrm" ] |
| 33 | } |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 34 | } |
| 35 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 36 | angle_git_is_present = exec_script("src/commit_id.py", |
| 37 | [ |
| 38 | "check", |
| 39 | rebase_path(".", root_build_dir), |
| 40 | ], |
| 41 | "value") |
| 42 | |
| 43 | angle_use_commit_id = angle_git_is_present == 1 |
| 44 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 45 | gles_gypi = exec_script("//build/gypi_to_gn.py", |
| 46 | [ rebase_path("src/libGLESv2.gypi") ], |
| 47 | "scope", |
| 48 | [ "src/libGLESv2.gypi" ]) |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 49 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 50 | compiler_gypi = exec_script("//build/gypi_to_gn.py", |
| 51 | [ rebase_path("src/compiler.gypi") ], |
| 52 | "scope", |
| 53 | [ "src/compiler.gypi" ]) |
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 | |
| 74 | if (target_cpu == "x86") { |
| 75 | defines += [ "ANGLE_X86_CPU" ] |
| 76 | } |
| 77 | if (target_cpu == "x64") { |
| 78 | defines += [ "ANGLE_X64_CPU" ] |
| 79 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 80 | } |
| 81 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 82 | config("extra_warnings") { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 83 | cflags = [] |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 84 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 85 | # Enable more default warnings on Windows. |
| 86 | if (is_win) { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 87 | cflags += [ |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 88 | "/we4244", # Conversion: possible loss of data. |
| 89 | "/we4456", # Variable shadowing. |
Jamie Madill | 1db8a26 | 2016-09-22 13:53:47 -0400 | [diff] [blame] | 90 | "/we4458", # declaration hides class member. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 91 | ] |
| 92 | } |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 93 | if (is_clang) { |
| 94 | # Remove when crbug.com/428099 is resolved. |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 95 | cflags += [ "-Winconsistent-missing-override" ] |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 96 | } |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 97 | } |
| 98 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 99 | if (is_win) { |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 100 | copy("copy_compiler_dll") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 101 | sources = [ |
| 102 | "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll", |
| 103 | ] |
| 104 | outputs = [ |
| 105 | "$root_out_dir/d3dcompiler_47.dll", |
| 106 | ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 107 | } |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 108 | } |
| 109 | |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 110 | angle_undefine_configs = [ "//build/config/compiler:default_include_dirs" ] |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 111 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 112 | # Holds the shared includes so we only need to list them once. |
| 113 | source_set("includes") { |
| 114 | sources = [ |
| 115 | "include/EGL/egl.h", |
| 116 | "include/EGL/eglext.h", |
| 117 | "include/EGL/eglplatform.h", |
| 118 | "include/GLES2/gl2.h", |
| 119 | "include/GLES2/gl2ext.h", |
| 120 | "include/GLES2/gl2platform.h", |
| 121 | "include/GLES3/gl3.h", |
Geoff Lang | ee48376 | 2015-09-15 13:12:07 -0400 | [diff] [blame] | 122 | "include/GLES3/gl31.h", |
| 123 | "include/GLES3/gl32.h", |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 124 | "include/GLES3/gl3platform.h", |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 125 | "include/GLSLANG/ShaderLang.h", |
| 126 | "include/KHR/khrplatform.h", |
| 127 | ] |
| 128 | } |
| 129 | |
| 130 | static_library("preprocessor") { |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 131 | sources = rebase_path(compiler_gypi.angle_preprocessor_sources, ".", "src") |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 132 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 133 | configs -= angle_undefine_configs |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 134 | configs += [ |
| 135 | ":extra_warnings", |
| 136 | ":internal_config", |
| 137 | ] |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 138 | |
| 139 | public_deps = [ |
| 140 | ":angle_common", |
| 141 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 142 | } |
| 143 | |
Corentin Wallez | a5615c6 | 2016-09-19 09:54:44 -0400 | [diff] [blame] | 144 | config("translator_disable_pool_alloc") { |
| 145 | defines = [ "ANGLE_TRANSLATOR_DISABLE_POOL_ALLOC" ] |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 146 | } |
| 147 | |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 148 | config("debug_annotations_config") { |
| 149 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 150 | defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ] |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 151 | } |
| 152 | } |
| 153 | |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 154 | config("angle_release_asserts_config") { |
| 155 | if (dcheck_always_on) { |
| 156 | defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ] |
| 157 | } |
| 158 | } |
| 159 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 160 | config("angle_common_config") { |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 161 | include_dirs = [ "src/common/third_party/base" ] |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 162 | } |
| 163 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 164 | static_library("angle_common") { |
| 165 | sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src") |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 166 | |
Jamie Madill | dcab56a | 2017-01-05 14:47:34 -0500 | [diff] [blame] | 167 | if (is_linux || is_android) { |
| 168 | sources += rebase_path(gles_gypi.libangle_common_linux_sources, ".", "src") |
| 169 | } |
| 170 | |
| 171 | if (is_mac) { |
| 172 | sources += rebase_path(gles_gypi.libangle_common_mac_sources, ".", "src") |
| 173 | } |
| 174 | |
| 175 | if (is_win) { |
| 176 | sources += rebase_path(gles_gypi.libangle_common_win_sources, ".", "src") |
| 177 | } |
| 178 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 179 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 180 | configs += [ |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 181 | ":angle_common_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 182 | ":debug_annotations_config", |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 183 | ":extra_warnings", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 184 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 185 | ] |
Jeremy Roman | 06feb81 | 2016-04-06 16:39:52 -0400 | [diff] [blame] | 186 | |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 187 | public_deps = [ |
| 188 | ":commit_id", |
| 189 | ] |
Jamie Madill | e1fd475 | 2017-04-26 16:46:48 -0400 | [diff] [blame] | 190 | public_configs = [ ":angle_common_config" ] |
| 191 | all_dependent_configs = [ ":angle_release_asserts_config" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 192 | } |
| 193 | |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 194 | config("angle_image_util_config") { |
| 195 | include_dirs = [ |
| 196 | "include", |
| 197 | "src", |
| 198 | ] |
| 199 | } |
| 200 | |
Dirk Pranke | 313d944 | 2016-07-13 18:01:55 -0700 | [diff] [blame] | 201 | static_library("angle_image_util") { |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 202 | sources = rebase_path(gles_gypi.libangle_image_util_sources, ".", "src") |
| 203 | |
| 204 | configs -= angle_undefine_configs |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 205 | configs += [ |
| 206 | ":internal_config", |
| 207 | ":extra_warnings", |
| 208 | ] |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 209 | |
| 210 | public_configs = [ ":angle_image_util_config" ] |
| 211 | |
| 212 | public_deps = [ |
| 213 | ":angle_common", |
| 214 | ] |
| 215 | } |
| 216 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 217 | config("angle_gpu_info_util_config") { |
| 218 | include_dirs = [ |
| 219 | "include", |
| 220 | "src", |
| 221 | ] |
| 222 | } |
| 223 | |
| 224 | static_library("angle_gpu_info_util") { |
| 225 | configs -= angle_undefine_configs |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 226 | configs += [ |
| 227 | ":internal_config", |
| 228 | ":extra_warnings", |
| 229 | ] |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 230 | |
| 231 | public_configs = [ ":angle_gpu_info_util_config" ] |
| 232 | |
| 233 | public_deps = [ |
| 234 | ":angle_common", |
| 235 | ] |
| 236 | |
| 237 | sources = rebase_path(gles_gypi.libangle_gpu_info_util_sources, ".", "src") |
| 238 | deps = [] |
| 239 | libs = [] |
| 240 | defines = [] |
| 241 | |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 242 | if (is_win) { |
| 243 | sources += |
| 244 | rebase_path(gles_gypi.libangle_gpu_info_util_win_sources, ".", "src") |
| 245 | libs += [ "setupapi.lib" ] |
| 246 | defines += [ "GPU_INFO_USE_SETUPAPI" ] |
| 247 | } |
| 248 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 249 | if (is_linux) { |
| 250 | sources += |
| 251 | rebase_path(gles_gypi.libangle_gpu_info_util_linux_sources, ".", "src") |
| 252 | |
| 253 | if (use_x11) { |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 254 | sources += |
| 255 | rebase_path(gles_gypi.libangle_gpu_info_util_x11_sources, ".", "src") |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 256 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
| 257 | defines += [ "GPU_INFO_USE_X11" ] |
| 258 | libs += [ |
| 259 | "X11", |
| 260 | "Xi", |
| 261 | "Xext", |
| 262 | ] |
| 263 | } |
| 264 | } |
| 265 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 266 | if (use_libpci) { |
| 267 | sources += |
| 268 | rebase_path(gles_gypi.libangle_gpu_info_util_libpci_sources, ".", "src") |
| 269 | defines += [ "GPU_INFO_USE_LIBPCI" ] |
| 270 | libs += [ "pci" ] |
| 271 | } |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 272 | |
| 273 | if (is_mac) { |
| 274 | sources += |
| 275 | rebase_path(gles_gypi.libangle_gpu_info_util_mac_sources, ".", "src") |
| 276 | libs += [ |
| 277 | "IOKit.framework", |
| 278 | "CoreFoundation.framework", |
| 279 | ] |
| 280 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 281 | } |
| 282 | |
Yuly Novikov | ea58654 | 2016-11-10 17:33:43 -0500 | [diff] [blame] | 283 | static_library("translator") { |
Yuly Novikov | dfd7fb2 | 2016-11-11 16:05:11 -0500 | [diff] [blame] | 284 | sources = rebase_path(compiler_gypi.angle_translator_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 285 | defines = [] |
| 286 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame^] | 287 | if (angle_enable_essl || use_fuzzing_engine) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 288 | sources += |
Yuly Novikov | dfd7fb2 | 2016-11-11 16:05:11 -0500 | [diff] [blame] | 289 | rebase_path(compiler_gypi.angle_translator_essl_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 290 | defines += [ "ANGLE_ENABLE_ESSL" ] |
| 291 | } |
| 292 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame^] | 293 | if (angle_enable_glsl || use_fuzzing_engine) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 294 | sources += |
Yuly Novikov | dfd7fb2 | 2016-11-11 16:05:11 -0500 | [diff] [blame] | 295 | rebase_path(compiler_gypi.angle_translator_glsl_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 296 | defines += [ "ANGLE_ENABLE_GLSL" ] |
| 297 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 298 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame^] | 299 | if (angle_enable_hlsl || use_fuzzing_engine) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 300 | sources += |
Yuly Novikov | dfd7fb2 | 2016-11-11 16:05:11 -0500 | [diff] [blame] | 301 | rebase_path(compiler_gypi.angle_translator_hlsl_sources, ".", "src") |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 302 | defines += [ "ANGLE_ENABLE_HLSL" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 303 | } |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 304 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame^] | 305 | if (angle_enable_vulkan || use_fuzzing_engine) { |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 306 | sources += rebase_path(compiler_gypi.angle_translator_lib_vulkan_sources, |
| 307 | ".", |
| 308 | "src") |
| 309 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 310 | } |
| 311 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 312 | configs -= angle_undefine_configs |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 313 | configs += [ |
| 314 | ":internal_config", |
| 315 | ":extra_warnings", |
| 316 | ] |
Brett Wilson | 10ac404 | 2014-09-24 10:20:56 -0700 | [diff] [blame] | 317 | public_configs = [ ":external_config" ] |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame^] | 318 | if (use_fuzzing_engine) { |
Corentin Wallez | a5615c6 | 2016-09-19 09:54:44 -0400 | [diff] [blame] | 319 | all_dependent_configs = [ ":translator_disable_pool_alloc" ] |
| 320 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 321 | |
| 322 | deps = [ |
| 323 | ":includes", |
| 324 | ":preprocessor", |
| 325 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 326 | |
| 327 | public_deps = [ |
| 328 | ":angle_common", |
| 329 | ] |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 330 | |
| 331 | if (is_win) { |
| 332 | # Necessary to suppress some system header xtree warnigns in Release. |
| 333 | # For some reason this warning doesn't get triggered in Chromium |
| 334 | cflags = [ "/wd4718" ] |
| 335 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 336 | } |
| 337 | |
Corentin Wallez | 30e11ab | 2016-09-16 10:29:54 -0400 | [diff] [blame] | 338 | source_set("translator_fuzzer") { |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 339 | sources = [ |
| 340 | "src/compiler/fuzz/translator_fuzzer.cpp", |
| 341 | ] |
| 342 | |
| 343 | include_dirs = [ |
| 344 | "include", |
| 345 | "src", |
| 346 | ] |
| 347 | |
| 348 | deps = [ |
Yuly Novikov | e653403 | 2016-11-01 18:19:06 -0400 | [diff] [blame] | 349 | ":translator", |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 350 | ] |
| 351 | } |
| 352 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 353 | config("commit_id_config") { |
| 354 | include_dirs = [ "$root_gen_dir/angle" ] |
| 355 | } |
| 356 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 357 | commit_id_output_file = "$root_gen_dir/angle/id/commit.h" |
| 358 | if (angle_use_commit_id) { |
| 359 | action("commit_id") { |
| 360 | script = "src/commit_id.py" |
| 361 | outputs = [ |
| 362 | commit_id_output_file, |
| 363 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 364 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 365 | args = [ |
| 366 | "gen", |
| 367 | rebase_path(".", root_build_dir), |
| 368 | rebase_path(commit_id_output_file, root_build_dir), |
| 369 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 370 | |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 371 | public_configs = [ ":commit_id_config" ] |
| 372 | } |
| 373 | } else { |
| 374 | copy("commit_id") { |
| 375 | sources = [ |
| 376 | "src/commit.h", |
| 377 | ] |
| 378 | outputs = [ |
| 379 | commit_id_output_file, |
| 380 | ] |
| 381 | public_configs = [ ":commit_id_config" ] |
| 382 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 383 | } |
| 384 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 385 | config("libANGLE_config") { |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 386 | cflags = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 387 | defines = [] |
| 388 | if (angle_enable_d3d9) { |
| 389 | defines += [ "ANGLE_ENABLE_D3D9" ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 390 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 391 | if (angle_enable_d3d11) { |
| 392 | defines += [ "ANGLE_ENABLE_D3D11" ] |
| 393 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 394 | if (angle_enable_gl) { |
| 395 | defines += [ "ANGLE_ENABLE_OPENGL" ] |
Steven Bennetts | 369d03c | 2016-05-05 10:37:38 -0700 | [diff] [blame] | 396 | if (use_x11) { |
| 397 | defines += [ "ANGLE_USE_X11" ] |
| 398 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 399 | } |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 400 | if (angle_enable_vulkan) { |
| 401 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 402 | } |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 403 | if (angle_enable_null) { |
| 404 | defines += [ "ANGLE_ENABLE_NULL" ] |
| 405 | } |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 406 | defines += [ "LIBANGLE_IMPLEMENTATION" ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 407 | |
| 408 | if (is_win) { |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 409 | cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled. |
| 410 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 411 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 412 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 413 | static_library("libANGLE") { |
| 414 | sources = rebase_path(gles_gypi.libangle_sources, ".", "src") |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 415 | |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 416 | include_dirs = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 417 | libs = [] |
Corentin Wallez | 64598b5 | 2016-11-11 08:25:44 -0500 | [diff] [blame] | 418 | defines = [] |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 419 | public_deps = [ |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 420 | ":angle_common", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 421 | ] |
| 422 | deps = [ |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 423 | ":angle_gpu_info_util", |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 424 | ":angle_image_util", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 425 | ":commit_id", |
| 426 | ":includes", |
Yuly Novikov | e653403 | 2016-11-01 18:19:06 -0400 | [diff] [blame] | 427 | ":translator", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 428 | ] |
| 429 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 430 | # Shared D3D sources. |
| 431 | if (angle_enable_d3d9 || angle_enable_d3d11) { |
| 432 | sources += rebase_path(gles_gypi.libangle_d3d_shared_sources, ".", "src") |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 433 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 434 | 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] | 435 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 436 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 437 | if (angle_enable_d3d9) { |
| 438 | sources += rebase_path(gles_gypi.libangle_d3d9_sources, ".", "src") |
| 439 | libs += [ "d3d9.lib" ] |
| 440 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 441 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 442 | if (angle_enable_d3d11) { |
| 443 | sources += rebase_path(gles_gypi.libangle_d3d11_sources, ".", "src") |
| 444 | sources += rebase_path(gles_gypi.libangle_d3d11_win32_sources, ".", "src") |
Austin Kinross | 91e71ed | 2016-08-23 09:29:22 -0700 | [diff] [blame] | 445 | libs += [ "dxguid.lib" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 446 | } |
| 447 | |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 448 | if (angle_enable_gl) { |
| 449 | sources += rebase_path(gles_gypi.libangle_gl_sources, ".", "src") |
| 450 | include_dirs += [ "src/third_party/khronos" ] |
| 451 | |
| 452 | if (is_win) { |
| 453 | sources += rebase_path(gles_gypi.libangle_gl_wgl_sources, ".", "src") |
| 454 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 455 | if (use_x11) { |
Corentin Wallez | 47fc1fe | 2015-05-14 10:54:18 -0400 | [diff] [blame] | 456 | sources += rebase_path(gles_gypi.libangle_gl_glx_sources, ".", "src") |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 457 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 458 | libs += [ |
| 459 | "X11", |
| 460 | "Xi", |
| 461 | "Xext", |
| 462 | ] |
Corentin Wallez | 47fc1fe | 2015-05-14 10:54:18 -0400 | [diff] [blame] | 463 | } |
Nico Weber | de44d3a | 2016-05-13 17:27:57 -0400 | [diff] [blame] | 464 | if (is_mac) { |
| 465 | sources += rebase_path(gles_gypi.libangle_gl_cgl_sources, ".", "src") |
| 466 | libs += [ |
| 467 | "Cocoa.framework", |
| 468 | "IOSurface.framework", |
| 469 | "OpenGL.framework", |
| 470 | "QuartzCore.framework", |
| 471 | ] |
| 472 | } |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 473 | if (is_android) { |
| 474 | sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src") |
| 475 | sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src") |
| 476 | sources += |
| 477 | rebase_path(gles_gypi.libangle_gl_egl_android_sources, ".", "src") |
| 478 | libs += [ |
| 479 | "android", |
| 480 | "log", |
| 481 | ] |
| 482 | } |
Frank Henigman | e8d5c5c | 2016-07-07 13:17:47 -0400 | [diff] [blame] | 483 | if (ozone_platform_gbm) { |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 484 | configs += [ ":libdrm" ] |
| 485 | defines += [ "ANGLE_USE_OZONE" ] |
| 486 | deps += [ "//third_party/minigbm" ] |
| 487 | sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src") |
| 488 | sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src") |
| 489 | sources += rebase_path(gles_gypi.libangle_gl_ozone_sources, ".", "src") |
| 490 | } |
Geoff Lang | c588ac7 | 2015-02-13 15:41:41 -0500 | [diff] [blame] | 491 | } |
| 492 | |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 493 | if (angle_enable_vulkan) { |
| 494 | sources += rebase_path(gles_gypi.libangle_vulkan_sources, ".", "src") |
Frank Henigman | 29f148b | 2016-11-23 21:05:36 -0500 | [diff] [blame] | 495 | if (is_win) { |
| 496 | sources += |
| 497 | rebase_path(gles_gypi.libangle_vulkan_win32_sources, ".", "src") |
| 498 | } |
| 499 | if (is_linux) { |
| 500 | sources += rebase_path(gles_gypi.libangle_vulkan_xcb_sources, ".", "src") |
| 501 | } |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 502 | deps += [ "src/vulkan_support:angle_vulkan" ] |
Jamie Madill | 9e54b5a | 2016-05-25 12:57:39 -0400 | [diff] [blame] | 503 | } |
| 504 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 505 | if (angle_enable_null) { |
| 506 | sources += rebase_path(gles_gypi.libangle_null_sources, ".", "src") |
| 507 | } |
| 508 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 509 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 510 | defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 511 | } |
| 512 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 513 | configs -= angle_undefine_configs |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 514 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 515 | configs += [ |
| 516 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 517 | ":debug_annotations_config", |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 518 | ":extra_warnings", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 519 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 520 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 521 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 522 | public_configs = [ ":libANGLE_config" ] |
| 523 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 524 | if (is_win) { |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 525 | data_deps = [ |
| 526 | ":copy_compiler_dll", |
| 527 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 528 | } |
| 529 | } |
| 530 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 531 | config("shared_library_public_config") { |
| 532 | if (is_mac && !is_component_build) { |
| 533 | # Executable targets that depend on the shared libraries below need to have |
| 534 | # the rpath setup in non-component build configurations. |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 535 | ldflags = [ |
| 536 | "-rpath", |
| 537 | "@executable_path/", |
| 538 | ] |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 539 | } |
| 540 | } |
| 541 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 542 | # This config controls export definitions on ANGLE API calls. |
| 543 | config("angle_static") { |
| 544 | defines = [ |
| 545 | "ANGLE_EXPORT=", |
| 546 | "EGLAPI=", |
| 547 | "GL_APICALL=", |
| 548 | ] |
| 549 | } |
| 550 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 551 | shared_library("libGLESv2") { |
| 552 | sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src") |
| 553 | |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 554 | if (is_android) { |
| 555 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 556 | } |
| 557 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 558 | if (is_win) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 559 | ldflags = |
| 560 | [ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2.def", root_build_dir) ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 561 | } |
John Abd-El-Malek | 657cd68 | 2014-11-05 14:04:19 -0800 | [diff] [blame] | 562 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 563 | if (is_mac && !is_component_build) { |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 564 | ldflags = [ |
| 565 | "-install_name", |
| 566 | "@rpath/${target_name}.dylib", |
| 567 | ] |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 568 | public_configs = [ ":shared_library_public_config" ] |
| 569 | } |
| 570 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 571 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 572 | configs += [ |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 573 | ":commit_id_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 574 | ":debug_annotations_config", |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 575 | ":extra_warnings", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 576 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 577 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 578 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 579 | defines = [ "LIBGLESV2_IMPLEMENTATION" ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 580 | if (is_win) { |
| 581 | defines += [ "GL_APICALL=" ] |
| 582 | } else { |
| 583 | defines += [ "GL_APICALL=__attribute__((visibility(\"default\")))" ] |
| 584 | } |
| 585 | |
| 586 | deps = [ |
| 587 | ":includes", |
| 588 | ":libANGLE", |
Tom Anderson | 26098cb | 2017-05-24 20:39:28 -0700 | [diff] [blame] | 589 | "//build/config:exe_and_shlib_deps", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 590 | ] |
| 591 | } |
| 592 | |
| 593 | static_library("libGLESv2_static") { |
| 594 | sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src") |
| 595 | |
| 596 | configs -= angle_undefine_configs |
| 597 | configs += [ |
| 598 | ":commit_id_config", |
| 599 | ":debug_annotations_config", |
Ben Wagner | d736ccc | 2017-10-11 15:08:22 -0400 | [diff] [blame] | 600 | ":extra_warnings", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 601 | ":internal_config", |
| 602 | ] |
| 603 | |
| 604 | public_configs = [ ":angle_static" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 605 | |
| 606 | deps = [ |
| 607 | ":includes", |
| 608 | ":libANGLE", |
| 609 | ] |
| 610 | } |
| 611 | |
| 612 | shared_library("libEGL") { |
| 613 | sources = rebase_path(gles_gypi.libegl_sources, ".", "src") |
| 614 | |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 615 | if (is_android) { |
| 616 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 617 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 618 | configs -= angle_undefine_configs |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 619 | configs += [ |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 620 | ":commit_id_config", |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 621 | ":debug_annotations_config", |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 622 | ":extra_warnings", |
| 623 | ":internal_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 624 | ] |
| 625 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 626 | defines = [ "LIBEGL_IMPLEMENTATION" ] |
Yuly Novikov | a4ab580 | 2016-12-19 17:44:22 -0500 | [diff] [blame] | 627 | if (is_win) { |
| 628 | defines += [ "EGLAPI=" ] |
| 629 | } else { |
| 630 | defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ] |
| 631 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 632 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 633 | if (is_win) { |
| 634 | ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ] |
| 635 | } |
| 636 | |
| 637 | if (is_mac && !is_component_build) { |
| 638 | ldflags = [ |
| 639 | "-install_name", |
| 640 | "@rpath/${target_name}.dylib", |
| 641 | ] |
| 642 | public_configs = [ ":shared_library_public_config" ] |
| 643 | } |
| 644 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 645 | deps = [ |
| 646 | ":includes", |
| 647 | ":libGLESv2", |
Tom Anderson | 26098cb | 2017-05-24 20:39:28 -0700 | [diff] [blame] | 648 | "//build/config:exe_and_shlib_deps", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 649 | ] |
| 650 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 651 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 652 | static_library("libEGL_static") { |
| 653 | sources = rebase_path(gles_gypi.libegl_sources, ".", "src") |
| 654 | |
| 655 | configs -= angle_undefine_configs |
| 656 | configs += [ |
| 657 | ":commit_id_config", |
| 658 | ":debug_annotations_config", |
| 659 | ":extra_warnings", |
| 660 | ":internal_config", |
| 661 | ] |
| 662 | |
| 663 | public_configs = [ ":angle_static" ] |
| 664 | |
| 665 | deps = [ |
| 666 | ":includes", |
| 667 | ":libGLESv2_static", |
| 668 | ] |
| 669 | } |
| 670 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 671 | util_gypi = exec_script("//build/gypi_to_gn.py", |
| 672 | [ rebase_path("util/util.gyp") ], |
| 673 | "scope", |
| 674 | [ "util/util.gyp" ]) |
| 675 | |
| 676 | config("angle_util_config") { |
| 677 | include_dirs = [ "util" ] |
Frank Henigman | 77df676 | 2016-06-13 16:39:01 -0400 | [diff] [blame] | 678 | if (is_linux && use_x11) { |
Jamie Madill | 1fae355 | 2016-01-07 14:33:48 -0500 | [diff] [blame] | 679 | libs = [ "X11" ] |
| 680 | } |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 681 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 682 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 683 | foreach(is_shared_library, |
| 684 | [ |
| 685 | true, |
| 686 | false, |
| 687 | ]) { |
| 688 | if (is_shared_library) { |
| 689 | library_type = "shared_library" |
| 690 | library_name = "angle_util" |
| 691 | dep_suffix = "" |
| 692 | } else { |
| 693 | library_type = "static_library" |
| 694 | library_name = "angle_util_static" |
| 695 | dep_suffix = "_static" |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 696 | } |
| 697 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 698 | target(library_type, library_name) { |
| 699 | sources = rebase_path(util_gypi.util_sources, ".", "util") |
| 700 | |
| 701 | if (is_win) { |
| 702 | sources += rebase_path(util_gypi.util_win32_sources, ".", "util") |
| 703 | } |
| 704 | |
| 705 | if (is_linux) { |
| 706 | sources += rebase_path(util_gypi.util_linux_sources, ".", "util") |
| 707 | libs = [ |
| 708 | "rt", |
| 709 | "dl", |
| 710 | ] |
| 711 | } |
| 712 | |
| 713 | if (is_mac) { |
| 714 | sources += rebase_path(util_gypi.util_osx_sources, ".", "util") |
| 715 | libs = [ |
| 716 | "AppKit.framework", |
| 717 | "QuartzCore.framework", |
| 718 | ] |
| 719 | } |
| 720 | |
| 721 | if (use_x11) { |
| 722 | sources += rebase_path(util_gypi.util_x11_sources, ".", "util") |
| 723 | } |
| 724 | |
| 725 | if (is_android) { |
Andrew Grieve | 949e070 | 2017-01-16 09:44:49 -0500 | [diff] [blame] | 726 | if (is_shared_library) { |
| 727 | configs -= [ "//build/config/android:hide_all_but_jni_onload" ] |
| 728 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 729 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 730 | # To prevent linux sources filtering on android |
| 731 | set_sources_assignment_filter([]) |
| 732 | sources += rebase_path(util_gypi.util_linux_sources, ".", "util") |
| 733 | sources += rebase_path(util_gypi.util_android_sources, ".", "util") |
| 734 | libs = [ |
| 735 | "android", |
| 736 | "log", |
| 737 | ] |
| 738 | } |
| 739 | |
| 740 | if (use_ozone) { |
| 741 | sources += rebase_path(util_gypi.util_ozone_sources, ".", "util") |
| 742 | } |
| 743 | |
| 744 | configs += [ |
| 745 | ":debug_annotations_config", |
| 746 | ":extra_warnings", |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 747 | ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 748 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 749 | public_configs = [ |
| 750 | ":angle_util_config", |
| 751 | ":internal_config", |
Yuly Novikov | e3352f9 | 2016-08-12 20:40:14 -0400 | [diff] [blame] | 752 | ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 753 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 754 | deps = [ |
| 755 | ":angle_common", |
| 756 | ":libEGL${dep_suffix}", |
| 757 | ":libGLESv2${dep_suffix}", |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 758 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 759 | |
| 760 | if (is_shared_library) { |
| 761 | defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ] |
| 762 | |
Tom Anderson | 26098cb | 2017-05-24 20:39:28 -0700 | [diff] [blame] | 763 | deps += [ "//build/config:exe_and_shlib_deps" ] |
| 764 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 765 | if (is_mac && !is_component_build) { |
| 766 | ldflags = [ |
| 767 | "-install_name", |
| 768 | "@rpath/lib${target_name}.dylib", |
| 769 | ] |
| 770 | public_configs += [ ":shared_library_public_config" ] |
| 771 | } |
| 772 | } |
Yuly Novikov | a6426d6 | 2016-06-03 00:18:38 -0400 | [diff] [blame] | 773 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 774 | } |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 775 | |
| 776 | # Convenience targets for some of the samples so they can be built |
| 777 | # with Chromium's toolchain. |
| 778 | |
| 779 | executable("angle_shader_translator") { |
| 780 | testonly = true |
| 781 | |
| 782 | sources = [ |
Yuly Novikov | f0be43f | 2017-06-29 21:25:56 -0400 | [diff] [blame] | 783 | "samples/shader_translator/shader_translator.cpp", |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 784 | ] |
| 785 | |
| 786 | deps = [ |
Yuly Novikov | f0be43f | 2017-06-29 21:25:56 -0400 | [diff] [blame] | 787 | ":translator", |
| 788 | "//build/config:exe_and_shlib_deps", |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 789 | ] |
| 790 | } |