Jamie Madill | 0cb3b0f | 2019-01-28 09:55:20 -0500 | [diff] [blame] | 1 | # Copyright 2019 The ANGLE Project 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 |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 6 | import("gni/angle.gni") |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 7 | if (angle_has_build) { |
| 8 | import("//build/config/linux/pkg_config.gni") |
| 9 | import("//build/config/ui.gni") |
| 10 | import("//testing/libfuzzer/fuzzer_test.gni") |
| 11 | |
| 12 | if (is_android) { |
| 13 | # android/rules.gni can only be imported for Android targets |
| 14 | import("//build/config/android/config.gni") |
| 15 | import("//build/config/android/rules.gni") |
| 16 | import("android/angle_apk.gni") |
| 17 | } |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 18 | } |
Corentin Wallez | 51e2ad1 | 2015-05-26 11:32:58 -0400 | [diff] [blame] | 19 | |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 20 | declare_args() { |
| 21 | # Use the PCI lib to collect GPU information on Linux. |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 22 | use_libpci = |
| 23 | (is_linux || is_chromeos) && (!is_chromecast || is_cast_desktop_build) && |
| 24 | (angle_use_x11 || use_ozone) && angle_has_build |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 25 | |
| 26 | # Link in system libGL, to work with apitrace. See doc/DebuggingTips.md. |
| 27 | angle_link_glx = false |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 28 | |
| 29 | # Defaults to capture building to $root_out_dir/angle_libs/with_capture. |
| 30 | # Switch on to build capture to $root_out_dir. |
| 31 | angle_with_capture_by_default = false |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 32 | |
| 33 | # Don't build extra (test, samples etc) for Windows UWP. We don't have |
| 34 | # infrastructure (e.g. windowing helper functions) in place to run them. |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 35 | angle_build_all = !build_with_chromium && !angle_is_winuwp && angle_has_build |
Geoff Lang | e888356 | 2020-03-06 09:32:18 -0500 | [diff] [blame] | 36 | |
| 37 | # Enable generating current commit information using git |
| 38 | angle_enable_commit_id = true |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 39 | |
| 40 | # Abseil has trouble supporting MSVC, particularly regarding component builds. |
| 41 | # http://crbug.com/1126524 |
| 42 | angle_enable_abseil = angle_has_build && is_clang |
Corentin Wallez | 16d4e47 | 2017-03-20 13:06:19 -0400 | [diff] [blame] | 43 | } |
| 44 | |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 45 | if (angle_build_all) { |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 46 | group("all") { |
| 47 | testonly = true |
| 48 | deps = [ |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 49 | ":angle", |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 50 | ":angle_shader_translator", |
| 51 | ":translator_fuzzer", |
Jamie Madill | 238c19e | 2019-02-07 09:09:41 -0500 | [diff] [blame] | 52 | ":xxhash_fuzzer", |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 53 | "$angle_root/samples:angle_samples", |
| 54 | "$angle_root/src/tests:angle_tests", |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 55 | ] |
| 56 | } |
| 57 | } |
| 58 | |
Tim Van Patten | c4e0a1e | 2018-11-28 16:08:11 +0000 | [diff] [blame] | 59 | import("src/compiler.gni") |
Tim Van Patten | fdccaa3 | 2018-11-01 17:47:10 -0600 | [diff] [blame] | 60 | import("src/libGLESv2.gni") |
Brett Wilson | 04bac60 | 2014-07-16 14:19:18 -0700 | [diff] [blame] | 61 | |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 62 | # This config is exported to dependent targets (and also applied to internal |
| 63 | # ones). |
| 64 | config("external_config") { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 65 | include_dirs = [ "include" ] |
Brett Wilson | 2f5469c | 2014-07-22 17:00:17 -0700 | [diff] [blame] | 66 | } |
| 67 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 68 | # Prevent the GL headers from redeclaring ANGLE entry points. |
| 69 | config("no_gl_prototypes") { |
| 70 | defines = [ |
| 71 | "GL_GLES_PROTOTYPES=0", |
| 72 | "EGL_EGL_PROTOTYPES=0", |
| 73 | ] |
| 74 | } |
| 75 | |
| 76 | config("gl_prototypes") { |
| 77 | defines = [ |
| 78 | "GL_GLES_PROTOTYPES=1", |
| 79 | "EGL_EGL_PROTOTYPES=1", |
| 80 | "GL_GLEXT_PROTOTYPES", |
| 81 | "EGL_EGLEXT_PROTOTYPES", |
| 82 | ] |
| 83 | } |
| 84 | |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 85 | # This config is applied to internal Angle targets (not pushed to dependents). |
| 86 | config("internal_config") { |
| 87 | include_dirs = [ |
| 88 | "include", |
| 89 | "src", |
| 90 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 91 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 92 | defines = [] |
Jamie Madill | 6de5185 | 2017-04-12 09:53:01 -0400 | [diff] [blame] | 93 | |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 94 | if (angle_64bit_current_cpu) { |
Yuly Novikov | c4f1dd8 | 2017-10-25 17:02:29 -0400 | [diff] [blame] | 95 | defines += [ "ANGLE_IS_64_BIT_CPU" ] |
Courtney Goeltzenleuchter | b001528 | 2018-05-18 16:48:50 -0600 | [diff] [blame] | 96 | } else { |
| 97 | defines += [ "ANGLE_IS_32_BIT_CPU" ] |
Jamie Madill | 6de5185 | 2017-04-12 09:53:01 -0400 | [diff] [blame] | 98 | } |
Geoff Lang | b02fc66 | 2018-08-21 09:48:01 -0400 | [diff] [blame] | 99 | |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 100 | if (is_win) { |
| 101 | defines += [ "ANGLE_IS_WIN" ] |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 102 | } else if (is_linux || is_chromeos) { |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 103 | defines += [ "ANGLE_IS_LINUX" ] |
| 104 | } |
| 105 | |
Tobin Ehlis | 573f76b | 2018-05-03 11:10:44 -0600 | [diff] [blame] | 106 | if (angle_enable_trace) { |
| 107 | defines += [ "ANGLE_ENABLE_DEBUG_TRACE=1" ] |
| 108 | } |
Tobin Ehlis | 93121f3 | 2019-10-17 08:18:16 -0600 | [diff] [blame] | 109 | |
| 110 | if (is_chromeos) { |
| 111 | defines += [ "ANGLE_PLATFORM_CHROMEOS" ] |
| 112 | } |
Ethan Lee | fcef6dc | 2020-01-24 22:41:35 -0500 | [diff] [blame] | 113 | |
| 114 | if (is_ggp) { |
| 115 | defines += [ "__ggp__" ] |
| 116 | } |
Xiaoxuan Liu | 61180d0 | 2020-10-12 16:40:13 +0800 | [diff] [blame^] | 117 | |
| 118 | if (angle_use_vulkan_display) { |
| 119 | defines += [ "ANGLE_USE_VULKAN_DISPLAY" ] |
| 120 | if (angle_vulkan_display_mode == "simple") { |
| 121 | defines += [ "ANGLE_VULKAN_DISPLAY_MODE_SIMPLE" ] |
| 122 | } else if (angle_vulkan_display_mode == "headless") { |
| 123 | defines += [ "ANGLE_VULKAN_DISPLAY_MODE_HEADLESS" ] |
| 124 | } |
| 125 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 126 | } |
| 127 | |
Jamie Madill | a9f11bf | 2019-10-21 08:39:14 -0400 | [diff] [blame] | 128 | config("constructor_and_destructor_warnings") { |
| 129 | if (is_clang) { |
| 130 | cflags = [ |
| 131 | "-Wexit-time-destructors", |
| 132 | "-Wglobal-constructors", |
| 133 | ] |
| 134 | } |
| 135 | } |
| 136 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 137 | config("extra_warnings") { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 138 | cflags = [] |
Frank Henigman | d0ef13a | 2017-08-28 22:53:24 -0400 | [diff] [blame] | 139 | |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 140 | # Enable more default warnings on Windows. |
| 141 | if (is_win) { |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 142 | cflags += [ |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 143 | "/we4244", # Conversion: possible loss of data. |
Jamie Madill | 330c867 | 2020-08-28 17:44:13 -0400 | [diff] [blame] | 144 | "/we4312", # Conversion: greater size. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 145 | "/we4456", # Variable shadowing. |
Jamie Madill | 1db8a26 | 2016-09-22 13:53:47 -0400 | [diff] [blame] | 146 | "/we4458", # declaration hides class member. |
Ben Wagner | 1e06401 | 2019-04-12 14:10:17 -0400 | [diff] [blame] | 147 | "/we4715", # not all control paths return a value |
Geoff Lang | b944053 | 2017-11-28 13:26:34 -0500 | [diff] [blame] | 148 | "/we4800", # forcing value to bool. |
| 149 | "/we4838", # narrowing conversion. |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 150 | ] |
| 151 | } |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 152 | if (is_clang) { |
Michael Spang | 229fc83 | 2019-01-21 18:09:15 -0500 | [diff] [blame] | 153 | cflags += [ |
Jamie Madill | c7217aa | 2020-08-28 14:45:14 -0400 | [diff] [blame] | 154 | "-Wbad-function-cast", |
Jamie Madill | 155947f | 2019-10-24 12:55:11 -0400 | [diff] [blame] | 155 | "-Wconditional-uninitialized", |
Jamie Madill | b4efc05 | 2020-08-28 14:45:18 -0400 | [diff] [blame] | 156 | "-Wdeprecated-copy", |
Jamie Madill | 44a0e73 | 2019-09-02 13:55:59 -0400 | [diff] [blame] | 157 | "-Wextra-semi-stmt", |
Jiacheng Lu | 73e5e9b | 2019-07-22 15:26:17 -0600 | [diff] [blame] | 158 | "-Wfloat-conversion", |
Jamie Madill | 16370a6 | 2019-10-24 12:55:11 -0400 | [diff] [blame] | 159 | "-Winconsistent-missing-destructor-override", |
Jamie Madill | a620685 | 2019-10-24 12:55:09 -0400 | [diff] [blame] | 160 | "-Wmissing-field-initializers", |
Stuart Morgan | 5dba723 | 2020-06-16 09:29:16 -0700 | [diff] [blame] | 161 | "-Wnewline-eof", |
Olli Etuaho | 8073a95 | 2018-05-09 16:41:39 +0300 | [diff] [blame] | 162 | "-Wnon-virtual-dtor", |
Jamie Madill | 68945f1 | 2019-10-24 12:55:09 -0400 | [diff] [blame] | 163 | "-Wredundant-parens", |
Jamie Madill | 1ab8b75 | 2020-08-28 14:45:15 -0400 | [diff] [blame] | 164 | "-Wreturn-std-move-in-c++11", |
Jamie Madill | 859ca03 | 2019-10-24 12:55:08 -0400 | [diff] [blame] | 165 | "-Wshadow-field", |
Jamie Madill | 5c56f22 | 2020-08-28 14:45:14 -0400 | [diff] [blame] | 166 | "-Wsuggest-destructor-override", |
| 167 | "-Wsuggest-override", |
Jamie Madill | fd58d22 | 2019-10-24 12:55:07 -0400 | [diff] [blame] | 168 | "-Wtautological-type-limit-compare", |
Jamie Madill | c017cee | 2019-10-24 12:55:10 -0400 | [diff] [blame] | 169 | "-Wundefined-reinterpret-cast", |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 170 | "-Wunneeded-internal-declaration", |
Jamie Madill | 3486ec9 | 2020-09-10 17:55:28 -0400 | [diff] [blame] | 171 | "-Wweak-template-vtables", |
James Darpinian | efa898a | 2019-08-07 17:05:35 -0700 | [diff] [blame] | 172 | |
| 173 | # The below warnings are used by WebKit. We enable them to make rolling |
| 174 | # ANGLE in WebKit easier. |
| 175 | "-Wparentheses", |
| 176 | "-Wrange-loop-analysis", |
| 177 | "-Wstrict-prototypes", |
| 178 | "-Wunreachable-code", |
James Darpinian | 7e48c9e | 2019-08-06 17:17:19 -0700 | [diff] [blame] | 179 | "-Wshorten-64-to-32", |
Nico Weber | 79de62c | 2018-01-31 10:47:14 -0500 | [diff] [blame] | 180 | ] |
Ben Wagner | 211bff3 | 2017-10-10 23:53:20 -0400 | [diff] [blame] | 181 | } |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 182 | |
| 183 | if (angle_is_winuwp) { |
| 184 | cflags += [ "/wd4447" ] # 'main' signature found without threading model. |
| 185 | } |
Jamie Madill | 509a1d4 | 2016-07-18 10:10:29 -0400 | [diff] [blame] | 186 | } |
| 187 | |
Courtney Goeltzenleuchter | 4607148 | 2018-05-15 13:35:15 -0600 | [diff] [blame] | 188 | # This config adds build-ids to the associated library. |
| 189 | # -Wl is a special option that indicates that clang should pass the associated |
| 190 | # option --build-id to the linker. This will cause a build-id section to be added |
| 191 | # to the associated library. The build-id makes it possible for a debugger to |
| 192 | # find the right symbol file to use. |
| 193 | config("build_id_config") { |
| 194 | ldflags = [ "-Wl,--build-id" ] |
| 195 | } |
| 196 | |
Jamie Madill | 20d380f | 2019-06-03 15:21:47 -0400 | [diff] [blame] | 197 | # Useful for more informative stack traces. |
| 198 | config("better_linux_stack_traces") { |
| 199 | if (angle_better_stack_traces) { |
| 200 | ldflags = [ "-Wl,--export-dynamic" ] |
| 201 | } |
| 202 | } |
| 203 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 204 | _use_copy_compiler_dll = angle_has_build && is_win && target_cpu != "arm64" |
| 205 | |
Tom Tan | 5c31753 | 2018-11-30 17:01:01 -0800 | [diff] [blame] | 206 | # Windows ARM64 is available since 10.0.16299 so no need to copy |
| 207 | # d3dcompiler_47.dll because this file is available as inbox. |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 208 | if (_use_copy_compiler_dll) { |
Jamie Madill | d09546e | 2019-02-22 10:24:44 -0500 | [diff] [blame] | 209 | # We also ship an older DLL for compatiblity with Windows 7 machines without |
| 210 | # the UCRT. This DLL isn't available in the standard SDK distribution. |
| 211 | _old_compiler = "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_old.dll" |
| 212 | _has_old_compiler = |
| 213 | exec_script("scripts/file_exists.py", [ _old_compiler ], "value") |
| 214 | |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 215 | copy("copy_compiler_dll") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 216 | sources = [ "$windows_sdk_path/Redist/D3D/$target_cpu/d3dcompiler_47.dll" ] |
Jamie Madill | d09546e | 2019-02-22 10:24:44 -0500 | [diff] [blame] | 217 | |
| 218 | if (_has_old_compiler) { |
| 219 | sources += [ _old_compiler ] |
| 220 | } |
| 221 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 222 | outputs = [ "$root_out_dir/{{source_file_part}}" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 223 | } |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 224 | } |
| 225 | |
Jamie Madill | 55959b0 | 2019-03-05 10:07:41 -0500 | [diff] [blame] | 226 | # Holds the shared includes so we only need to list them once. |
Jamie Madill | cd4f1fb | 2019-02-07 15:26:10 -0500 | [diff] [blame] | 227 | config("includes_config") { |
| 228 | include_dirs = [ "include" ] |
| 229 | } |
| 230 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 231 | angle_source_set("includes") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 232 | sources = libangle_includes |
Jamie Madill | 8d412db | 2020-08-29 22:25:18 +0000 | [diff] [blame] | 233 | public_configs = [ ":includes_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 234 | } |
| 235 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 236 | angle_static_library("preprocessor") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 237 | sources = angle_preprocessor_sources |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 238 | |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 239 | public_deps = [ |
| 240 | ":angle_common", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 241 | ":angle_translator_headers", |
Corentin Wallez | 054f7ed | 2016-09-20 17:15:59 -0400 | [diff] [blame] | 242 | ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 243 | } |
| 244 | |
Tobin Ehlis | 5546fb4 | 2019-01-17 12:25:54 -0500 | [diff] [blame] | 245 | config("angle_disable_pool_alloc") { |
| 246 | defines = [ "ANGLE_DISABLE_POOL_ALLOC" ] |
Jamie Madill | e5c97ab | 2014-08-07 12:31:38 -0400 | [diff] [blame] | 247 | } |
| 248 | |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 249 | config("debug_annotations_config") { |
Corentin Wallez | 105bc9d | 2019-03-06 16:32:40 +0000 | [diff] [blame] | 250 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 251 | defines = [ "ANGLE_ENABLE_DEBUG_ANNOTATIONS" ] |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 252 | } |
| 253 | } |
| 254 | |
Jamie Madill | e31fd87 | 2016-05-27 08:35:36 -0400 | [diff] [blame] | 255 | config("angle_release_asserts_config") { |
| 256 | if (dcheck_always_on) { |
| 257 | defines = [ "ANGLE_ENABLE_RELEASE_ASSERTS" ] |
| 258 | } |
| 259 | } |
| 260 | |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 261 | config("angle_common_config") { |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 262 | include_dirs = [ "src/common/third_party/base" ] |
Yuly Novikov | e762400 | 2018-01-27 18:27:07 -0500 | [diff] [blame] | 263 | if (is_android) { |
| 264 | libs = [ "log" ] |
| 265 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 266 | } |
| 267 | |
Alexis Hetu | a20f5b1 | 2020-08-18 11:26:50 -0400 | [diff] [blame] | 268 | # Silences the "indirect call of a function with wrong dynamic type" cfi error |
| 269 | config("angle_no_cfi_icall") { |
| 270 | if (is_cfi && use_cfi_icall && current_toolchain == default_toolchain) { |
| 271 | cflags = [ "-fno-sanitize=cfi-icall" ] |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | # Silences the "cast from void* or another unrelated type to the wrong dynamic type" cfi error |
| 276 | config("angle_no_cfi_unrelated_cast") { |
| 277 | if (is_cfi && use_cfi_cast && current_toolchain == default_toolchain) { |
| 278 | cflags = [ "-fno-sanitize=cfi-unrelated-cast" ] |
| 279 | } |
| 280 | } |
| 281 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 282 | angle_source_set("angle_system_utils") { |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 283 | sources = angle_system_utils_sources |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 284 | if (is_linux || is_chromeos) { |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 285 | libs = [ "dl" ] |
| 286 | } |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 287 | } |
| 288 | |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 289 | angle_source_set("xxhash") { |
| 290 | sources = xxhash_sources |
Jamie Madill | 5fde632 | 2020-08-28 14:45:17 -0400 | [diff] [blame] | 291 | if (is_clang) { |
| 292 | cflags_c = [ "-Wno-implicit-fallthrough" ] |
| 293 | } |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 294 | } |
| 295 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 296 | if (angle_has_build) { |
| 297 | fuzzer_test("xxhash_fuzzer") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 298 | sources = [ "src/common/third_party/xxhash/xxhash_fuzzer.cpp" ] |
| 299 | deps = [ ":xxhash" ] |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 300 | } |
Jamie Madill | 238c19e | 2019-02-07 09:09:41 -0500 | [diff] [blame] | 301 | } |
| 302 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 303 | angle_static_library("angle_common") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 304 | sources = libangle_common_sources |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 305 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 306 | configs += [ |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 307 | ":angle_common_config", |
Cooper Partin | 75da197 | 2015-06-16 15:03:14 -0700 | [diff] [blame] | 308 | ":debug_annotations_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 309 | ] |
Jeremy Roman | 06feb81 | 2016-04-06 16:39:52 -0400 | [diff] [blame] | 310 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 311 | deps = [ ":xxhash" ] |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame] | 312 | |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 313 | public_deps = [ |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 314 | ":angle_abseil", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 315 | ":angle_system_utils", |
| 316 | ":angle_version", |
Jamie Madill | 8d986bf | 2018-02-21 08:28:01 -0500 | [diff] [blame] | 317 | ":includes", |
Yuly Novikov | 87ae8cd | 2016-05-19 17:59:55 -0400 | [diff] [blame] | 318 | ] |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 319 | public_configs += [ ":angle_common_config" ] |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 320 | if (angle_has_build && use_fuzzing_engine) { |
Jamie Madill | 48aa52f | 2019-10-17 07:56:53 -0400 | [diff] [blame] | 321 | all_dependent_configs = [ ":angle_disable_pool_alloc" ] |
Tobin Ehlis | 5546fb4 | 2019-01-17 12:25:54 -0500 | [diff] [blame] | 322 | } |
Tim Van Patten | e99b8bc | 2020-10-23 18:50:33 -0600 | [diff] [blame] | 323 | |
| 324 | if (is_android && (angle_enable_gl || angle_enable_vulkan)) { |
| 325 | # In API level 26 ANativeWindow APIs were moved from libandroid.so |
| 326 | # into a separate library, libnativewindow.so |
| 327 | if (ndk_api_level_at_least_26) { |
| 328 | libs = [ "nativewindow" ] |
| 329 | } else { |
| 330 | libs = [ "android" ] |
| 331 | } |
| 332 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 333 | } |
| 334 | |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 335 | config("angle_image_util_config") { |
| 336 | include_dirs = [ |
| 337 | "include", |
| 338 | "src", |
| 339 | ] |
| 340 | } |
| 341 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 342 | angle_source_set("angle_image_util_headers") { |
| 343 | sources = libangle_image_util_headers |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 344 | public_deps = [ ":angle_common" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 345 | } |
| 346 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 347 | angle_static_library("angle_image_util") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 348 | sources = libangle_image_util_sources |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 349 | public_configs += [ ":angle_image_util_config" ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 350 | public_deps = [ ":angle_image_util_headers" ] |
Geoff Lang | 6e4cfce | 2016-06-13 15:06:31 -0400 | [diff] [blame] | 351 | } |
| 352 | |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 353 | config("angle_gl_visibility_config") { |
| 354 | if (is_win) { |
| 355 | defines = [ |
| 356 | "GL_APICALL=", |
| 357 | "GL_API=", |
| 358 | ] |
| 359 | } else { |
| 360 | defines = [ |
| 361 | "GL_APICALL=__attribute__((visibility(\"default\")))", |
| 362 | "GL_API=__attribute__((visibility(\"default\")))", |
| 363 | ] |
Courtney Goeltzenleuchter | e7ece9e | 2018-10-08 16:43:43 -0600 | [diff] [blame] | 364 | } |
Ian Elliott | abcb2b3 | 2018-08-29 17:04:15 -0600 | [diff] [blame] | 365 | } |
| 366 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 367 | config("angle_gpu_info_util_config") { |
| 368 | include_dirs = [ |
| 369 | "include", |
| 370 | "src", |
| 371 | ] |
| 372 | } |
| 373 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 374 | angle_static_library("angle_gpu_info_util") { |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 375 | public_configs += [ |
| 376 | ":angle_gpu_info_util_config", |
| 377 | ":angle_backend_config", |
| 378 | ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 379 | public_deps = [ ":angle_common" ] |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 380 | sources = libangle_gpu_info_util_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 381 | deps = [] |
| 382 | libs = [] |
| 383 | defines = [] |
| 384 | |
Jamie Madill | b09f16e | 2020-10-01 10:02:07 -0400 | [diff] [blame] | 385 | if (!is_chromeos && angle_has_build) { |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 386 | sources += libangle_gpu_info_util_vulkan_sources |
Geoff Lang | dd90f5a | 2020-04-07 12:59:23 -0400 | [diff] [blame] | 387 | deps += [ "$angle_root/third_party/vulkan-headers/src:vulkan_headers" ] |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 388 | } |
| 389 | |
Ian Elliott | d07c52e | 2018-06-22 15:42:09 -0600 | [diff] [blame] | 390 | if (is_android) { |
Michael Spang | b630bf9 | 2020-01-24 17:27:01 -0500 | [diff] [blame] | 391 | sources += libangle_gpu_info_util_android_sources |
| 392 | } |
| 393 | |
| 394 | if (is_fuchsia) { |
| 395 | sources += libangle_gpu_info_util_fuchsia_sources |
Antonio Maiorano | 13816d2 | 2020-06-16 14:27:04 -0400 | [diff] [blame] | 396 | deps += [ "$angle_root/src/common/vulkan:angle_vulkan_entry_points" ] |
Ian Elliott | d07c52e | 2018-06-22 15:42:09 -0600 | [diff] [blame] | 397 | } |
| 398 | |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 399 | if (is_win) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 400 | sources += libangle_gpu_info_util_win_sources |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 401 | if (!angle_is_winuwp) { |
| 402 | libs += [ "setupapi.lib" ] |
| 403 | } |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 404 | libs += [ "dxgi.lib" ] |
Corentin Wallez | 8f77e5d | 2017-03-24 11:58:59 -0700 | [diff] [blame] | 405 | } |
| 406 | |
Hidehiko Abe | 90a9cf9 | 2020-09-11 02:40:34 +0900 | [diff] [blame] | 407 | if (is_linux || is_chromeos) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 408 | sources += libangle_gpu_info_util_linux_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 409 | |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 410 | if (angle_use_x11 && angle_has_build) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 411 | sources += libangle_gpu_info_util_x11_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 412 | deps += [ "src/third_party/libXNVCtrl:libXNVCtrl" ] |
| 413 | defines += [ "GPU_INFO_USE_X11" ] |
| 414 | libs += [ |
| 415 | "X11", |
| 416 | "Xi", |
| 417 | "Xext", |
| 418 | ] |
| 419 | } |
| 420 | } |
| 421 | |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 422 | if (use_libpci) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 423 | sources += libangle_gpu_info_util_libpci_sources |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 424 | defines += [ "GPU_INFO_USE_LIBPCI" ] |
| 425 | libs += [ "pci" ] |
| 426 | } |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 427 | |
| 428 | if (is_mac) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 429 | sources += libangle_gpu_info_util_mac_sources |
Sylvain Defresne | bae95f8 | 2020-07-02 17:19:14 +0200 | [diff] [blame] | 430 | frameworks = [ |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 431 | "IOKit.framework", |
| 432 | "CoreFoundation.framework", |
Corentin Wallez | 163965d | 2017-10-11 11:38:55 -0400 | [diff] [blame] | 433 | "CoreGraphics.framework", |
Daksh Idnani | 5ec0488 | 2019-08-22 21:12:08 +0000 | [diff] [blame] | 434 | "OpenGL.framework", |
Corentin Wallez | d83f64f | 2017-02-16 10:58:46 -0500 | [diff] [blame] | 435 | ] |
| 436 | } |
Corentin Wallez | 7b4e00d | 2017-02-08 10:43:47 -0500 | [diff] [blame] | 437 | } |
| 438 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 439 | angle_source_set("angle_translator_headers") { |
| 440 | sources = angle_translator_exported_headers |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 441 | public_deps = [ ":includes" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 442 | } |
| 443 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 444 | angle_static_library("translator") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 445 | sources = angle_translator_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 446 | defines = [] |
| 447 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 448 | if (angle_enable_essl || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 449 | sources += angle_translator_essl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 450 | defines += [ "ANGLE_ENABLE_ESSL" ] |
| 451 | } |
| 452 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 453 | if (angle_enable_glsl || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 454 | sources += angle_translator_glsl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 455 | defines += [ "ANGLE_ENABLE_GLSL" ] |
| 456 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 457 | |
Jonathan Metzman | fb9051a | 2017-10-09 16:14:06 -0700 | [diff] [blame] | 458 | if (angle_enable_hlsl || use_fuzzing_engine) { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 459 | sources += angle_translator_hlsl_sources |
Austin Kinross | 82b5ab6 | 2015-12-11 09:30:15 -0800 | [diff] [blame] | 460 | defines += [ "ANGLE_ENABLE_HLSL" ] |
Daniel Bratell | 73941de | 2015-02-25 14:34:49 +0100 | [diff] [blame] | 461 | } |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 462 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 463 | if (angle_enable_vulkan || use_fuzzing_engine || angle_enable_metal) { |
| 464 | # This translator is needed by metal backend also. |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 465 | sources += angle_translator_lib_vulkan_sources |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 466 | } |
| 467 | |
| 468 | if (angle_enable_vulkan || use_fuzzing_engine) { |
Jamie Madill | e794cd8 | 2017-01-13 17:29:51 -0500 | [diff] [blame] | 469 | defines += [ "ANGLE_ENABLE_VULKAN" ] |
| 470 | } |
| 471 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 472 | if (angle_enable_metal) { |
| 473 | sources += angle_translator_lib_metal_sources |
| 474 | defines += [ "ANGLE_ENABLE_METAL" ] |
| 475 | } |
| 476 | |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 477 | if (angle_enable_swiftshader) { |
| 478 | defines += [ "ANGLE_ENABLE_SWIFTSHADER" ] |
| 479 | } |
| 480 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 481 | public_configs += [ ":external_config" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 482 | |
| 483 | deps = [ |
| 484 | ":includes", |
| 485 | ":preprocessor", |
| 486 | ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 487 | |
| 488 | public_deps = [ |
| 489 | ":angle_common", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 490 | ":angle_translator_headers", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 491 | ] |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 492 | |
| 493 | if (is_win) { |
| 494 | # Necessary to suppress some system header xtree warnigns in Release. |
| 495 | # For some reason this warning doesn't get triggered in Chromium |
| 496 | cflags = [ "/wd4718" ] |
| 497 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 498 | } |
| 499 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 500 | angle_source_set("translator_fuzzer") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 501 | sources = [ "src/compiler/fuzz/translator_fuzzer.cpp" ] |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 502 | |
| 503 | include_dirs = [ |
| 504 | "include", |
| 505 | "src", |
| 506 | ] |
| 507 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 508 | deps = [ ":translator" ] |
Corentin Wallez | 28b6528 | 2016-06-16 07:24:50 -0700 | [diff] [blame] | 509 | } |
| 510 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 511 | config("angle_commit_id_config") { |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 512 | include_dirs = [ "$root_gen_dir/angle" ] |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 513 | visibility = [ ":angle_commit_id" ] |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 514 | } |
| 515 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 516 | _commit_id_output_file = "$root_gen_dir/angle/angle_commit.h" |
| 517 | action("angle_commit_id") { |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 518 | script = "src/commit_id.py" |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 519 | outputs = [ _commit_id_output_file ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 520 | |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 521 | # Add git as a dependency if it is available. |
Geoff Lang | 20c6973 | 2020-03-06 11:02:31 -0500 | [diff] [blame] | 522 | if (angle_enable_commit_id && |
| 523 | exec_script("src/commit_id.py", [ "check" ], "value") == 1) { |
Geoff Lang | dd19d55 | 2020-03-02 09:41:22 -0500 | [diff] [blame] | 524 | # commit id should depend on angle's HEAD revision |
| 525 | inputs = [ ".git/HEAD" ] |
Jamie Madill | 5f2ba63 | 2020-08-15 23:50:59 -0400 | [diff] [blame] | 526 | branch = read_file(".git/HEAD", "string") |
| 527 | result = string_split(branch) |
| 528 | if (result[0] == "ref:") { |
| 529 | inputs += [ ".git/" + result[1] ] |
| 530 | } |
Tomasz Moniuszko | 319fb898 | 2015-07-30 14:34:54 +0200 | [diff] [blame] | 531 | } |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 532 | |
| 533 | args = [ |
| 534 | "gen", |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 535 | rebase_path(_commit_id_output_file, root_build_dir), |
Geoff Lang | ba8ef68 | 2020-02-24 14:13:40 -0500 | [diff] [blame] | 536 | ] |
| 537 | |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 538 | public_configs = [ ":angle_commit_id_config" ] |
| 539 | } |
| 540 | |
| 541 | # TODO(jmadill): Remove this. http://b/168736059 |
| 542 | group("commit_id") { |
| 543 | data_deps = [ ":angle_commit_id" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 544 | } |
| 545 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 546 | angle_source_set("angle_version") { |
Jamie Madill | 62778cb | 2020-09-22 23:10:04 -0400 | [diff] [blame] | 547 | # TODO(jmadill): Remove version.h. http://b/168736059 |
| 548 | sources = [ |
| 549 | "src/common/angle_version.h", |
| 550 | "src/common/version.h", |
| 551 | ] |
| 552 | public_deps = [ ":angle_commit_id" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 553 | } |
| 554 | |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 555 | config("angle_backend_config") { |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 556 | defines = [] |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 557 | |
Etienne Bergeron | 9e83c15 | 2020-06-04 19:53:36 -0400 | [diff] [blame] | 558 | if (angle_delegate_workers) { |
| 559 | defines += [ "ANGLE_DELEGATE_WORKERS" ] |
| 560 | } |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 561 | |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 562 | configs = [] |
| 563 | |
Jamie Madill | bb96aef | 2020-09-11 13:50:09 -0400 | [diff] [blame] | 564 | if (angle_enable_d3d11) { |
| 565 | configs += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend_config" ] |
| 566 | } |
| 567 | |
| 568 | if (angle_enable_d3d9) { |
| 569 | configs += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend_config" ] |
| 570 | } |
| 571 | |
Jamie Madill | 2d74170 | 2020-09-11 12:30:04 -0400 | [diff] [blame] | 572 | if (angle_enable_gl) { |
| 573 | configs += [ "src/libANGLE/renderer/gl:angle_gl_backend_config" ] |
| 574 | } |
| 575 | |
Jamie Madill | 852f61f | 2020-09-11 11:54:35 -0400 | [diff] [blame] | 576 | if (angle_enable_null) { |
| 577 | configs += [ "src/libANGLE/renderer/null:angle_null_backend_config" ] |
| 578 | } |
| 579 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 580 | if (angle_enable_metal) { |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 581 | configs += [ "src/libANGLE/renderer/metal:angle_metal_backend_config" ] |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 582 | } |
| 583 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 584 | if (angle_enable_vulkan) { |
Jonah Ryan-Davis | 5afd5ec | 2019-10-25 10:53:40 -0600 | [diff] [blame] | 585 | configs += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend_config" ] |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 586 | } |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | config("libANGLE_config") { |
| 590 | cflags = [] |
| 591 | defines = [] |
| 592 | libs = [] |
| 593 | ldflags = [] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 594 | defines += [ "LIBANGLE_IMPLEMENTATION" ] |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 595 | |
| 596 | if (is_win) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 597 | cflags += [ "/wd4530" ] # C++ exception handler used, but unwind semantics |
| 598 | # are not enabled. |
Austin Kinross | 4085347 | 2015-02-12 10:39:56 -0800 | [diff] [blame] | 599 | } |
Yuly Novikov | b29fccf | 2018-11-28 10:09:39 -0500 | [diff] [blame] | 600 | |
| 601 | if (is_android && (angle_enable_gl || angle_enable_vulkan)) { |
Yuly Novikov | 8edc68e | 2019-02-12 12:41:01 -0500 | [diff] [blame] | 602 | # In API level 26 ANativeWindow APIs were moved from libandroid.so |
| 603 | # into a separate library, libnativewindow.so |
| 604 | if (ndk_api_level_at_least_26) { |
Yuly Novikov | b29fccf | 2018-11-28 10:09:39 -0500 | [diff] [blame] | 605 | libs += [ "nativewindow" ] |
| 606 | } else { |
| 607 | libs += [ "android" ] |
| 608 | } |
| 609 | } |
Michael Spang | 7cd5f64 | 2019-08-21 20:03:49 -0400 | [diff] [blame] | 610 | |
Ethan Lee | d22b8be | 2019-11-15 12:26:39 -0500 | [diff] [blame] | 611 | if (angle_use_x11) { |
Michael Spang | 7cd5f64 | 2019-08-21 20:03:49 -0400 | [diff] [blame] | 612 | defines += [ "ANGLE_USE_X11" ] |
| 613 | } |
Jamie Madill | af5e382 | 2020-01-28 10:05:36 -0500 | [diff] [blame] | 614 | |
| 615 | if (angle_enable_overlay) { |
| 616 | defines += [ "ANGLE_ENABLE_OVERLAY=1" ] |
| 617 | } |
Tim Van Patten | ee4e086 | 2020-09-24 11:39:49 -0600 | [diff] [blame] | 618 | if (angle_enable_perf_counter_output) { |
| 619 | defines += [ "ANGLE_ENABLE_PERF_COUNTER_OUTPUT=1" ] |
| 620 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 621 | } |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 622 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 623 | angle_source_set("libANGLE_headers") { |
| 624 | sources = libangle_headers |
| 625 | public_deps = [ |
| 626 | ":angle_common", |
| 627 | ":angle_translator_headers", |
| 628 | ] |
Jamie Madill | af5e382 | 2020-01-28 10:05:36 -0500 | [diff] [blame] | 629 | public_configs += [ ":libANGLE_config" ] |
Jamie Madill | b62a1c2 | 2018-02-06 09:54:02 -0500 | [diff] [blame] | 630 | } |
| 631 | |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 632 | # Don't even try to build glslang if Metal and Vulkan are disabled. |
| 633 | if (angle_enable_vulkan || angle_enable_metal) { |
| 634 | angle_source_set("angle_glslang_wrapper") { |
| 635 | sources = [ |
| 636 | "src/libANGLE/renderer/glslang_wrapper_utils.cpp", |
| 637 | "src/libANGLE/renderer/glslang_wrapper_utils.h", |
| 638 | ] |
| 639 | deps = [ |
| 640 | ":libANGLE_headers", |
| 641 | "${angle_glslang_dir}:glslang_default_resource_limits_sources", |
Shahbaz Youssefi | b291ad0 | 2020-07-03 23:53:10 -0400 | [diff] [blame] | 642 | "${angle_glslang_dir}:glslang_lib_sources", |
Shahbaz Youssefi | 71e6afb | 2020-01-14 14:12:31 -0500 | [diff] [blame] | 643 | "${angle_spirv_headers_dir}:spv_headers", |
| 644 | "${angle_spirv_tools_dir}:spvtools_headers", |
Jamie Madill | 2f71802 | 2019-10-28 11:48:46 -0400 | [diff] [blame] | 645 | ] |
| 646 | } |
Le Quyen | a48f95a | 2019-10-14 14:49:49 +0800 | [diff] [blame] | 647 | } |
| 648 | |
Jamie Madill | 4d3a0f6 | 2020-09-11 12:36:05 -0400 | [diff] [blame] | 649 | if (is_win) { |
| 650 | angle_source_set("angle_d3d_format_tables") { |
| 651 | sources = [ |
| 652 | "src/libANGLE/renderer/dxgi_format_map.h", |
| 653 | "src/libANGLE/renderer/dxgi_format_map_autogen.cpp", |
| 654 | "src/libANGLE/renderer/dxgi_support_table.h", |
| 655 | "src/libANGLE/renderer/dxgi_support_table_autogen.cpp", |
| 656 | ] |
| 657 | |
| 658 | if (!angle_is_winuwp) { |
| 659 | sources += [ |
| 660 | "src/libANGLE/renderer/d3d_format.cpp", |
| 661 | "src/libANGLE/renderer/d3d_format.h", |
| 662 | ] |
| 663 | } |
| 664 | |
| 665 | public_deps = [ ":libANGLE_headers" ] |
| 666 | configs += [ ":angle_backend_config" ] |
| 667 | } |
| 668 | } |
| 669 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 670 | angle_source_set("libANGLE_base") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 671 | sources = libangle_sources |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 672 | |
Jamie Madill | 5ea762a | 2017-06-07 14:59:51 -0400 | [diff] [blame] | 673 | include_dirs = [] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 674 | libs = [] |
Corentin Wallez | 64598b5 | 2016-11-11 08:25:44 -0500 | [diff] [blame] | 675 | defines = [] |
Frank Henigman | e42ec18 | 2017-12-11 23:58:53 -0500 | [diff] [blame] | 676 | if (angle_link_glx) { |
| 677 | libs += [ "GL" ] |
| 678 | defines += [ "ANGLE_LINK_GLX" ] |
| 679 | } |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 680 | public_deps = [ |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 681 | ":angle_common", |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 682 | ":angle_gpu_info_util", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 683 | ":angle_version", |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 684 | ":libANGLE_headers", |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 685 | ":translator", |
Jamie Madill | e2e406c | 2016-06-02 13:04:10 -0400 | [diff] [blame] | 686 | ] |
| 687 | deps = [ |
Tim Van Patten | b55f0f7 | 2020-06-02 18:01:24 -0600 | [diff] [blame] | 688 | ":angle_compression", |
Corentin Wallez | 878baf9 | 2017-02-15 13:57:16 -0500 | [diff] [blame] | 689 | ":angle_image_util", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 690 | ":includes", |
Corentin Wallez | cc068e9 | 2016-02-29 16:37:04 -0500 | [diff] [blame] | 691 | ] |
| 692 | |
Jamie Madill | e55374f | 2019-10-24 12:55:12 -0400 | [diff] [blame] | 693 | if (is_win) { |
| 694 | libs += [ |
Jamie Madill | e55374f | 2019-10-24 12:55:12 -0400 | [diff] [blame] | 695 | "gdi32.lib", |
| 696 | "user32.lib", |
| 697 | ] |
| 698 | } |
| 699 | |
Jamie Madill | bb96aef | 2020-09-11 13:50:09 -0400 | [diff] [blame] | 700 | if (angle_enable_d3d11) { |
| 701 | public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d11_backend" ] |
| 702 | } |
| 703 | |
| 704 | if (angle_enable_d3d9) { |
| 705 | public_deps += [ "src/libANGLE/renderer/d3d:angle_d3d9_backend" ] |
| 706 | } |
| 707 | |
Jamie Madill | 2d74170 | 2020-09-11 12:30:04 -0400 | [diff] [blame] | 708 | if (angle_enable_gl) { |
| 709 | public_deps += [ "src/libANGLE/renderer/gl:angle_gl_backend" ] |
| 710 | } |
| 711 | |
Jamie Madill | 852f61f | 2020-09-11 11:54:35 -0400 | [diff] [blame] | 712 | if (angle_enable_null) { |
| 713 | public_deps += [ "src/libANGLE/renderer/null:angle_null_backend" ] |
| 714 | } |
| 715 | |
Jamie Madill | 1f08ab2 | 2019-10-03 16:22:52 -0400 | [diff] [blame] | 716 | if (angle_enable_vulkan) { |
| 717 | public_deps += [ "src/libANGLE/renderer/vulkan:angle_vulkan_backend" ] |
| 718 | } |
| 719 | |
Le Quyen | d200a77 | 2019-10-10 00:44:01 +0800 | [diff] [blame] | 720 | if (angle_enable_metal) { |
| 721 | public_deps += [ "src/libANGLE/renderer/metal:angle_metal_backend" ] |
| 722 | } |
| 723 | |
Jamie Madill | ab2bfa8 | 2019-01-15 19:06:47 -0500 | [diff] [blame] | 724 | # Enable extra Chromium style warnings for libANGLE. |
Jamie Madill | 299b1ba | 2019-10-24 09:29:18 -0400 | [diff] [blame] | 725 | if (is_clang && angle_has_build) { |
Jamie Madill | ab2bfa8 | 2019-01-15 19:06:47 -0500 | [diff] [blame] | 726 | suppressed_configs -= [ "//build/config/clang:find_bad_constructs" ] |
| 727 | } |
| 728 | |
Geoff Lang | ecd2e3b | 2019-07-09 15:39:39 -0400 | [diff] [blame] | 729 | if (is_mac) { |
| 730 | sources += libangle_mac_sources |
| 731 | } |
| 732 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 733 | if (is_debug) { |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 734 | defines += [ "ANGLE_GENERATE_SHADER_DEBUG_INFO" ] |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 735 | } |
| 736 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 737 | configs += [ ":debug_annotations_config" ] |
Jonah Ryan-Davis | 66e4850 | 2019-04-25 10:49:05 -0400 | [diff] [blame] | 738 | public_configs += [ |
| 739 | ":libANGLE_config", |
| 740 | ":angle_backend_config", |
| 741 | ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 742 | |
Tom Tan | 5c31753 | 2018-11-30 17:01:01 -0800 | [diff] [blame] | 743 | # Windows ARM64 is available since 10.0.16299 so no need to copy |
| 744 | # d3dcompiler_47.dll because this file is available as inbox. |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 745 | if (_use_copy_compiler_dll) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 746 | data_deps = [ ":copy_compiler_dll" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 747 | } |
| 748 | } |
| 749 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 750 | config("angle_frame_capture_disabled") { |
| 751 | defines = [ "ANGLE_CAPTURE_ENABLED=0" ] |
| 752 | } |
| 753 | |
| 754 | config("angle_frame_capture_enabled") { |
| 755 | defines = [ "ANGLE_CAPTURE_ENABLED=1" ] |
| 756 | } |
| 757 | |
| 758 | angle_source_set("libANGLE") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 759 | public_deps = [ ":libANGLE_base" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 760 | public_configs = [ ":angle_frame_capture_disabled" ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 761 | sources = [ "src/libANGLE/FrameCapture_mock.cpp" ] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 762 | |
| 763 | # gl_enum_utils defaults included in with_capture build |
Jamie Madill | 8d412db | 2020-08-29 22:25:18 +0000 | [diff] [blame] | 764 | deps = [] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 765 | if (angle_enable_trace || is_debug) { |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 766 | deps += [ ":angle_gl_enum_utils" ] |
Jiacheng Lu | 9e14a19 | 2019-08-09 10:03:24 -0600 | [diff] [blame] | 767 | } |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 768 | } |
| 769 | |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 770 | angle_source_set("angle_gl_enum_utils") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 771 | public_deps = [ ":libANGLE_base" ] |
Brandon Schade | 5cfab19 | 2019-10-28 09:12:53 -0700 | [diff] [blame] | 772 | sources = [ |
| 773 | "src/libANGLE/gl_enum_utils.cpp", |
| 774 | "src/libANGLE/gl_enum_utils_autogen.cpp", |
| 775 | ] |
| 776 | } |
| 777 | |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 778 | if (!defined(angle_abseil_cpp_dir)) { |
| 779 | angle_abseil_cpp_dir = "//third_party/abseil-cpp" |
| 780 | } |
| 781 | |
| 782 | config("angle_abseil_config") { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 783 | if (angle_enable_abseil) { |
| 784 | defines = [ "ANGLE_USE_ABSEIL" ] |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 785 | |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 786 | configs = [ |
| 787 | "$angle_abseil_cpp_dir:absl_define_config", |
| 788 | "$angle_abseil_cpp_dir:absl_include_config", |
| 789 | ] |
| 790 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 791 | } |
| 792 | |
| 793 | group("angle_abseil") { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 794 | if (angle_enable_abseil) { |
| 795 | # When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while |
| 796 | # we can be more specific when building standalone ANGLE. |
Tim Van Patten | 36f0464 | 2020-10-08 14:45:51 -0600 | [diff] [blame] | 797 | if (build_with_chromium || is_component_build) { |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 798 | public_deps = [ "$angle_abseil_cpp_dir:absl" ] |
| 799 | } else { |
| 800 | public_deps = [ "$angle_abseil_cpp_dir/absl/container:flat_hash_map" ] |
| 801 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 802 | |
Tim Van Patten | ec42b14 | 2020-09-28 10:15:46 -0600 | [diff] [blame] | 803 | public_configs = [ ":angle_abseil_config" ] |
| 804 | } |
Tim Van Patten | e78d9a6 | 2020-07-24 11:58:45 -0600 | [diff] [blame] | 805 | } |
| 806 | |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 807 | config("angle_compression_config") { |
| 808 | include_dirs = [ "//third_party/zlib/google" ] |
| 809 | } |
| 810 | |
| 811 | group("angle_compression") { |
| 812 | public_configs = [ |
| 813 | ":angle_compression_config", |
| 814 | "//third_party/zlib:zlib_config", |
| 815 | ] |
Jamie Madill | 35d3c41 | 2020-08-26 12:59:18 -0400 | [diff] [blame] | 816 | public_deps = |
| 817 | [ "$angle_zlib_compression_utils_dir:compression_utils_portable" ] |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 818 | } |
| 819 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 820 | angle_source_set("libANGLE_with_capture") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 821 | public_deps = [ ":libANGLE_base" ] |
Jamie Madill | 7e453a2 | 2020-03-15 22:11:03 -0400 | [diff] [blame] | 822 | deps = [ ":angle_compression" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 823 | public_configs = [ ":angle_frame_capture_enabled" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 824 | sources = libangle_capture_sources |
| 825 | } |
| 826 | |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 827 | config("shared_library_public_config") { |
| 828 | if (is_mac && !is_component_build) { |
| 829 | # Executable targets that depend on the shared libraries below need to have |
| 830 | # the rpath setup in non-component build configurations. |
Jamie Madill | a8503ce | 2016-07-18 13:47:12 -0400 | [diff] [blame] | 831 | ldflags = [ |
| 832 | "-rpath", |
| 833 | "@executable_path/", |
| 834 | ] |
Jonah Ryan-Davis | 90a8af3 | 2020-03-05 13:48:47 -0500 | [diff] [blame] | 835 | if (build_with_chromium) { |
| 836 | ldflags += [ |
| 837 | # Path for loading shared libraries for unbundled binaries. |
| 838 | # From //build/config/mac/BUILD.gn, this is only added for |
| 839 | # component builds. However, since ANGLE always dynamically |
| 840 | # links to libvulkan, it should be re-added for non-component |
| 841 | # builds. (anglebug.com/4455) |
| 842 | "-Wl,-rpath,@loader_path/.", |
| 843 | ] |
| 844 | } |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 845 | } |
Josh Matthews | 732c9d0 | 2019-11-29 13:59:03 -0500 | [diff] [blame] | 846 | |
| 847 | if (angle_is_winuwp) { |
| 848 | ldflags = [ |
| 849 | "/APPCONTAINER", |
| 850 | |
| 851 | # Disable warning about invalid subsystem number. |
| 852 | # A default appropriate subsystem is selected automatically. |
| 853 | "/IGNORE:4010", |
| 854 | ] |
| 855 | } |
Robert Sesek | db8ae83 | 2016-06-21 11:47:03 -0400 | [diff] [blame] | 856 | } |
| 857 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 858 | config("library_name_config") { |
Yuly Novikov | 8b8dc56 | 2020-02-26 19:09:31 -0500 | [diff] [blame] | 859 | if (is_component_build && is_android) { |
| 860 | defines = [ |
| 861 | "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}.cr\"", |
| 862 | "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}.cr\"", |
| 863 | ] |
| 864 | } else { |
| 865 | defines = [ |
| 866 | "ANGLE_EGL_LIBRARY_NAME=\"libEGL${angle_libs_suffix}\"", |
| 867 | "ANGLE_GLESV2_LIBRARY_NAME=\"libGLESv2${angle_libs_suffix}\"", |
| 868 | ] |
| 869 | } |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 870 | } |
| 871 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 872 | # This config controls export definitions on ANGLE API calls. |
| 873 | config("angle_static") { |
| 874 | defines = [ |
| 875 | "ANGLE_EXPORT=", |
Jamie Madill | ba319ba | 2018-12-29 10:29:33 -0500 | [diff] [blame] | 876 | "ANGLE_UTIL_EXPORT=", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 877 | "EGLAPI=", |
| 878 | "GL_APICALL=", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 879 | "GL_API=", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 880 | ] |
| 881 | } |
| 882 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 883 | set_defaults("angle_libGLESv2") { |
| 884 | sources = [] |
| 885 | output_name = "libGLESv2" |
| 886 | } |
| 887 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 888 | template("angle_libGLESv2") { |
| 889 | angle_shared_library(target_name) { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 890 | sources = libglesv2_sources + invoker.sources |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 891 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 892 | if (is_win) { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 893 | sources += [ "src/libGLESv2/${invoker.output_name}_autogen.def" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 894 | } |
| 895 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 896 | output_name = "${invoker.output_name}${angle_libs_suffix}" |
| 897 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 898 | configs += [ |
| 899 | ":angle_gl_visibility_config", |
| 900 | ":debug_annotations_config", |
| 901 | ":gl_prototypes", |
| 902 | ] |
| 903 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 904 | defines = [ "LIBGLESV2_IMPLEMENTATION" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 905 | |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 906 | deps = invoker.deps + [ ":includes" ] |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 907 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 908 | public_deps = [ ":angle_version" ] |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 909 | } |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 910 | } |
John Abd-El-Malek | 657cd68 | 2014-11-05 14:04:19 -0800 | [diff] [blame] | 911 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 912 | angle_libGLESv2("libGLESv2") { |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 913 | if (angle_with_capture_by_default) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 914 | deps = [ ":libANGLE_with_capture" ] |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 915 | } else { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 916 | deps = [ ":libANGLE" ] |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 917 | } |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 918 | } |
Jamie Madill | 72f5b5e | 2014-06-23 15:13:02 -0400 | [diff] [blame] | 919 | |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 920 | # Output capture lib when `angle_with_capture_by_default` disabled, vice versa. |
| 921 | angle_libGLESv2("libGLESv2_capture_complement") { |
| 922 | if (angle_with_capture_by_default) { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 923 | deps = [ ":libANGLE" ] |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 924 | output_name += "_no_capture" |
| 925 | } else { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 926 | deps = [ ":libANGLE_with_capture" ] |
Jiacheng Lu | 617f23d | 2019-08-12 10:11:53 -0600 | [diff] [blame] | 927 | output_name += "_with_capture" |
Jamie Madill | eb1b164 | 2019-07-30 17:22:17 -0400 | [diff] [blame] | 928 | } |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 929 | } |
| 930 | |
Austin Kinross | 11dc163 | 2019-09-18 14:46:23 -0700 | [diff] [blame] | 931 | if (is_win && !angle_is_winuwp) { |
Clemen Deng | cb8b4a5 | 2019-07-04 16:05:25 -0400 | [diff] [blame] | 932 | angle_shared_library("libGL") { |
| 933 | sources = libgl_sources |
Clemen Deng | 663b048 | 2019-07-11 12:37:35 -0400 | [diff] [blame] | 934 | |
Clemen Deng | 6e7dd1e | 2019-07-16 13:41:59 -0400 | [diff] [blame] | 935 | output_name = "openGL32" |
| 936 | output_dir = "$root_out_dir/angle_libs" |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 937 | |
| 938 | configs += [ |
| 939 | ":angle_gl_visibility_config", |
| 940 | ":debug_annotations_config", |
| 941 | ":gl_prototypes", |
| 942 | ] |
| 943 | |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 944 | defines = [ |
| 945 | "ANGLE_CAPTURE_ENABLED=0", |
Clemen Deng | cb8b4a5 | 2019-07-04 16:05:25 -0400 | [diff] [blame] | 946 | "LIBGL_IMPLEMENTATION", |
Jamie Madill | 612b741 | 2019-07-05 11:13:30 -0400 | [diff] [blame] | 947 | ] |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 948 | |
| 949 | deps = [ |
| 950 | ":includes", |
| 951 | ":libANGLE", |
| 952 | ] |
| 953 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 954 | public_deps = [ ":angle_version" ] |
Clemen Deng | 7558e83 | 2019-06-18 13:02:03 -0400 | [diff] [blame] | 955 | } |
| 956 | } |
| 957 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 958 | angle_static_library("libGLESv2_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 959 | sources = libglesv2_sources |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 960 | configs += [ ":debug_annotations_config" ] |
| 961 | public_configs += [ ":angle_static" ] |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 962 | deps = [ ":includes" ] |
| 963 | public_deps = [ ":libANGLE" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 964 | } |
| 965 | |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 966 | angle_static_library("libGLESv2_with_capture_static") { |
| 967 | sources = libglesv2_sources |
| 968 | configs += [ ":debug_annotations_config" ] |
| 969 | public_configs += [ ":angle_static" ] |
| 970 | deps = [ ":includes" ] |
| 971 | public_deps = [ ":libANGLE_with_capture" ] |
| 972 | } |
| 973 | |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 974 | angle_shared_library("libGLESv1_CM") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 975 | sources = libglesv1_cm_sources |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 976 | output_name = "libGLESv1_CM${angle_libs_suffix}" |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 977 | |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 978 | configs += [ |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 979 | ":angle_gl_visibility_config", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 980 | ":debug_annotations_config", |
Jamie Madill | ba319ba | 2018-12-29 10:29:33 -0500 | [diff] [blame] | 981 | ":gl_prototypes", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 982 | ] |
| 983 | |
| 984 | defines = [] |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 985 | |
| 986 | deps = [ |
| 987 | ":includes", |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 988 | ":libGLESv2", |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 989 | ] |
Jamie Madill | 8970ad3 | 2020-08-26 12:59:19 -0400 | [diff] [blame] | 990 | |
| 991 | if (is_win) { |
| 992 | sources += [ "src/libGLESv1_CM/libGLESv1_CM.def" ] |
| 993 | } |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 994 | } |
| 995 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 996 | angle_static_library("libGLESv1_CM_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 997 | sources = libglesv1_cm_sources |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 998 | configs += [ ":debug_annotations_config" ] |
| 999 | public_configs += [ ":angle_static" ] |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 1000 | deps = [ |
| 1001 | ":includes", |
| 1002 | ":libGLESv2_static", |
| 1003 | ] |
| 1004 | } |
| 1005 | |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1006 | config("libEGL_egl_loader_config") { |
| 1007 | defines = [ "ANGLE_USE_EGL_LOADER" ] |
| 1008 | } |
| 1009 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1010 | angle_source_set("libEGL_egl_loader") { |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1011 | sources = [ |
| 1012 | "src/libEGL/egl_loader_autogen.cpp", |
| 1013 | "src/libEGL/egl_loader_autogen.h", |
| 1014 | ] |
| 1015 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1016 | public_configs += [ |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1017 | ":libEGL_egl_loader_config", |
| 1018 | ":gl_prototypes", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1019 | ] |
| 1020 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1021 | deps = [ ":includes" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1022 | } |
| 1023 | |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1024 | angle_shared_library("libEGL") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1025 | sources = libegl_sources |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1026 | output_name = "libEGL${angle_libs_suffix}" |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1027 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1028 | configs += [ |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 1029 | ":debug_annotations_config", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1030 | ":library_name_config", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1031 | ] |
| 1032 | |
Jamie Madill | edbc244 | 2016-01-04 11:25:00 -0500 | [diff] [blame] | 1033 | defines = [ "LIBEGL_IMPLEMENTATION" ] |
Yuly Novikov | a4ab580 | 2016-12-19 17:44:22 -0500 | [diff] [blame] | 1034 | if (is_win) { |
| 1035 | defines += [ "EGLAPI=" ] |
| 1036 | } else { |
| 1037 | defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ] |
| 1038 | } |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1039 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1040 | if (is_win) { |
Nico Weber | 9db8df4 | 2019-01-04 14:47:27 -0500 | [diff] [blame] | 1041 | sources += [ "src/libEGL/libEGL.def" ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1042 | } |
| 1043 | |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1044 | deps = [ |
James Darpinian | 22ec7dc | 2019-08-06 10:10:52 -0700 | [diff] [blame] | 1045 | ":angle_common", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1046 | ":angle_system_utils", |
| 1047 | ":angle_version", |
| 1048 | ":libEGL_egl_loader", |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1049 | ] |
Jamie Madill | 720ca44 | 2018-12-17 14:04:10 -0500 | [diff] [blame] | 1050 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1051 | public_deps = [ ":includes" ] |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1052 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1053 | data_deps = [ ":libGLESv2" ] |
Jamie Madill | 562e81b | 2015-01-14 14:31:02 -0500 | [diff] [blame] | 1054 | } |
Corentin Wallez | beb8158 | 2015-09-02 10:30:55 -0400 | [diff] [blame] | 1055 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1056 | angle_static_library("libEGL_static") { |
Frank Henigman | 44b2c0b | 2018-08-29 17:31:27 -0400 | [diff] [blame] | 1057 | sources = libegl_sources |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 1058 | configs += [ |
| 1059 | ":debug_annotations_config", |
| 1060 | ":library_name_config", |
| 1061 | ] |
| 1062 | public_configs += [ ":angle_static" ] |
| 1063 | deps = [ |
| 1064 | ":includes", |
| 1065 | ":libGLESv2_static", |
| 1066 | ] |
| 1067 | } |
| 1068 | |
| 1069 | angle_static_library("libEGL_with_capture_static") { |
| 1070 | sources = libegl_sources |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1071 | |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1072 | configs += [ |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1073 | ":debug_annotations_config", |
Jamie Madill | 4638dc9 | 2018-12-17 13:13:49 -0500 | [diff] [blame] | 1074 | ":library_name_config", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1075 | ] |
| 1076 | |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1077 | public_configs += [ ":angle_static" ] |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1078 | |
| 1079 | deps = [ |
| 1080 | ":includes", |
Manh Nguyen | dce37b7 | 2020-06-21 22:27:06 -0400 | [diff] [blame] | 1081 | ":libGLESv2_with_capture_static", |
Jamie Madill | 80ab03c | 2017-01-03 11:03:23 -0500 | [diff] [blame] | 1082 | ] |
| 1083 | } |
| 1084 | |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1085 | # Convenience targets for some of the samples so they can be built |
| 1086 | # with Chromium's toolchain. |
Jamie Madill | 7098cff | 2019-01-15 18:33:42 -0500 | [diff] [blame] | 1087 | angle_executable("angle_shader_translator") { |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1088 | testonly = true |
| 1089 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1090 | sources = [ "samples/shader_translator/shader_translator.cpp" ] |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1091 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1092 | deps = [ ":translator" ] |
Ken Russell | fcadd08 | 2017-06-28 14:01:15 -0700 | [diff] [blame] | 1093 | } |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 1094 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1095 | if (angle_has_build) { |
| 1096 | config("angle_feature_support_config") { |
| 1097 | include_dirs = [ |
| 1098 | "include", |
| 1099 | "src", |
| 1100 | ] |
| 1101 | defines = [ "LIBFEATURE_SUPPORT_IMPLEMENTATION" ] |
| 1102 | if (is_debug) { |
| 1103 | defines += [ "ANGLE_FEATURE_UTIL_LOG_VERBOSE" ] |
| 1104 | } |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1105 | } |
Courtney Goeltzenleuchter | 7d81ae7 | 2018-10-08 19:25:19 -0600 | [diff] [blame] | 1106 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1107 | angle_shared_library("libfeature_support") { |
| 1108 | output_name = "libfeature_support${angle_libs_suffix}" |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1109 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1110 | if (is_android) { |
| 1111 | libs = [ "log" ] |
| 1112 | } |
| 1113 | |
| 1114 | public_configs += [ |
| 1115 | ":angle_feature_support_config", |
| 1116 | "${angle_jsoncpp_dir}:jsoncpp_config", |
| 1117 | ] |
| 1118 | |
| 1119 | if (is_mac && !is_component_build) { |
| 1120 | ldflags = [ |
| 1121 | "-install_name", |
| 1122 | "@rpath/${target_name}.dylib", |
| 1123 | ] |
| 1124 | } |
| 1125 | |
| 1126 | sources = [ |
| 1127 | "src/feature_support_util/feature_support_util.cpp", |
| 1128 | "src/feature_support_util/feature_support_util.h", |
| 1129 | ] |
| 1130 | |
| 1131 | deps = [ |
| 1132 | ":angle_gpu_info_util", |
| 1133 | "${angle_jsoncpp_dir}:jsoncpp", |
Cezary Kulakowski | 4fb738f | 2019-02-01 10:53:44 +0100 | [diff] [blame] | 1134 | ] |
| 1135 | } |
Ian Elliott | a9d579e | 2018-11-28 11:44:48 -0700 | [diff] [blame] | 1136 | } |
| 1137 | |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1138 | if (!is_component_build && is_android && symbol_level != 0) { |
| 1139 | action_foreach("compressed_symbols") { |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1140 | sources = [] |
| 1141 | foreach(_library, angle_libraries) { |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1142 | sources += [ "$root_out_dir/${_library}${angle_libs_suffix}.so" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1143 | } |
| 1144 | if (angle_enable_vulkan_validation_layers) { |
| 1145 | foreach(_layer, vulkan_validation_layers) { |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1146 | sources += [ "$root_out_dir/lib${_layer}.so" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1147 | } |
| 1148 | } |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1149 | |
| 1150 | script = rebase_path("${root_build_dir}/android/compress_symbols.py", |
| 1151 | root_build_dir) |
| 1152 | |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1153 | deps = [] |
| 1154 | foreach(_library, angle_libraries) { |
Jamie Madill | 77c8496 | 2019-06-28 11:24:27 -0400 | [diff] [blame] | 1155 | deps += [ ":$_library" ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1156 | } |
| 1157 | |
| 1158 | if (angle_enable_vulkan_validation_layers) { |
| 1159 | foreach(_layer, vulkan_validation_layers) { |
Tobin Ehlis | f22f16d | 2019-07-18 15:10:49 -0600 | [diff] [blame] | 1160 | deps += [ |
| 1161 | "${angle_root}/third_party/vulkan-validation-layers/src:${_layer}", |
| 1162 | ] |
Courtney Goeltzenleuchter | c05c141 | 2019-01-03 12:40:13 -0700 | [diff] [blame] | 1163 | } |
| 1164 | } |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1165 | |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1166 | outputs = [ "$root_out_dir/lib.compressed/{{source_file_part}}" ] |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1167 | |
| 1168 | android_nm = "${android_tool_prefix}nm" |
Tim Van Patten | 73e17bf | 2019-05-14 10:42:25 -0600 | [diff] [blame] | 1169 | android_strip = "${android_tool_prefix}strip" |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1170 | |
| 1171 | args = [ |
| 1172 | "--objcopy", |
| 1173 | rebase_path(android_objcopy, root_build_dir), |
| 1174 | "--nm", |
| 1175 | rebase_path(android_nm, root_build_dir), |
Tim Van Patten | 73e17bf | 2019-05-14 10:42:25 -0600 | [diff] [blame] | 1176 | "--strip", |
| 1177 | rebase_path(android_strip, root_build_dir), |
Jamie Madill | 1f56ed2 | 2019-01-03 15:24:22 -0500 | [diff] [blame] | 1178 | "--unstrippedsofile", |
| 1179 | "{{source_dir}}/lib.unstripped/{{source_file_part}}", |
| 1180 | "--output", |
| 1181 | "{{source_dir}}/lib.compressed/{{source_file_part}}", |
| 1182 | ] |
| 1183 | } |
| 1184 | } |
| 1185 | |
Geoff Lang | 6e687af | 2019-10-17 14:36:41 -0400 | [diff] [blame] | 1186 | if (build_with_chromium && !is_component_build && is_android && |
Courtney Goeltzenleuchter | 92b16ea | 2018-12-12 17:06:47 -0700 | [diff] [blame] | 1187 | current_toolchain == default_toolchain) { |
Cody Northrop | 8cbd321 | 2019-04-23 13:25:20 -0600 | [diff] [blame] | 1188 | # Package ANGLE libraries |
| 1189 | angle_apk("angle_chromium_apk") { |
Tobin Ehlis | 736c43a | 2020-08-31 10:23:27 -0600 | [diff] [blame] | 1190 | package_name = "org.chromium.angle" |
Tim Van Patten | ee4fa07 | 2019-02-21 19:21:09 +0000 | [diff] [blame] | 1191 | apk_name = "AngleLibraries" |
Jamie Madill | 7bed2a5 | 2020-09-22 23:37:54 -0400 | [diff] [blame] | 1192 | version_name = "ANGLE Developer Build" |
| 1193 | |
| 1194 | if (angle_enable_commit_id) { |
| 1195 | version_code = |
| 1196 | exec_script("src/commit_id.py", [ "position" ], "trim string") |
| 1197 | } else { |
| 1198 | version_code = "0" |
| 1199 | } |
Cody Northrop | 8e63644 | 2018-11-30 16:24:11 -0700 | [diff] [blame] | 1200 | } |
| 1201 | |
| 1202 | group("angle_apks") { |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1203 | deps = [ ":angle_chromium_apk" ] |
Courtney Goeltzenleuchter | 2565d48 | 2018-04-12 17:06:48 -0600 | [diff] [blame] | 1204 | } |
| 1205 | } |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1206 | |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1207 | group("angle") { |
| 1208 | data_deps = [ |
Julien Isorce | 5641d19 | 2020-02-04 21:31:47 -0800 | [diff] [blame] | 1209 | ":libEGL", |
Jamie Madill | e3c2571 | 2019-12-03 14:08:36 -0500 | [diff] [blame] | 1210 | ":libGLESv1_CM", |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1211 | ":libGLESv2", |
Jamie Madill | 1ba7254 | 2019-10-04 15:17:49 -0400 | [diff] [blame] | 1212 | ] |
| 1213 | } |