blob: a5ae6886861b7c5ec7af90de2050b16f52d86232 [file] [log] [blame]
Corentin Wallezd4bcfa22015-09-01 10:32:30 -04001# Copyright 2014-2015 The Chromium Authors. All rights reserved.
Jamie Madill72f5b5e2014-06-23 15:13:02 -04002# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Corentin Wallez51e2ad12015-05-26 11:32:58 -04005# import the use_x11 variable
Jamie Madille31fd872016-05-27 08:35:36 -04006import("//build/config/dcheck_always_on.gni")
Frank Henigman77df6762016-06-13 16:39:01 -04007import("//build/config/linux/pkg_config.gni")
Corentin Wallez51e2ad12015-05-26 11:32:58 -04008import("//build/config/ui.gni")
Corentin Wallez28b65282016-06-16 07:24:50 -07009import("//testing/libfuzzer/fuzzer_test.gni")
Frank Henigmand0ef13a2017-08-28 22:53:24 -040010import("gni/angle.gni")
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -060011if (is_android) {
12 # android/rules.gni can only be imported for Android targets
13 import("//build/config/android/rules.gni")
14}
Corentin Wallez51e2ad12015-05-26 11:32:58 -040015
Corentin Wallez16d4e472017-03-20 13:06:19 -040016declare_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 Henigmane42ec182017-12-11 23:58:53 -050020
21 # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md.
22 angle_link_glx = false
Corentin Wallez16d4e472017-03-20 13:06:19 -040023}
24
Frank Henigmand0ef13a2017-08-28 22:53:24 -040025if (!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 Henigmane8d5c5c2016-07-07 13:17:47 -040037if (ozone_platform_gbm) {
Frank Henigman62ba9622016-06-27 17:08:28 -040038 pkg_config("libdrm") {
39 packages = [ "libdrm" ]
40 }
Frank Henigman77df6762016-06-13 16:39:01 -040041}
42
Tomasz Moniuszko319fb8982015-07-30 14:34:54 +020043angle_git_is_present = exec_script("src/commit_id.py",
44 [
45 "check",
46 rebase_path(".", root_build_dir),
47 ],
48 "value")
49
50angle_use_commit_id = angle_git_is_present == 1
51
Jamie Madilledbc2442016-01-04 11:25:00 -050052gles_gypi = exec_script("//build/gypi_to_gn.py",
53 [ rebase_path("src/libGLESv2.gypi") ],
54 "scope",
55 [ "src/libGLESv2.gypi" ])
Brett Wilson04bac602014-07-16 14:19:18 -070056
Jamie Madilledbc2442016-01-04 11:25:00 -050057compiler_gypi = exec_script("//build/gypi_to_gn.py",
58 [ rebase_path("src/compiler.gypi") ],
59 "scope",
60 [ "src/compiler.gypi" ])
Brett Wilson04bac602014-07-16 14:19:18 -070061
Brett Wilson2f5469c2014-07-22 17:00:17 -070062# This config is exported to dependent targets (and also applied to internal
63# ones).
64config("external_config") {
Jamie Madilledbc2442016-01-04 11:25:00 -050065 include_dirs = [ "include" ]
Brett Wilson2f5469c2014-07-22 17:00:17 -070066}
67
Jamie Madill72f5b5e2014-06-23 15:13:02 -040068# This config is applied to internal Angle targets (not pushed to dependents).
69config("internal_config") {
70 include_dirs = [
71 "include",
72 "src",
73 ]
Jamie Madill80ab03c2017-01-03 11:03:23 -050074
75 # Prevent the GL headers from redeclaring ANGLE entry points.
76 defines = [
77 "GL_GLEXT_PROTOTYPES",
78 "EGL_EGLEXT_PROTOTYPES",
79 ]
Jamie Madill6de51852017-04-12 09:53:01 -040080
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -060081 if (angle_64bit_current_cpu) {
Yuly Novikovc4f1dd82017-10-25 17:02:29 -040082 defines += [ "ANGLE_IS_64_BIT_CPU" ]
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -060083 } else {
84 defines += [ "ANGLE_IS_32_BIT_CPU" ]
Jamie Madill6de51852017-04-12 09:53:01 -040085 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -040086}
87
Jamie Madill509a1d42016-07-18 10:10:29 -040088config("extra_warnings") {
Ben Wagner211bff32017-10-10 23:53:20 -040089 cflags = []
Frank Henigmand0ef13a2017-08-28 22:53:24 -040090
Jamie Madill509a1d42016-07-18 10:10:29 -040091 # Enable more default warnings on Windows.
92 if (is_win) {
Ben Wagner211bff32017-10-10 23:53:20 -040093 cflags += [
Jamie Madill509a1d42016-07-18 10:10:29 -040094 "/we4244", # Conversion: possible loss of data.
95 "/we4456", # Variable shadowing.
Jamie Madill1db8a262016-09-22 13:53:47 -040096 "/we4458", # declaration hides class member.
Geoff Langb9440532017-11-28 13:26:34 -050097 "/we4800", # forcing value to bool.
98 "/we4838", # narrowing conversion.
Jamie Madill509a1d42016-07-18 10:10:29 -040099 ]
100 }
Ben Wagner211bff32017-10-10 23:53:20 -0400101 if (is_clang) {
Nico Weber79de62c2018-01-31 10:47:14 -0500102 cflags += [
103 # Remove when crbug.com/428099 is resolved.
104 "-Winconsistent-missing-override",
Courtney Goeltzenleuchter15215262018-04-11 12:14:55 -0600105 "-Wunneeded-internal-declaration",
Olli Etuaho8073a952018-05-09 16:41:39 +0300106 "-Wnon-virtual-dtor",
Nico Weber79de62c2018-01-31 10:47:14 -0500107 ]
Ben Wagner211bff32017-10-10 23:53:20 -0400108 }
Jamie Madill509a1d42016-07-18 10:10:29 -0400109}
110
Courtney Goeltzenleuchter46071482018-05-15 13:35:15 -0600111# This config adds build-ids to the associated library.
112# -Wl is a special option that indicates that clang should pass the associated
113# option --build-id to the linker. This will cause a build-id section to be added
114# to the associated library. The build-id makes it possible for a debugger to
115# find the right symbol file to use.
116config("build_id_config") {
117 ldflags = [ "-Wl,--build-id" ]
118}
119
Daniel Bratell73941de2015-02-25 14:34:49 +0100120if (is_win) {
Daniel Bratell73941de2015-02-25 14:34:49 +0100121 copy("copy_compiler_dll") {
Jamie Madilledbc2442016-01-04 11:25:00 -0500122 sources = [
123 "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll",
124 ]
125 outputs = [
126 "$root_out_dir/d3dcompiler_47.dll",
127 ]
Daniel Bratell73941de2015-02-25 14:34:49 +0100128 }
Daniel Bratell73941de2015-02-25 14:34:49 +0100129}
130
Jamie Madilla8503ce2016-07-18 13:47:12 -0400131angle_undefine_configs = [ "//build/config/compiler:default_include_dirs" ]
Jamie Madille2e406c2016-06-02 13:04:10 -0400132
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400133# Holds the shared includes so we only need to list them once.
134source_set("includes") {
Jamie Madillff7aac52017-11-13 16:57:14 -0500135 sources = rebase_path(gles_gypi.libangle_includes, ".", "src")
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400136}
137
138static_library("preprocessor") {
Brett Wilson04bac602014-07-16 14:19:18 -0700139 sources = rebase_path(compiler_gypi.angle_preprocessor_sources, ".", "src")
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400140
Jamie Madille2e406c2016-06-02 13:04:10 -0400141 configs -= angle_undefine_configs
Ben Wagnerd736ccc2017-10-11 15:08:22 -0400142 configs += [
143 ":extra_warnings",
144 ":internal_config",
145 ]
Corentin Wallez054f7ed2016-09-20 17:15:59 -0400146
147 public_deps = [
148 ":angle_common",
149 ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400150}
151
Corentin Walleza5615c62016-09-19 09:54:44 -0400152config("translator_disable_pool_alloc") {
153 defines = [ "ANGLE_TRANSLATOR_DISABLE_POOL_ALLOC" ]
Jamie Madille5c97ab2014-08-07 12:31:38 -0400154}
155
Cooper Partin75da1972015-06-16 15:03:14 -0700156config("debug_annotations_config") {
157 if (is_debug) {
Jamie Madilledbc2442016-01-04 11:25:00 -0500158 defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ]
Cooper Partin75da1972015-06-16 15:03:14 -0700159 }
160}
161
Jamie Madille31fd872016-05-27 08:35:36 -0400162config("angle_release_asserts_config") {
163 if (dcheck_always_on) {
164 defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ]
165 }
166}
167
Jamie Madille2e406c2016-06-02 13:04:10 -0400168config("angle_common_config") {
Jamie Madill5ea762a2017-06-07 14:59:51 -0400169 include_dirs = [ "src/common/third_party/base" ]
Yuly Novikove7624002018-01-27 18:27:07 -0500170 if (is_android) {
171 libs = [ "log" ]
172 }
Jamie Madille2e406c2016-06-02 13:04:10 -0400173}
174
Jamie Madill562e81b2015-01-14 14:31:02 -0500175static_library("angle_common") {
176 sources = rebase_path(gles_gypi.libangle_common_sources, ".", "src")
Cooper Partin75da1972015-06-16 15:03:14 -0700177
Jamie Madilld7ebfb92018-02-15 16:34:29 -0500178 if (is_linux || is_android || is_fuchsia) {
Jamie Madilldcab56a2017-01-05 14:47:34 -0500179 sources += rebase_path(gles_gypi.libangle_common_linux_sources, ".", "src")
180 }
181
182 if (is_mac) {
183 sources += rebase_path(gles_gypi.libangle_common_mac_sources, ".", "src")
184 }
185
186 if (is_win) {
187 sources += rebase_path(gles_gypi.libangle_common_win_sources, ".", "src")
188 }
189
Jamie Madille2e406c2016-06-02 13:04:10 -0400190 configs -= angle_undefine_configs
Jamie Madill562e81b2015-01-14 14:31:02 -0500191 configs += [
Jamie Madille2e406c2016-06-02 13:04:10 -0400192 ":angle_common_config",
Cooper Partin75da1972015-06-16 15:03:14 -0700193 ":debug_annotations_config",
Jamie Madill509a1d42016-07-18 10:10:29 -0400194 ":extra_warnings",
Jamie Madille2e406c2016-06-02 13:04:10 -0400195 ":internal_config",
Jamie Madill562e81b2015-01-14 14:31:02 -0500196 ]
Jeremy Roman06feb812016-04-06 16:39:52 -0400197
Yuly Novikov87ae8cd2016-05-19 17:59:55 -0400198 public_deps = [
199 ":commit_id",
Jamie Madill8d986bf2018-02-21 08:28:01 -0500200 ":includes",
Yuly Novikov87ae8cd2016-05-19 17:59:55 -0400201 ]
Jamie Madille1fd4752017-04-26 16:46:48 -0400202 public_configs = [ ":angle_common_config" ]
203 all_dependent_configs = [ ":angle_release_asserts_config" ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500204}
205
Geoff Lang6e4cfce2016-06-13 15:06:31 -0400206config("angle_image_util_config") {
207 include_dirs = [
208 "include",
209 "src",
210 ]
211}
212
Dirk Pranke313d9442016-07-13 18:01:55 -0700213static_library("angle_image_util") {
Geoff Lang6e4cfce2016-06-13 15:06:31 -0400214 sources = rebase_path(gles_gypi.libangle_image_util_sources, ".", "src")
215
216 configs -= angle_undefine_configs
Corentin Wallez878baf92017-02-15 13:57:16 -0500217 configs += [
218 ":internal_config",
219 ":extra_warnings",
220 ]
Geoff Lang6e4cfce2016-06-13 15:06:31 -0400221
222 public_configs = [ ":angle_image_util_config" ]
223
224 public_deps = [
225 ":angle_common",
226 ]
227}
228
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500229config("angle_gpu_info_util_config") {
230 include_dirs = [
231 "include",
232 "src",
233 ]
234}
235
236static_library("angle_gpu_info_util") {
237 configs -= angle_undefine_configs
Corentin Wallez878baf92017-02-15 13:57:16 -0500238 configs += [
239 ":internal_config",
240 ":extra_warnings",
241 ]
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500242
243 public_configs = [ ":angle_gpu_info_util_config" ]
244
245 public_deps = [
246 ":angle_common",
247 ]
248
249 sources = rebase_path(gles_gypi.libangle_gpu_info_util_sources, ".", "src")
250 deps = []
251 libs = []
252 defines = []
253
Ian Elliottd07c52e2018-06-22 15:42:09 -0600254 if (is_android) {
255 sources += [ "src/gpu_info_util/SystemInfo_android.cpp" ]
256 }
257
Corentin Wallez8f77e5d2017-03-24 11:58:59 -0700258 if (is_win) {
259 sources +=
260 rebase_path(gles_gypi.libangle_gpu_info_util_win_sources, ".", "src")
261 libs += [ "setupapi.lib" ]
262 defines += [ "GPU_INFO_USE_SETUPAPI" ]
263 }
264
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500265 if (is_linux) {
266 sources +=
267 rebase_path(gles_gypi.libangle_gpu_info_util_linux_sources, ".", "src")
268
269 if (use_x11) {
Corentin Wallez878baf92017-02-15 13:57:16 -0500270 sources +=
271 rebase_path(gles_gypi.libangle_gpu_info_util_x11_sources, ".", "src")
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500272 deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
273 defines += [ "GPU_INFO_USE_X11" ]
274 libs += [
275 "X11",
276 "Xi",
277 "Xext",
278 ]
279 }
280 }
281
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500282 if (use_libpci) {
283 sources +=
284 rebase_path(gles_gypi.libangle_gpu_info_util_libpci_sources, ".", "src")
285 defines += [ "GPU_INFO_USE_LIBPCI" ]
286 libs += [ "pci" ]
287 }
Corentin Wallezd83f64f2017-02-16 10:58:46 -0500288
289 if (is_mac) {
290 sources +=
291 rebase_path(gles_gypi.libangle_gpu_info_util_mac_sources, ".", "src")
292 libs += [
293 "IOKit.framework",
294 "CoreFoundation.framework",
Corentin Wallez163965d2017-10-11 11:38:55 -0400295 "CoreGraphics.framework",
Corentin Wallezd83f64f2017-02-16 10:58:46 -0500296 ]
297 }
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500298}
299
Yuly Novikovea586542016-11-10 17:33:43 -0500300static_library("translator") {
Yuly Novikovdfd7fb22016-11-11 16:05:11 -0500301 sources = rebase_path(compiler_gypi.angle_translator_sources, ".", "src")
Austin Kinross82b5ab62015-12-11 09:30:15 -0800302 defines = []
303
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700304 if (angle_enable_essl || use_fuzzing_engine) {
Jamie Madilledbc2442016-01-04 11:25:00 -0500305 sources +=
Yuly Novikovdfd7fb22016-11-11 16:05:11 -0500306 rebase_path(compiler_gypi.angle_translator_essl_sources, ".", "src")
Austin Kinross82b5ab62015-12-11 09:30:15 -0800307 defines += [ "ANGLE_ENABLE_ESSL" ]
308 }
309
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700310 if (angle_enable_glsl || use_fuzzing_engine) {
Jamie Madilledbc2442016-01-04 11:25:00 -0500311 sources +=
Yuly Novikovdfd7fb22016-11-11 16:05:11 -0500312 rebase_path(compiler_gypi.angle_translator_glsl_sources, ".", "src")
Austin Kinross82b5ab62015-12-11 09:30:15 -0800313 defines += [ "ANGLE_ENABLE_GLSL" ]
314 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400315
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700316 if (angle_enable_hlsl || use_fuzzing_engine) {
Jamie Madilledbc2442016-01-04 11:25:00 -0500317 sources +=
Yuly Novikovdfd7fb22016-11-11 16:05:11 -0500318 rebase_path(compiler_gypi.angle_translator_hlsl_sources, ".", "src")
Austin Kinross82b5ab62015-12-11 09:30:15 -0800319 defines += [ "ANGLE_ENABLE_HLSL" ]
Daniel Bratell73941de2015-02-25 14:34:49 +0100320 }
Jamie Madille794cd82017-01-13 17:29:51 -0500321
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700322 if (angle_enable_vulkan || use_fuzzing_engine) {
Jamie Madille794cd82017-01-13 17:29:51 -0500323 sources += rebase_path(compiler_gypi.angle_translator_lib_vulkan_sources,
324 ".",
325 "src")
326 defines += [ "ANGLE_ENABLE_VULKAN" ]
327 }
328
Jamie Madille2e406c2016-06-02 13:04:10 -0400329 configs -= angle_undefine_configs
Ben Wagnerd736ccc2017-10-11 15:08:22 -0400330 configs += [
331 ":internal_config",
332 ":extra_warnings",
333 ]
Brett Wilson10ac4042014-09-24 10:20:56 -0700334 public_configs = [ ":external_config" ]
Jonathan Metzmanfb9051a2017-10-09 16:14:06 -0700335 if (use_fuzzing_engine) {
Corentin Walleza5615c62016-09-19 09:54:44 -0400336 all_dependent_configs = [ ":translator_disable_pool_alloc" ]
337 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400338
339 deps = [
340 ":includes",
341 ":preprocessor",
342 ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500343
344 public_deps = [
345 ":angle_common",
346 ]
Jamie Madilla8503ce2016-07-18 13:47:12 -0400347
348 if (is_win) {
349 # Necessary to suppress some system header xtree warnigns in Release.
350 # For some reason this warning doesn't get triggered in Chromium
351 cflags = [ "/wd4718" ]
352 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400353}
354
Corentin Wallez30e11ab2016-09-16 10:29:54 -0400355source_set("translator_fuzzer") {
Corentin Wallez28b65282016-06-16 07:24:50 -0700356 sources = [
357 "src/compiler/fuzz/translator_fuzzer.cpp",
358 ]
359
360 include_dirs = [
361 "include",
362 "src",
363 ]
364
365 deps = [
Yuly Novikove6534032016-11-01 18:19:06 -0400366 ":translator",
Corentin Wallez28b65282016-06-16 07:24:50 -0700367 ]
368}
369
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400370config("commit_id_config") {
371 include_dirs = [ "$root_gen_dir/angle" ]
372}
373
Tomasz Moniuszko319fb8982015-07-30 14:34:54 +0200374commit_id_output_file = "$root_gen_dir/angle/id/commit.h"
375if (angle_use_commit_id) {
376 action("commit_id") {
377 script = "src/commit_id.py"
378 outputs = [
379 commit_id_output_file,
380 ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400381
Tomasz Moniuszko319fb8982015-07-30 14:34:54 +0200382 args = [
383 "gen",
384 rebase_path(".", root_build_dir),
385 rebase_path(commit_id_output_file, root_build_dir),
386 ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400387
Tomasz Moniuszko319fb8982015-07-30 14:34:54 +0200388 public_configs = [ ":commit_id_config" ]
389 }
390} else {
391 copy("commit_id") {
392 sources = [
393 "src/commit.h",
394 ]
395 outputs = [
396 commit_id_output_file,
397 ]
398 public_configs = [ ":commit_id_config" ]
399 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400400}
401
Jamie Madill562e81b2015-01-14 14:31:02 -0500402config("libANGLE_config") {
Austin Kinross40853472015-02-12 10:39:56 -0800403 cflags = []
Jamie Madill562e81b2015-01-14 14:31:02 -0500404 defines = []
405 if (angle_enable_d3d9) {
406 defines += [ "ANGLE_ENABLE_D3D9" ]
Geoff Lang2b5420c2014-11-19 14:20:15 -0500407 }
Jamie Madill562e81b2015-01-14 14:31:02 -0500408 if (angle_enable_d3d11) {
409 defines += [ "ANGLE_ENABLE_D3D11" ]
410 }
Geoff Langc588ac72015-02-13 15:41:41 -0500411 if (angle_enable_gl) {
412 defines += [ "ANGLE_ENABLE_OPENGL" ]
Steven Bennetts369d03c2016-05-05 10:37:38 -0700413 if (use_x11) {
414 defines += [ "ANGLE_USE_X11" ]
415 }
Jamie Madill6d94f062017-10-21 22:19:40 -0400416 if (angle_enable_gl_null) {
417 defines += [ "ANGLE_ENABLE_OPENGL_NULL" ]
418 }
Corentin Wallez51e2ad12015-05-26 11:32:58 -0400419 }
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400420 if (angle_enable_vulkan) {
421 defines += [ "ANGLE_ENABLE_VULKAN" ]
422 }
Geoff Langd08f3b32016-09-23 15:56:30 -0400423 if (angle_enable_null) {
424 defines += [ "ANGLE_ENABLE_NULL" ]
425 }
Jamie Madill80ab03c2017-01-03 11:03:23 -0500426 defines += [ "LIBANGLE_IMPLEMENTATION" ]
Corentin Wallezbeb81582015-09-02 10:30:55 -0400427
428 if (is_win) {
Austin Kinross40853472015-02-12 10:39:56 -0800429 cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics are not enabled.
430 }
Jamie Madill562e81b2015-01-14 14:31:02 -0500431}
Geoff Lang2b5420c2014-11-19 14:20:15 -0500432
Jamie Madillb62a1c22018-02-06 09:54:02 -0500433if (angle_enable_vulkan) {
434 # Use this target to include everything ANGLE needs for Vulkan.
435 group("angle_vulkan") {
436 deps = [
Jamie Madilla1134ba2018-02-07 15:24:47 -0500437 "$angle_root/third_party/glslang:glslang",
Jamie Madillb62a1c22018-02-06 09:54:02 -0500438 ]
439 public_deps = [
Tobin Ehlisb971f492018-05-24 10:56:17 -0600440 "$angle_root/third_party/vulkan-headers:vulkan_headers",
Jamie Madillb62a1c22018-02-06 09:54:02 -0500441 ]
Jamie Madillb62a1c22018-02-06 09:54:02 -0500442 public_configs = [
Jamie Madilla1134ba2018-02-07 15:24:47 -0500443 "$angle_root/third_party/glslang:glslang_config",
Jamie Madillb62a1c22018-02-06 09:54:02 -0500444 "$angle_root/third_party/vulkan-validation-layers:vulkan_config",
445 ]
Courtney Goeltzenleuchtere5db6282018-04-26 08:05:18 -0600446 data_deps = []
Jamie Madillb62a1c22018-02-06 09:54:02 -0500447 if (!is_android) {
Tobin Ehlisb971f492018-05-24 10:56:17 -0600448 deps += [ "$angle_root/third_party/vulkan-loader:libvulkan" ]
449 data_deps += [ "$angle_root/third_party/vulkan-tools:VkICD_mock_icd" ]
450 public_configs +=
451 [ "$angle_root/third_party/vulkan-loader:vulkan_loader_config" ]
Jamie Madillb62a1c22018-02-06 09:54:02 -0500452 }
Courtney Goeltzenleuchterec100962018-04-10 13:43:46 -0600453
454 if (angle_enable_vulkan_validation_layers) {
Courtney Goeltzenleuchtere5db6282018-04-26 08:05:18 -0600455 data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_validation_layers" ]
Courtney Goeltzenleuchterec100962018-04-10 13:43:46 -0600456 if (!is_android) {
Courtney Goeltzenleuchtere5db6282018-04-26 08:05:18 -0600457 data_deps += [ "$angle_root/third_party/vulkan-validation-layers:vulkan_gen_json_files" ]
Courtney Goeltzenleuchterec100962018-04-10 13:43:46 -0600458 }
459 }
Jamie Madillb62a1c22018-02-06 09:54:02 -0500460 }
461}
462
Jamie Madill562e81b2015-01-14 14:31:02 -0500463static_library("libANGLE") {
464 sources = rebase_path(gles_gypi.libangle_sources, ".", "src")
Geoff Lang2b5420c2014-11-19 14:20:15 -0500465
Jamie Madill5ea762a2017-06-07 14:59:51 -0400466 include_dirs = []
Jamie Madill562e81b2015-01-14 14:31:02 -0500467 libs = []
Corentin Wallez64598b52016-11-11 08:25:44 -0500468 defines = []
Frank Henigmane42ec182017-12-11 23:58:53 -0500469 if (angle_link_glx) {
470 libs += [ "GL" ]
471 defines += [ "ANGLE_LINK_GLX" ]
472 }
Jamie Madille2e406c2016-06-02 13:04:10 -0400473 public_deps = [
Corentin Wallezcc068e92016-02-29 16:37:04 -0500474 ":angle_common",
Jamie Madille2e406c2016-06-02 13:04:10 -0400475 ]
476 deps = [
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500477 ":angle_gpu_info_util",
Corentin Wallez878baf92017-02-15 13:57:16 -0500478 ":angle_image_util",
Corentin Wallezcc068e92016-02-29 16:37:04 -0500479 ":commit_id",
480 ":includes",
Yuly Novikove6534032016-11-01 18:19:06 -0400481 ":translator",
Corentin Wallezcc068e92016-02-29 16:37:04 -0500482 ]
483
Jamie Madill562e81b2015-01-14 14:31:02 -0500484 # Shared D3D sources.
485 if (angle_enable_d3d9 || angle_enable_d3d11) {
486 sources += rebase_path(gles_gypi.libangle_d3d_shared_sources, ".", "src")
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400487
Jamie Madilledbc2442016-01-04 11:25:00 -0500488 defines += [ "ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ " + "\"d3dcompiler_47.dll\", \"d3dcompiler_46.dll\", \"d3dcompiler_43.dll\" }" ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500489 }
Geoff Lang2b5420c2014-11-19 14:20:15 -0500490
Jamie Madill562e81b2015-01-14 14:31:02 -0500491 if (angle_enable_d3d9) {
492 sources += rebase_path(gles_gypi.libangle_d3d9_sources, ".", "src")
493 libs += [ "d3d9.lib" ]
494 }
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400495
Jamie Madill562e81b2015-01-14 14:31:02 -0500496 if (angle_enable_d3d11) {
497 sources += rebase_path(gles_gypi.libangle_d3d11_sources, ".", "src")
498 sources += rebase_path(gles_gypi.libangle_d3d11_win32_sources, ".", "src")
Austin Kinross91e71ed2016-08-23 09:29:22 -0700499 libs += [ "dxguid.lib" ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500500 }
501
Geoff Langc588ac72015-02-13 15:41:41 -0500502 if (angle_enable_gl) {
503 sources += rebase_path(gles_gypi.libangle_gl_sources, ".", "src")
504 include_dirs += [ "src/third_party/khronos" ]
505
Jamie Madill6d94f062017-10-21 22:19:40 -0400506 if (angle_enable_gl_null) {
507 sources += rebase_path(gles_gypi.libangle_gl_null_sources, ".", "src")
508 }
Geoff Langc588ac72015-02-13 15:41:41 -0500509 if (is_win) {
510 sources += rebase_path(gles_gypi.libangle_gl_wgl_sources, ".", "src")
511 }
Corentin Wallez51e2ad12015-05-26 11:32:58 -0400512 if (use_x11) {
Corentin Wallez47fc1fe2015-05-14 10:54:18 -0400513 sources += rebase_path(gles_gypi.libangle_gl_glx_sources, ".", "src")
Yuly Novikov87ae8cd2016-05-19 17:59:55 -0400514 deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ]
Corentin Wallezcc068e92016-02-29 16:37:04 -0500515 libs += [
516 "X11",
517 "Xi",
518 "Xext",
519 ]
Corentin Wallez47fc1fe2015-05-14 10:54:18 -0400520 }
Nico Weberde44d3a2016-05-13 17:27:57 -0400521 if (is_mac) {
522 sources += rebase_path(gles_gypi.libangle_gl_cgl_sources, ".", "src")
523 libs += [
524 "Cocoa.framework",
525 "IOSurface.framework",
526 "OpenGL.framework",
527 "QuartzCore.framework",
528 ]
529 }
Yuly Novikova6426d62016-06-03 00:18:38 -0400530 if (is_android) {
531 sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src")
532 sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src")
533 sources +=
534 rebase_path(gles_gypi.libangle_gl_egl_android_sources, ".", "src")
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -0600535 if (ndk_supports_nativewindow) {
536 libs += [ "nativewindow" ]
537 } else {
538 libs += [ "android" ]
539 }
540 libs += [ "log" ]
Yuly Novikova6426d62016-06-03 00:18:38 -0400541 }
Frank Henigmane8d5c5c2016-07-07 13:17:47 -0400542 if (ozone_platform_gbm) {
Frank Henigman77df6762016-06-13 16:39:01 -0400543 configs += [ ":libdrm" ]
544 defines += [ "ANGLE_USE_OZONE" ]
545 deps += [ "//third_party/minigbm" ]
546 sources += rebase_path(gles_gypi.libangle_gl_egl_sources, ".", "src")
547 sources += rebase_path(gles_gypi.libangle_gl_egl_dl_sources, ".", "src")
548 sources += rebase_path(gles_gypi.libangle_gl_ozone_sources, ".", "src")
549 }
Geoff Langc588ac72015-02-13 15:41:41 -0500550 }
551
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400552 if (angle_enable_vulkan) {
553 sources += rebase_path(gles_gypi.libangle_vulkan_sources, ".", "src")
Frank Henigman29f148b2016-11-23 21:05:36 -0500554 if (is_win) {
555 sources +=
556 rebase_path(gles_gypi.libangle_vulkan_win32_sources, ".", "src")
557 }
558 if (is_linux) {
559 sources += rebase_path(gles_gypi.libangle_vulkan_xcb_sources, ".", "src")
560 }
Yuly Novikov199f4292018-01-19 19:04:05 -0500561 if (is_android) {
562 sources +=
563 rebase_path(gles_gypi.libangle_vulkan_android_sources, ".", "src")
564 }
Jamie Madillb62a1c22018-02-06 09:54:02 -0500565 deps += [ ":angle_vulkan" ]
Tobin Ehlisb971f492018-05-24 10:56:17 -0600566 public_deps += [ "$angle_root/third_party/vulkan-headers:vulkan_headers" ]
Jamie Madilld47044a2018-04-27 11:45:03 -0400567
568 # Include generated shaders.
569 import("src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.gni")
570 sources += angle_vulkan_internal_shaders
Jamie Madill9e54b5a2016-05-25 12:57:39 -0400571 }
572
Geoff Langd08f3b32016-09-23 15:56:30 -0400573 if (angle_enable_null) {
574 sources += rebase_path(gles_gypi.libangle_null_sources, ".", "src")
575 }
576
Jamie Madill562e81b2015-01-14 14:31:02 -0500577 if (is_debug) {
Jamie Madilledbc2442016-01-04 11:25:00 -0500578 defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400579 }
580
Jamie Madille2e406c2016-06-02 13:04:10 -0400581 configs -= angle_undefine_configs
Jamie Madilla8503ce2016-07-18 13:47:12 -0400582
Jamie Madill562e81b2015-01-14 14:31:02 -0500583 configs += [
584 ":commit_id_config",
Cooper Partin75da1972015-06-16 15:03:14 -0700585 ":debug_annotations_config",
Jamie Madill509a1d42016-07-18 10:10:29 -0400586 ":extra_warnings",
Jamie Madill562e81b2015-01-14 14:31:02 -0500587 ":internal_config",
Jamie Madill562e81b2015-01-14 14:31:02 -0500588 ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400589
Jamie Madill80ab03c2017-01-03 11:03:23 -0500590 public_configs = [ ":libANGLE_config" ]
591
Jamie Madill562e81b2015-01-14 14:31:02 -0500592 if (is_win) {
Jamie Madille2e406c2016-06-02 13:04:10 -0400593 data_deps = [
594 ":copy_compiler_dll",
595 ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500596 }
597}
598
Robert Sesekdb8ae832016-06-21 11:47:03 -0400599config("shared_library_public_config") {
600 if (is_mac && !is_component_build) {
601 # Executable targets that depend on the shared libraries below need to have
602 # the rpath setup in non-component build configurations.
Jamie Madilla8503ce2016-07-18 13:47:12 -0400603 ldflags = [
604 "-rpath",
605 "@executable_path/",
606 ]
Robert Sesekdb8ae832016-06-21 11:47:03 -0400607 }
608}
609
Jamie Madill80ab03c2017-01-03 11:03:23 -0500610# This config controls export definitions on ANGLE API calls.
611config("angle_static") {
612 defines = [
613 "ANGLE_EXPORT=",
614 "EGLAPI=",
615 "GL_APICALL=",
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500616 "GL_API=",
Jamie Madill80ab03c2017-01-03 11:03:23 -0500617 ]
618}
619
Yuly Novikovad4f9642018-02-08 17:58:46 -0500620shared_library("libGLESv2${angle_libs_suffix}") {
Jamie Madill562e81b2015-01-14 14:31:02 -0500621 sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src")
622
Andrew Grieve949e0702017-01-16 09:44:49 -0500623 if (is_android) {
624 configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
Courtney Goeltzenleuchter46071482018-05-15 13:35:15 -0600625 configs += [ ":build_id_config" ]
Andrew Grieve949e0702017-01-16 09:44:49 -0500626 }
627
Jamie Madill562e81b2015-01-14 14:31:02 -0500628 if (is_win) {
Jamie Madill74a76322018-05-14 09:11:51 -0400629 ldflags = [ "/DEF:" + rebase_path("src/libGLESv2/libGLESv2_autogen.def",
630 root_build_dir) ]
Geoff Lang2b5420c2014-11-19 14:20:15 -0500631 }
John Abd-El-Malek657cd682014-11-05 14:04:19 -0800632
Robert Sesekdb8ae832016-06-21 11:47:03 -0400633 if (is_mac && !is_component_build) {
Jamie Madilla8503ce2016-07-18 13:47:12 -0400634 ldflags = [
635 "-install_name",
636 "@rpath/${target_name}.dylib",
637 ]
Robert Sesekdb8ae832016-06-21 11:47:03 -0400638 public_configs = [ ":shared_library_public_config" ]
639 }
640
Jamie Madille2e406c2016-06-02 13:04:10 -0400641 configs -= angle_undefine_configs
Jamie Madill562e81b2015-01-14 14:31:02 -0500642 configs += [
Jamie Madill562e81b2015-01-14 14:31:02 -0500643 ":commit_id_config",
Cooper Partin75da1972015-06-16 15:03:14 -0700644 ":debug_annotations_config",
Ben Wagnerd736ccc2017-10-11 15:08:22 -0400645 ":extra_warnings",
Jamie Madill80ab03c2017-01-03 11:03:23 -0500646 ":internal_config",
Jamie Madill562e81b2015-01-14 14:31:02 -0500647 ]
Jamie Madill72f5b5e2014-06-23 15:13:02 -0400648
Jamie Madilledbc2442016-01-04 11:25:00 -0500649 defines = [ "LIBGLESV2_IMPLEMENTATION" ]
Jamie Madill80ab03c2017-01-03 11:03:23 -0500650 if (is_win) {
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500651 defines += [
652 "GL_APICALL=",
653 "GL_API=",
654 ]
Jamie Madill80ab03c2017-01-03 11:03:23 -0500655 } else {
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500656 defines += [
657 "GL_APICALL=__attribute__((visibility(\"default\")))",
658 "GL_API=__attribute__((visibility(\"default\")))",
659 ]
Jamie Madill80ab03c2017-01-03 11:03:23 -0500660 }
661
662 deps = [
663 ":includes",
664 ":libANGLE",
665 ]
666}
667
668static_library("libGLESv2_static") {
669 sources = rebase_path(gles_gypi.libglesv2_sources, ".", "src")
670
671 configs -= angle_undefine_configs
672 configs += [
673 ":commit_id_config",
674 ":debug_annotations_config",
Ben Wagnerd736ccc2017-10-11 15:08:22 -0400675 ":extra_warnings",
Jamie Madill80ab03c2017-01-03 11:03:23 -0500676 ":internal_config",
677 ]
678
679 public_configs = [ ":angle_static" ]
Jamie Madill562e81b2015-01-14 14:31:02 -0500680
681 deps = [
682 ":includes",
683 ":libANGLE",
684 ]
685}
686
Yuly Novikovad4f9642018-02-08 17:58:46 -0500687shared_library("libGLESv1_CM${angle_libs_suffix}") {
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500688 sources = rebase_path(gles_gypi.libglesv1_cm_sources, ".", "src")
689
690 if (is_android) {
691 configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
Courtney Goeltzenleuchter46071482018-05-15 13:35:15 -0600692 configs += [ ":build_id_config" ]
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500693 }
Lingfeng Yang4edce332018-02-14 19:01:31 -0800694
695 if (is_mac && !is_component_build) {
696 ldflags = [
697 "-install_name",
698 "@rpath/${target_name}.dylib",
699 ]
700 public_configs = [ ":shared_library_public_config" ]
701 }
702
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500703 configs -= angle_undefine_configs
704 configs += [
705 ":commit_id_config",
706 ":debug_annotations_config",
707 ":extra_warnings",
708 ":internal_config",
709 ]
710
711 defines = []
712 if (is_win) {
713 defines += [
714 "GL_APICALL=",
715 "GL_API=",
716 ]
717 } else {
718 defines += [
719 "GL_APICALL=__attribute__((visibility(\"default\")))",
720 "GL_API=__attribute__((visibility(\"default\")))",
721 ]
722 }
723
724 deps = [
725 ":includes",
Yuly Novikovad4f9642018-02-08 17:58:46 -0500726 ":libGLESv2${angle_libs_suffix}",
Geoff Lang2aaa7b42018-01-12 17:17:27 -0500727 ]
728}
729
730static_library("libGLESv1_CM_static") {
731 sources = rebase_path(gles_gypi.libglesv1_cm_sources, ".", "src")
732
733 configs -= angle_undefine_configs
734 configs += [
735 ":commit_id_config",
736 ":debug_annotations_config",
737 ":extra_warnings",
738 ":internal_config",
739 ]
740
741 public_configs = [ ":angle_static" ]
742
743 deps = [
744 ":includes",
745 ":libGLESv2_static",
746 ]
747}
748
Yuly Novikovad4f9642018-02-08 17:58:46 -0500749shared_library("libEGL${angle_libs_suffix}") {
Jamie Madill562e81b2015-01-14 14:31:02 -0500750 sources = rebase_path(gles_gypi.libegl_sources, ".", "src")
751
Andrew Grieve949e0702017-01-16 09:44:49 -0500752 if (is_android) {
753 configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
Courtney Goeltzenleuchter46071482018-05-15 13:35:15 -0600754 configs += [ ":build_id_config" ]
Andrew Grieve949e0702017-01-16 09:44:49 -0500755 }
Jamie Madille2e406c2016-06-02 13:04:10 -0400756 configs -= angle_undefine_configs
Jamie Madill562e81b2015-01-14 14:31:02 -0500757 configs += [
Jamie Madill562e81b2015-01-14 14:31:02 -0500758 ":commit_id_config",
Corentin Wallezbeb81582015-09-02 10:30:55 -0400759 ":debug_annotations_config",
Jamie Madill509a1d42016-07-18 10:10:29 -0400760 ":extra_warnings",
761 ":internal_config",
Jamie Madill562e81b2015-01-14 14:31:02 -0500762 ]
763
Jamie Madilledbc2442016-01-04 11:25:00 -0500764 defines = [ "LIBEGL_IMPLEMENTATION" ]
Yuly Novikova4ab5802016-12-19 17:44:22 -0500765 if (is_win) {
766 defines += [ "EGLAPI=" ]
767 } else {
768 defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
769 }
Jamie Madill562e81b2015-01-14 14:31:02 -0500770
Jamie Madill80ab03c2017-01-03 11:03:23 -0500771 if (is_win) {
772 ldflags = [ "/DEF:" + rebase_path("src/libEGL/libEGL.def", root_build_dir) ]
773 }
774
775 if (is_mac && !is_component_build) {
776 ldflags = [
777 "-install_name",
778 "@rpath/${target_name}.dylib",
779 ]
780 public_configs = [ ":shared_library_public_config" ]
781 }
782
Jamie Madill562e81b2015-01-14 14:31:02 -0500783 deps = [
784 ":includes",
Yuly Novikovad4f9642018-02-08 17:58:46 -0500785 ":libGLESv2${angle_libs_suffix}",
Jamie Madill562e81b2015-01-14 14:31:02 -0500786 ]
787}
Corentin Wallezbeb81582015-09-02 10:30:55 -0400788
Jamie Madill80ab03c2017-01-03 11:03:23 -0500789static_library("libEGL_static") {
790 sources = rebase_path(gles_gypi.libegl_sources, ".", "src")
791
792 configs -= angle_undefine_configs
793 configs += [
794 ":commit_id_config",
795 ":debug_annotations_config",
796 ":extra_warnings",
797 ":internal_config",
798 ]
799
800 public_configs = [ ":angle_static" ]
801
802 deps = [
803 ":includes",
804 ":libGLESv2_static",
805 ]
806}
807
Jamie Madilledbc2442016-01-04 11:25:00 -0500808util_gypi = exec_script("//build/gypi_to_gn.py",
809 [ rebase_path("util/util.gyp") ],
810 "scope",
811 [ "util/util.gyp" ])
812
813config("angle_util_config") {
814 include_dirs = [ "util" ]
Frank Henigman77df6762016-06-13 16:39:01 -0400815 if (is_linux && use_x11) {
Jamie Madill1fae3552016-01-07 14:33:48 -0500816 libs = [ "X11" ]
817 }
Jamie Madilledbc2442016-01-04 11:25:00 -0500818}
Corentin Wallezbeb81582015-09-02 10:30:55 -0400819
Jamie Madill80ab03c2017-01-03 11:03:23 -0500820foreach(is_shared_library,
821 [
822 true,
823 false,
824 ]) {
825 if (is_shared_library) {
826 library_type = "shared_library"
827 library_name = "angle_util"
Yuly Novikovad4f9642018-02-08 17:58:46 -0500828 dep_suffix = "${angle_libs_suffix}"
Jamie Madill80ab03c2017-01-03 11:03:23 -0500829 } else {
830 library_type = "static_library"
831 library_name = "angle_util_static"
832 dep_suffix = "_static"
Corentin Wallezbeb81582015-09-02 10:30:55 -0400833 }
834
Jamie Madill80ab03c2017-01-03 11:03:23 -0500835 target(library_type, library_name) {
836 sources = rebase_path(util_gypi.util_sources, ".", "util")
837
838 if (is_win) {
839 sources += rebase_path(util_gypi.util_win32_sources, ".", "util")
840 }
841
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -0600842 libs = []
Jamie Madill80ab03c2017-01-03 11:03:23 -0500843 if (is_linux) {
844 sources += rebase_path(util_gypi.util_linux_sources, ".", "util")
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -0600845 libs += [
Jamie Madill80ab03c2017-01-03 11:03:23 -0500846 "rt",
847 "dl",
848 ]
849 }
850
851 if (is_mac) {
852 sources += rebase_path(util_gypi.util_osx_sources, ".", "util")
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -0600853 libs += [
Jamie Madill80ab03c2017-01-03 11:03:23 -0500854 "AppKit.framework",
855 "QuartzCore.framework",
856 ]
857 }
858
859 if (use_x11) {
860 sources += rebase_path(util_gypi.util_x11_sources, ".", "util")
861 }
862
863 if (is_android) {
Andrew Grieve949e0702017-01-16 09:44:49 -0500864 if (is_shared_library) {
865 configs -= [ "//build/config/android:hide_all_but_jni_onload" ]
866 }
Corentin Wallez7b4e00d2017-02-08 10:43:47 -0500867
Jamie Madill80ab03c2017-01-03 11:03:23 -0500868 # To prevent linux sources filtering on android
869 set_sources_assignment_filter([])
870 sources += rebase_path(util_gypi.util_linux_sources, ".", "util")
871 sources += rebase_path(util_gypi.util_android_sources, ".", "util")
Yuly Novikovcd70aa42018-06-20 17:05:32 -0400872 libs += [
873 "android",
874 "log",
875 ]
Jamie Madill80ab03c2017-01-03 11:03:23 -0500876 }
877
878 if (use_ozone) {
879 sources += rebase_path(util_gypi.util_ozone_sources, ".", "util")
880 }
881
882 configs += [
883 ":debug_annotations_config",
884 ":extra_warnings",
Yuly Novikov87ae8cd2016-05-19 17:59:55 -0400885 ]
Corentin Wallezbeb81582015-09-02 10:30:55 -0400886
Jamie Madill80ab03c2017-01-03 11:03:23 -0500887 public_configs = [
888 ":angle_util_config",
889 ":internal_config",
Yuly Novikove3352f92016-08-12 20:40:14 -0400890 ]
Corentin Wallezbeb81582015-09-02 10:30:55 -0400891
Jamie Madill80ab03c2017-01-03 11:03:23 -0500892 deps = [
893 ":angle_common",
894 ":libEGL${dep_suffix}",
895 ":libGLESv2${dep_suffix}",
Yuly Novikova6426d62016-06-03 00:18:38 -0400896 ]
Jamie Madill80ab03c2017-01-03 11:03:23 -0500897
898 if (is_shared_library) {
899 defines = [ "LIBANGLE_UTIL_IMPLEMENTATION" ]
900
901 if (is_mac && !is_component_build) {
902 ldflags = [
903 "-install_name",
904 "@rpath/lib${target_name}.dylib",
905 ]
906 public_configs += [ ":shared_library_public_config" ]
907 }
908 }
Yuly Novikova6426d62016-06-03 00:18:38 -0400909 }
Corentin Wallezbeb81582015-09-02 10:30:55 -0400910}
Ken Russellfcadd082017-06-28 14:01:15 -0700911
912# Convenience targets for some of the samples so they can be built
913# with Chromium's toolchain.
914
915executable("angle_shader_translator") {
916 testonly = true
917
918 sources = [
Yuly Novikovf0be43f2017-06-29 21:25:56 -0400919 "samples/shader_translator/shader_translator.cpp",
Ken Russellfcadd082017-06-28 14:01:15 -0700920 ]
921
922 deps = [
Yuly Novikovf0be43f2017-06-29 21:25:56 -0400923 ":translator",
Ken Russellfcadd082017-06-28 14:01:15 -0700924 ]
925}
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -0600926
927if (is_android) {
928 # Package ANGLE libraries for pre-installed system image
929 android_apk("angle_apk") {
930 if (build_apk_secondary_abi && android_64bit_target_cpu) {
931 secondary_abi_shared_libraries = [
Courtney Goeltzenleuchtere5db6282018-04-26 08:05:18 -0600932 "//third_party/angle:libEGL${angle_libs_suffix}($android_secondary_abi_toolchain)",
Courtney Goeltzenleuchterddd77242018-04-30 10:31:18 -0600933 "//third_party/angle:libGLESv1_CM${angle_libs_suffix}($android_secondary_abi_toolchain)",
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -0600934 "//third_party/angle:libGLESv2${angle_libs_suffix}($android_secondary_abi_toolchain)",
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -0600935 ]
936 }
937
938 android_manifest = "AndroidManifest.xml"
Courtney Goeltzenleuchtere5db6282018-04-26 08:05:18 -0600939
940 # requires_sdk_api_level_23 tells the apk tool that this apk is only
941 # supported on M or later releases (which is true for Vulkan).
942 # Allows tool to optimize for that.
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -0600943 requires_sdk_api_level_23 = true
Courtney Goeltzenleuchter8c1508b2018-07-30 09:46:27 -0600944 apk_name = "ANGLEPrebuilt"
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -0600945 uncompress_shared_libraries = true
946 shared_libraries = [
Courtney Goeltzenleuchtere5db6282018-04-26 08:05:18 -0600947 "//third_party/angle:libEGL${angle_libs_suffix}",
Courtney Goeltzenleuchterddd77242018-04-30 10:31:18 -0600948 "//third_party/angle:libGLESv1_CM${angle_libs_suffix}",
Courtney Goeltzenleuchterb0015282018-05-18 16:48:50 -0600949 "//third_party/angle:libGLESv2${angle_libs_suffix}",
Courtney Goeltzenleuchter2565d482018-04-12 17:06:48 -0600950 ]
951 }
952}