mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1 | # Copyright 2016 Google Inc. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
Brian Osman | f2c9014 | 2017-07-13 15:50:03 -0400 | [diff] [blame] | 6 | import("gn/flutter_defines.gni") |
Mike Reed | 025f783 | 2018-11-12 09:27:05 -0500 | [diff] [blame] | 7 | import("gn/fuchsia_defines.gni") |
mikejurka | 8c24f4f | 2016-09-12 16:51:58 -0700 | [diff] [blame] | 8 | import("gn/shared_sources.gni") |
Hal Canary | 45812a1 | 2019-09-04 08:58:59 -0400 | [diff] [blame] | 9 | import("gn/skia.gni") |
| 10 | |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 11 | if (is_fuchsia) { |
| 12 | import("//build/fuchsia/sdk.gni") |
| 13 | import("build/fuchsia/fuchsia_download_sdk.gni") |
| 14 | } |
| 15 | |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 16 | if (skia_use_dawn) { |
| 17 | import("third_party/externals/dawn/scripts/dawn_features.gni") |
| 18 | } |
| 19 | |
Adam Barth | 54ef74a | 2017-10-13 10:59:38 -0700 | [diff] [blame] | 20 | if (defined(skia_settings)) { |
| 21 | import(skia_settings) |
| 22 | } |
| 23 | |
Hal Canary | 3388c1a | 2019-09-16 12:53:17 -0400 | [diff] [blame] | 24 | import("gn/ios.gni") |
| 25 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 26 | # Skia public API, generally provided by :skia. |
| 27 | config("skia_public") { |
Mike Klein | 9e25bb9 | 2019-04-29 09:46:36 -0500 | [diff] [blame] | 28 | include_dirs = [ "." ] |
| 29 | |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 30 | defines = [] |
Chinmay Garde | f832c0a | 2020-03-18 14:37:23 -0700 | [diff] [blame] | 31 | cflags_objcc = [] |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 32 | if (is_component_build) { |
| 33 | defines += [ "SKIA_DLL" ] |
| 34 | } |
Mike Klein | c4cbd74 | 2016-09-26 21:37:09 -0400 | [diff] [blame] | 35 | if (is_fuchsia || is_linux) { |
Mike Klein | f0a5369 | 2019-04-24 11:42:40 -0500 | [diff] [blame] | 36 | defines += [ "SK_R32_SHIFT=16" ] |
jcgregorio | 5561e3d | 2016-08-25 09:25:11 -0700 | [diff] [blame] | 37 | } |
Brian Osman | f2c9014 | 2017-07-13 15:50:03 -0400 | [diff] [blame] | 38 | if (skia_enable_flutter_defines) { |
| 39 | defines += flutter_defines |
| 40 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 41 | if (!skia_enable_gpu) { |
| 42 | defines += [ "SK_SUPPORT_GPU=0" ] |
| 43 | } |
Mike Reed | 025f783 | 2018-11-12 09:27:05 -0500 | [diff] [blame] | 44 | if (is_fuchsia) { |
| 45 | defines += fuchsia_defines |
| 46 | } |
Kevin Lubick | 27ba703 | 2019-03-21 08:13:54 -0400 | [diff] [blame] | 47 | if (skia_gl_standard == "gles") { |
| 48 | defines += [ "SK_ASSUME_GL_ES=1" ] |
| 49 | } else if (skia_gl_standard == "gl") { |
| 50 | defines += [ "SK_ASSUME_GL=1" ] |
Kevin Lubick | 3902628 | 2019-03-28 12:46:40 -0400 | [diff] [blame] | 51 | } else if (skia_gl_standard == "webgl") { |
| 52 | defines += [ "SK_ASSUME_WEBGL=1" ] |
Kevin Lubick | 27ba703 | 2019-03-21 08:13:54 -0400 | [diff] [blame] | 53 | } |
Chinmay Garde | f832c0a | 2020-03-18 14:37:23 -0700 | [diff] [blame] | 54 | |
| 55 | # Some older versions of the Clang toolchain change the visibility of |
| 56 | # symbols decorated with API_AVAILABLE macro to be visible. Users of such |
| 57 | # toolchains suppress the use of this macro till toolchain updates are made. |
| 58 | if (is_mac || is_ios) { |
| 59 | if (skia_enable_api_available_macro) { |
| 60 | defines += [ "SK_ENABLE_API_AVAILABLE" ] |
| 61 | } else { |
| 62 | cflags_objcc += [ "-Wno-unguarded-availability" ] |
| 63 | } |
| 64 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | # Skia internal APIs, used by Skia itself and a few test tools. |
| 68 | config("skia_private") { |
| 69 | visibility = [ ":*" ] |
| 70 | |
Mike Reed | a9e241d | 2017-05-03 10:52:00 -0400 | [diff] [blame] | 71 | defines = [ "SK_GAMMA_APPLY_TO_A8" ] |
Leon Scroggins III | c41a5f5 | 2018-11-15 15:54:59 -0500 | [diff] [blame] | 72 | if (skia_use_fixed_gamma_text) { |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 73 | defines += [ |
| 74 | "SK_GAMMA_EXPONENT=1.4", |
| 75 | "SK_GAMMA_CONTRAST=0.0", |
| 76 | ] |
| 77 | } |
Mike Klein | b45d862 | 2019-04-24 14:04:01 -0500 | [diff] [blame] | 78 | if (is_skia_dev_build) { |
| 79 | defines += [ |
| 80 | "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1", |
| 81 | "GR_TEST_UTILS=1", |
| 82 | ] |
mtklein | 88a7ac0 | 2016-09-14 11:16:49 -0700 | [diff] [blame] | 83 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 84 | libs = [] |
| 85 | lib_dirs = [] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 86 | if (skia_use_gl && skia_use_angle) { |
Brian Osman | 34755e2 | 2016-12-05 09:46:02 -0500 | [diff] [blame] | 87 | defines += [ "SK_ANGLE" ] |
| 88 | } |
Greg Daniel | b16beb9 | 2020-04-27 14:26:21 +0000 | [diff] [blame] | 89 | if (skia_use_vma) { |
| 90 | defines += [ "SK_USE_VMA" ] |
| 91 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 95 | config("skia_library") { |
| 96 | visibility = [ ":*" ] |
Mike Klein | f5f4e81 | 2019-04-29 15:45:14 +0000 | [diff] [blame] | 97 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | skia_library_configs = [ |
| 101 | ":skia_public", |
| 102 | ":skia_private", |
| 103 | ":skia_library", |
| 104 | ] |
| 105 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 106 | # Use for CPU-specific Skia code that needs particular compiler flags. |
| 107 | template("opts") { |
Mike Klein | 6d1df6d | 2018-11-07 15:03:58 -0500 | [diff] [blame] | 108 | visibility = [ ":*" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 109 | if (invoker.enabled) { |
| 110 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 111 | check_includes = false |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 112 | forward_variables_from(invoker, "*") |
| 113 | configs += skia_library_configs |
| 114 | } |
| 115 | } else { |
| 116 | # If not enabled, a phony empty target that swallows all otherwise unused variables. |
| 117 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 118 | check_includes = false |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 119 | forward_variables_from(invoker, |
| 120 | "*", |
| 121 | [ |
| 122 | "sources", |
| 123 | "cflags", |
| 124 | ]) |
| 125 | } |
| 126 | } |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 127 | } |
| 128 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 129 | is_x86 = current_cpu == "x64" || current_cpu == "x86" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 130 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 131 | opts("none") { |
| 132 | enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 133 | sources = skia_opts.none_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 134 | cflags = [] |
| 135 | } |
| 136 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 137 | opts("armv7") { |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 138 | enabled = current_cpu == "arm" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 139 | sources = skia_opts.armv7_sources + skia_opts.neon_sources |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 140 | cflags = [] |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | opts("arm64") { |
| 144 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 145 | sources = skia_opts.arm64_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 146 | cflags = [] |
| 147 | } |
| 148 | |
| 149 | opts("crc32") { |
| 150 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 151 | sources = skia_opts.crc32_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 152 | cflags = [ "-march=armv8-a+crc" ] |
| 153 | } |
| 154 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 155 | opts("sse2") { |
| 156 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 157 | sources = skia_opts.sse2_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 158 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 159 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ] |
| 160 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 161 | cflags = [ "-msse2" ] |
| 162 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 163 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 164 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 165 | opts("ssse3") { |
| 166 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 167 | sources = skia_opts.ssse3_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 168 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 169 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ] |
| 170 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 171 | cflags = [ "-mssse3" ] |
| 172 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 173 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 174 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 175 | opts("sse41") { |
| 176 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 177 | sources = skia_opts.sse41_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 178 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 179 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ] |
| 180 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 181 | cflags = [ "-msse4.1" ] |
| 182 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 183 | } |
mtklein | 4e97607 | 2016-08-08 09:06:27 -0700 | [diff] [blame] | 184 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 185 | opts("sse42") { |
| 186 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 187 | sources = skia_opts.sse42_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 188 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 189 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ] |
| 190 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 191 | cflags = [ "-msse4.2" ] |
| 192 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | opts("avx") { |
| 196 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 197 | sources = skia_opts.avx_sources |
Mike Klein | 4d4b3aa | 2018-03-21 13:07:35 -0400 | [diff] [blame] | 198 | if (is_win) { |
Mike Klein | 17b6e48 | 2016-11-18 22:11:41 +0000 | [diff] [blame] | 199 | cflags = [ "/arch:AVX" ] |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 200 | } else { |
| 201 | cflags = [ "-mavx" ] |
Mike Klein | 1cc767b | 2019-12-13 13:02:22 -0500 | [diff] [blame] | 202 | if (is_mac && is_debug) { |
Mike Klein | f800c1d | 2020-06-04 11:53:56 -0500 | [diff] [blame] | 203 | cflags += [ "-fno-stack-check" ] # Work around skia:9709 |
Mike Klein | 1cc767b | 2019-12-13 13:02:22 -0500 | [diff] [blame] | 204 | } |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 205 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 206 | } |
| 207 | |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 208 | opts("hsw") { |
| 209 | enabled = is_x86 |
| 210 | sources = skia_opts.hsw_sources |
Mike Klein | 4d4b3aa | 2018-03-21 13:07:35 -0400 | [diff] [blame] | 211 | if (is_win) { |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 212 | cflags = [ "/arch:AVX2" ] |
| 213 | } else { |
Mike Klein | e87c486 | 2018-03-23 00:13:58 +0000 | [diff] [blame] | 214 | cflags = [ "-march=haswell" ] |
Mike Klein | db38022 | 2020-01-22 13:53:18 -0600 | [diff] [blame] | 215 | if (is_mac && is_debug) { |
Mike Klein | f800c1d | 2020-06-04 11:53:56 -0500 | [diff] [blame] | 216 | cflags += [ "-fno-stack-check" ] # Work around skia:9709 |
Mike Klein | db38022 | 2020-01-22 13:53:18 -0600 | [diff] [blame] | 217 | } |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 218 | } |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 219 | } |
| 220 | |
Mike Klein | ad56c4c | 2020-06-05 06:57:30 -0500 | [diff] [blame^] | 221 | opts("skx") { |
| 222 | enabled = is_x86 |
| 223 | sources = skia_opts.skx_sources |
| 224 | if (is_win) { |
| 225 | cflags = [ "/arch:AVX512" ] |
| 226 | } else { |
| 227 | cflags = [ "-march=skylake-avx512" ] |
| 228 | if (is_mac && is_debug) { |
| 229 | cflags += [ "-fno-stack-check" ] # Work around skia:9709 |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 234 | # Any feature of Skia that requires third-party code should be optional and use this template. |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 235 | template("optional") { |
Mike Klein | 6d1df6d | 2018-11-07 15:03:58 -0500 | [diff] [blame] | 236 | visibility = [ ":*" ] |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 237 | if (invoker.enabled) { |
| 238 | config(target_name + "_public") { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 239 | if (defined(invoker.public_defines)) { |
| 240 | defines = invoker.public_defines |
| 241 | } |
Chris Dalton | 3a67b8e | 2018-05-03 09:30:29 -0600 | [diff] [blame] | 242 | if (defined(invoker.public_configs)) { |
| 243 | configs = invoker.public_configs |
| 244 | } |
Hal Canary | 2dad990 | 2019-11-20 16:01:31 -0500 | [diff] [blame] | 245 | if (defined(invoker.public_include_dirs)) { |
| 246 | include_dirs = invoker.public_include_dirs |
| 247 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 248 | } |
| 249 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 250 | check_includes = false |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 251 | forward_variables_from(invoker, |
| 252 | "*", |
| 253 | [ |
| 254 | "public_defines", |
| 255 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 256 | "configs_to_remove", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 257 | ]) |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 258 | all_dependent_configs = [ ":" + target_name + "_public" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 259 | configs += skia_library_configs |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 260 | if (defined(invoker.configs_to_remove)) { |
| 261 | configs -= invoker.configs_to_remove |
| 262 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 263 | } |
| 264 | } else { |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 265 | source_set(target_name) { |
| 266 | forward_variables_from(invoker, |
| 267 | "*", |
| 268 | [ |
| 269 | "public_defines", |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 270 | "public_deps", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 271 | "deps", |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 272 | "libs", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 273 | "sources", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 274 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 275 | "configs_to_remove", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 276 | ]) |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 277 | if (defined(invoker.sources_when_disabled)) { |
| 278 | sources = invoker.sources_when_disabled |
| 279 | } |
| 280 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 281 | } |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 282 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 283 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 284 | |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 285 | optional("android_utils") { |
| 286 | enabled = skia_enable_android_utils |
| 287 | |
Leon Scroggins III | 87caae6 | 2020-05-04 10:02:45 -0400 | [diff] [blame] | 288 | public = [ |
| 289 | "client_utils/android/BRDAllocator.h", |
| 290 | "client_utils/android/BitmapRegionDecoder.h", |
| 291 | "client_utils/android/FrontBufferedStream.h", |
| 292 | ] |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 293 | public_defines = [ "SK_ENABLE_ANDROID_UTILS" ] |
Leon Scroggins III | 87caae6 | 2020-05-04 10:02:45 -0400 | [diff] [blame] | 294 | sources = [ |
| 295 | "client_utils/android/BitmapRegionDecoder.cpp", |
| 296 | "client_utils/android/FrontBufferedStream.cpp", |
| 297 | ] |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 298 | } |
| 299 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 300 | optional("fontmgr_android") { |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 301 | enabled = skia_enable_fontmgr_android |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 302 | |
| 303 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 304 | ":typeface_freetype", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 305 | "//third_party/expat", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 306 | ] |
| 307 | sources = [ |
| 308 | "src/ports/SkFontMgr_android.cpp", |
| 309 | "src/ports/SkFontMgr_android_factory.cpp", |
| 310 | "src/ports/SkFontMgr_android_parser.cpp", |
| 311 | ] |
| 312 | } |
| 313 | |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 314 | optional("fontmgr_custom") { |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 315 | enabled = skia_enable_fontmgr_custom |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 316 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 317 | deps = [ ":typeface_freetype" ] |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 318 | sources = [ |
| 319 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 320 | "src/ports/SkFontMgr_custom.h", |
| 321 | "src/ports/SkFontMgr_custom_directory.cpp", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 322 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 323 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 324 | "src/ports/SkFontMgr_custom_empty.cpp", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 325 | ] |
| 326 | } |
| 327 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 328 | optional("fontmgr_custom_empty") { |
| 329 | enabled = skia_enable_fontmgr_custom_empty |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 330 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 331 | deps = [ ":typeface_freetype" ] |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 332 | sources = [ |
| 333 | "src/ports/SkFontMgr_custom.cpp", |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 334 | "src/ports/SkFontMgr_custom_empty.cpp", |
| 335 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 336 | ] |
| 337 | } |
| 338 | |
Hal Canary | ff2742e | 2018-01-30 11:35:47 -0500 | [diff] [blame] | 339 | optional("fontmgr_empty") { |
| 340 | enabled = skia_enable_fontmgr_empty |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 341 | sources = [ "src/ports/SkFontMgr_empty_factory.cpp" ] |
Hal Canary | ff2742e | 2018-01-30 11:35:47 -0500 | [diff] [blame] | 342 | } |
| 343 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 344 | optional("fontmgr_fontconfig") { |
| 345 | enabled = skia_use_freetype && skia_use_fontconfig |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 346 | |
| 347 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 348 | ":typeface_freetype", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 349 | "//third_party:fontconfig", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 350 | ] |
| 351 | sources = [ |
bungeman | 1ae0e01 | 2016-09-19 12:13:16 -0700 | [diff] [blame] | 352 | "src/ports/SkFontConfigInterface.cpp", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 353 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 354 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 355 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
| 356 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 357 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
| 358 | ] |
| 359 | } |
| 360 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 361 | optional("fontmgr_fuchsia") { |
| 362 | enabled = skia_enable_fontmgr_fuchsia |
| 363 | |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 364 | deps = [] |
| 365 | |
| 366 | if (is_fuchsia && using_fuchsia_sdk) { |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 367 | deps += [ "//build/fuchsia/fidl:fuchsia.fonts" ] |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 368 | } else { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 369 | deps = [ "//sdk/fidl/fuchsia.fonts" ] |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 370 | } |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 371 | sources = [ |
| 372 | "src/ports/SkFontMgr_fuchsia.cpp", |
| 373 | "src/ports/SkFontMgr_fuchsia.h", |
| 374 | ] |
| 375 | } |
| 376 | |
Ben Wagner | d13487e | 2020-06-03 23:29:43 -0400 | [diff] [blame] | 377 | optional("fontmgr_mac") { |
| 378 | enabled = skia_use_fonthost_mac |
| 379 | |
| 380 | sources = [ "src/ports/SkFontHost_mac.cpp" ] |
| 381 | |
| 382 | if (is_mac) { |
| 383 | libs = [ |
| 384 | # AppKit symbols NSFontWeightXXX may be dlsym'ed. |
| 385 | "AppKit.framework", |
| 386 | "ApplicationServices.framework", |
| 387 | ] |
| 388 | } |
| 389 | |
| 390 | if (is_ios) { |
| 391 | libs = [ |
| 392 | "CoreFoundation.framework", |
| 393 | "CoreGraphics.framework", |
| 394 | "CoreText.framework", |
| 395 | |
| 396 | # UIKit symbols UIFontWeightXXX may be dlsym'ed. |
| 397 | "UIKit.framework", |
| 398 | ] |
| 399 | } |
| 400 | } |
| 401 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 402 | optional("fontmgr_wasm") { |
Kevin Lubick | e27a503 | 2019-10-09 10:13:29 -0400 | [diff] [blame] | 403 | enabled = target_cpu == "wasm" |
Kevin Lubick | b6a3b7d | 2020-01-02 08:16:51 -0500 | [diff] [blame] | 404 | deps = [] |
Kevin Lubick | e27a503 | 2019-10-09 10:13:29 -0400 | [diff] [blame] | 405 | |
| 406 | # custom_embedded has the source for both embedding a font in the binary |
| 407 | # (only used for the all-included build) and reading in a font from |
| 408 | # raw bytes passed over the wire (a typical way to load fonts). |
Kevin Lubick | b6a3b7d | 2020-01-02 08:16:51 -0500 | [diff] [blame] | 409 | if (!skia_enable_fontmgr_empty) { |
| 410 | deps += [ ":typeface_freetype" ] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 411 | sources = [ "src/ports/SkFontMgr_custom_embedded.cpp" ] |
Kevin Lubick | b6a3b7d | 2020-01-02 08:16:51 -0500 | [diff] [blame] | 412 | |
| 413 | # If we haven't opted for no fonts (empty) or fonts, but not the |
| 414 | # built-in one (custom), then, we need to provide the mechanism for |
| 415 | # using the built-in font. |
| 416 | if (!skia_enable_fontmgr_custom) { |
| 417 | sources += [ |
| 418 | "src/ports/SkFontMgr_custom.cpp", |
| 419 | "src/ports/SkFontMgr_custom.h", |
| 420 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
| 421 | ] |
| 422 | } |
Kevin Lubick | e27a503 | 2019-10-09 10:13:29 -0400 | [diff] [blame] | 423 | } |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 424 | } |
| 425 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 426 | optional("fontmgr_win") { |
| 427 | enabled = skia_enable_fontmgr_win |
| 428 | |
| 429 | sources = [ |
| 430 | "src/fonts/SkFontMgr_indirect.cpp", |
| 431 | "src/ports/SkFontMgr_win_dw.cpp", |
| 432 | "src/ports/SkFontMgr_win_dw_factory.cpp", |
| 433 | "src/ports/SkScalerContext_win_dw.cpp", |
| 434 | "src/ports/SkTypeface_win_dw.cpp", |
| 435 | ] |
| 436 | } |
| 437 | |
| 438 | optional("fontmgr_win_gdi") { |
| 439 | enabled = skia_enable_fontmgr_win_gdi |
| 440 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 441 | sources = [ "src/ports/SkFontHost_win.cpp" ] |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 442 | libs = [ "Gdi32.lib" ] |
| 443 | } |
| 444 | |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 445 | if (skia_lex) { |
Ethan Nicholas | ca82a92 | 2017-09-07 09:39:50 -0400 | [diff] [blame] | 446 | executable("sksllex") { |
| 447 | sources = [ |
| 448 | "src/sksl/lex/Main.cpp", |
| 449 | "src/sksl/lex/NFA.cpp", |
| 450 | "src/sksl/lex/RegexNode.cpp", |
| 451 | "src/sksl/lex/RegexParser.cpp", |
| 452 | ] |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 453 | include_dirs = [ "." ] |
Ethan Nicholas | ca82a92 | 2017-09-07 09:39:50 -0400 | [diff] [blame] | 454 | } |
| 455 | |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 456 | action("run_sksllex") { |
| 457 | script = "gn/run_sksllex.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 458 | deps = [ ":sksllex(//gn/toolchain:$host_toolchain)" ] |
| 459 | sources = [ "src/sksl/lex/sksl.lex" ] |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 460 | |
| 461 | # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a |
| 462 | # path that starts with target_out_dir and then uses ".." to back up into the src dir. |
| 463 | outputs = [ |
| 464 | "$target_out_dir/" + |
| 465 | rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir), |
| 466 | # the script also modifies the corresponding .cpp file, but if we tell GN that it gets |
| 467 | # confused due to the same file being named by two different paths |
| 468 | ] |
| 469 | sksllex_path = "$root_out_dir/" |
| 470 | sksllex_path += "sksllex" |
| 471 | if (host_os == "win") { |
| 472 | sksllex_path += ".exe" |
| 473 | } |
| 474 | args = [ |
| 475 | rebase_path(sksllex_path), |
| 476 | rebase_path("bin/clang-format"), |
| 477 | rebase_path("src"), |
| 478 | ] |
| 479 | } |
| 480 | } else { |
| 481 | group("run_sksllex") { |
| 482 | } |
| 483 | } |
| 484 | |
| 485 | if (skia_compile_processors) { |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 486 | executable("skslc") { |
| 487 | defines = [ "SKSL_STANDALONE" ] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 488 | sources = [ "src/sksl/SkSLMain.cpp" ] |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 489 | sources += skia_sksl_sources |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 490 | sources += skia_sksl_gpu_sources |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 491 | include_dirs = [ "." ] |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 492 | deps = [ |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 493 | ":run_sksllex", |
Stephen White | 238fc24 | 2019-08-26 10:19:23 -0400 | [diff] [blame] | 494 | "//third_party/spirv-tools:spvtools", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 495 | ] |
| 496 | } |
| 497 | |
| 498 | skia_gpu_processor_outputs = [] |
| 499 | foreach(src, skia_gpu_processor_sources) { |
| 500 | dir = get_path_info(src, "dir") |
| 501 | name = get_path_info(src, "name") |
| 502 | |
| 503 | # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a |
| 504 | # path that starts with target_out_dir and then uses ".." to back up into the src dir. |
| 505 | skia_gpu_processor_outputs += [ |
Brian Osman | f5ac199 | 2019-07-18 11:23:16 -0400 | [diff] [blame] | 506 | "$target_out_dir/" + |
| 507 | rebase_path("$dir/generated/$name.h", target_out_dir), |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 508 | # the script also modifies the corresponding .cpp file, but if we tell GN that it gets |
| 509 | # confused due to the same file being named by two different paths |
| 510 | ] |
| 511 | } |
| 512 | |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 513 | action("create_sksl_enums") { |
| 514 | script = "gn/create_sksl_enums.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 515 | sources = [ "include/private/GrSharedEnums.h" ] |
| 516 | outputs = [ "$target_out_dir/" + |
| 517 | rebase_path("src/sksl/sksl_enums.inc", target_out_dir) ] |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 518 | args = [ |
| 519 | rebase_path(sources[0]), |
| 520 | rebase_path(outputs[0]), |
| 521 | ] |
| 522 | } |
| 523 | |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 524 | action("compile_processors") { |
| 525 | script = "gn/compile_processors.py" |
| 526 | deps = [ |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 527 | ":create_sksl_enums", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 528 | ":skslc(//gn/toolchain:$host_toolchain)", |
| 529 | ] |
| 530 | sources = skia_gpu_processor_sources |
| 531 | outputs = skia_gpu_processor_outputs |
| 532 | skslc_path = "$root_out_dir/" |
| 533 | if (host_toolchain != default_toolchain_name) { |
| 534 | skslc_path += "$host_toolchain/" |
| 535 | } |
| 536 | skslc_path += "skslc" |
| 537 | if (host_os == "win") { |
| 538 | skslc_path += ".exe" |
| 539 | } |
Ethan Nicholas | b9f6afb | 2017-07-27 16:02:37 -0400 | [diff] [blame] | 540 | args = [ |
| 541 | rebase_path(skslc_path), |
Eric Boren | b121be7 | 2017-07-28 10:00:51 -0400 | [diff] [blame] | 542 | rebase_path("bin/clang-format"), |
Ethan Nicholas | b9f6afb | 2017-07-27 16:02:37 -0400 | [diff] [blame] | 543 | ] |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 544 | args += rebase_path(skia_gpu_processor_sources) |
| 545 | } |
| 546 | } else { |
| 547 | skia_gpu_processor_outputs = [] |
| 548 | group("compile_processors") { |
| 549 | } |
| 550 | } |
| 551 | |
Ben Wagner | e27ee6c | 2019-02-15 14:59:30 -0500 | [diff] [blame] | 552 | optional("gpu") { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 553 | enabled = skia_enable_gpu |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 554 | deps = [ |
| 555 | ":compile_processors", |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 556 | ":run_sksllex", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 557 | ] |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 558 | if (skia_generate_workarounds) { |
| 559 | deps += [ ":workaround_list" ] |
| 560 | } |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 561 | public_defines = [] |
Chris Dalton | 3a67b8e | 2018-05-03 09:30:29 -0600 | [diff] [blame] | 562 | public_configs = [] |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 563 | public_deps = [] |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 564 | |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 565 | sources = |
| 566 | skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs |
Kevin Lubick | 93faa67 | 2018-10-10 15:54:53 -0400 | [diff] [blame] | 567 | if (!skia_enable_ccpr) { |
| 568 | sources -= skia_ccpr_sources |
| 569 | sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ] |
| 570 | } |
Kevin Lubick | 4bf2c26 | 2018-10-15 09:35:54 -0400 | [diff] [blame] | 571 | if (!skia_enable_nvpr) { |
| 572 | sources -= skia_nvpr_sources |
| 573 | sources += [ "src/gpu/GrPathRendering_none.cpp" ] |
| 574 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 575 | |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 576 | libs = [] |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 577 | |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 578 | if (skia_use_gl) { |
| 579 | public_defines += [ "SK_GL" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 580 | if (is_android) { |
| 581 | sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ] |
| 582 | |
| 583 | # this lib is required to link against AHardwareBuffer |
| 584 | if (defined(ndk_api) && ndk_api >= 26) { |
| 585 | libs += [ "android" ] |
| 586 | } |
| 587 | } else if (skia_use_egl) { |
| 588 | sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ] |
| 589 | libs += [ "EGL" ] |
| 590 | } else if (is_linux && skia_use_x11) { |
| 591 | sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ] |
| 592 | libs += [ "GL" ] |
| 593 | } else if (is_mac) { |
| 594 | sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ] |
| 595 | } else if (is_ios) { |
| 596 | sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ] |
| 597 | } else if (is_win) { |
| 598 | sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ] |
| 599 | if (target_cpu != "arm64") { |
| 600 | libs += [ "OpenGL32.lib" ] |
| 601 | } |
| 602 | } else { |
| 603 | sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ] |
| 604 | } |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 605 | sources += skia_gl_gpu_sources |
| 606 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 607 | |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 608 | if (skia_use_vulkan) { |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 609 | public_defines += [ "SK_VULKAN" ] |
Greg Daniel | b16beb9 | 2020-04-27 14:26:21 +0000 | [diff] [blame] | 610 | if (skia_use_vma) { |
| 611 | deps += [ "third_party/vulkanmemoryallocator" ] |
| 612 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 613 | sources += skia_vk_sources |
egdaniel | e4a9bd7 | 2016-09-21 07:36:14 -0700 | [diff] [blame] | 614 | if (skia_enable_vulkan_debug_layers) { |
| 615 | public_defines += [ "SK_ENABLE_VK_LAYERS" ] |
| 616 | } |
Craig Stout | cb6b4bd | 2018-12-13 10:20:07 -0800 | [diff] [blame] | 617 | if (is_fuchsia) { |
John Rosasco | e57ca49 | 2019-11-13 14:30:45 -0800 | [diff] [blame] | 618 | if (using_fuchsia_sdk) { |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 619 | public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ] |
| 620 | } else { |
Brian Osman | 489cf88 | 2019-07-09 10:48:28 -0400 | [diff] [blame] | 621 | public_deps += [ "//src/graphics/lib/vulkan" ] |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 622 | } |
Craig Stout | cb6b4bd | 2018-12-13 10:20:07 -0800 | [diff] [blame] | 623 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 624 | } |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 625 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 626 | if (is_android && (skia_use_gl || skia_use_vulkan)) { |
| 627 | # this lib is required to link against AHardwareBuffer |
| 628 | if (defined(ndk_api) && ndk_api >= 26) { |
| 629 | libs += [ "android" ] |
| 630 | } |
| 631 | } |
| 632 | |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 633 | if (skia_use_dawn) { |
| 634 | public_defines += [ "SK_DAWN" ] |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 635 | sources += skia_dawn_sources |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 636 | public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ] |
Stephen White | fbffb99 | 2019-10-17 10:32:40 -0400 | [diff] [blame] | 637 | deps += [ |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 638 | "//third_party/externals/dawn/src/dawn:dawn_proc", |
| 639 | "//third_party/externals/dawn/src/dawn:dawncpp", |
| 640 | "//third_party/externals/dawn/src/dawn_native", |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 641 | ] |
| 642 | if (dawn_enable_d3d12) { |
| 643 | libs += [ |
| 644 | "d3d12.lib", |
| 645 | "dxgi.lib", |
| 646 | "d3dcompiler.lib", |
| 647 | ] |
| 648 | } else if (dawn_enable_metal) { |
| 649 | libs += [ "Metal.framework" ] |
| 650 | } |
| 651 | } |
| 652 | |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 653 | if (skia_use_direct3d) { |
| 654 | public_defines += [ "SK_DIRECT3D" ] |
Brian Osman | c024391 | 2020-02-19 15:35:26 -0500 | [diff] [blame] | 655 | deps += [ "//third_party/spirv-cross:spirv_cross" ] |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 656 | sources += skia_direct3d_sources |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 657 | if (skia_enable_direct3d_debug_layer) { |
| 658 | public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ] |
| 659 | } |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 660 | libs += [ |
| 661 | "d3d12.lib", |
| 662 | "dxgi.lib", |
| 663 | "d3dcompiler.lib", |
| 664 | ] |
| 665 | } |
| 666 | |
Greg Daniel | 6b7e0e2 | 2017-07-12 16:21:09 -0400 | [diff] [blame] | 667 | cflags_objcc = [] |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 668 | if (skia_use_metal) { |
| 669 | public_defines += [ "SK_METAL" ] |
| 670 | sources += skia_metal_sources |
| 671 | libs += [ "Metal.framework" ] |
Jim Van Verth | 9187e49 | 2019-11-11 16:14:13 -0500 | [diff] [blame] | 672 | libs += [ "MetalKit.framework" ] |
Greg Daniel | 53956d9 | 2018-08-08 14:41:19 -0400 | [diff] [blame] | 673 | libs += [ "Foundation.framework" ] |
Greg Daniel | 6b7e0e2 | 2017-07-12 16:21:09 -0400 | [diff] [blame] | 674 | cflags_objcc += [ "-fobjc-arc" ] |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 675 | } |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 676 | |
Kevin Lubick | f4def34 | 2018-10-04 12:52:50 -0400 | [diff] [blame] | 677 | if (is_debug) { |
| 678 | public_defines += [ "SK_ENABLE_DUMP_GPU" ] |
| 679 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 680 | } |
| 681 | |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 682 | optional("gif") { |
Hal Canary | 2dad990 | 2019-11-20 16:01:31 -0500 | [diff] [blame] | 683 | enabled = !skia_use_wuffs && skia_use_libgifcodec |
Hal Canary | 1ec9a28 | 2019-11-21 10:15:50 -0500 | [diff] [blame] | 684 | _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni" |
| 685 | if ("True" == |
| 686 | exec_script("gn/checkpath.py", |
| 687 | [ rebase_path(_libgifcodec_gni_path, root_build_dir) ], |
| 688 | "trim string")) { |
| 689 | public_defines = [ "SK_USE_LIBGIFCODEC" ] |
| 690 | public_include_dirs = [ |
| 691 | ".", |
| 692 | skia_libgifcodec_path, |
| 693 | ] |
| 694 | include_dirs = public_include_dirs |
| 695 | import(_libgifcodec_gni_path) |
| 696 | sources = rebase_path(libgifcodec_sources + libgifcodec_public, |
| 697 | ".", |
| 698 | skia_libgifcodec_path) |
| 699 | } |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 700 | } |
| 701 | |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 702 | optional("heif") { |
| 703 | enabled = skia_use_libheif |
| 704 | public_defines = [ "SK_HAS_HEIF_LIBRARY" ] |
| 705 | |
| 706 | deps = [] |
| 707 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 708 | sources = [ "src/codec/SkHeifCodec.cpp" ] |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 709 | } |
| 710 | |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 711 | optional("jpeg_decode") { |
| 712 | enabled = skia_use_libjpeg_turbo_decode |
| 713 | public_defines = [ "SK_CODEC_DECODES_JPEG" ] |
| 714 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 715 | deps = [ "//third_party/libjpeg-turbo:libjpeg" ] |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 716 | sources = [ |
| 717 | "src/codec/SkJpegCodec.cpp", |
| 718 | "src/codec/SkJpegDecoderMgr.cpp", |
| 719 | "src/codec/SkJpegUtility.cpp", |
| 720 | ] |
| 721 | } |
| 722 | |
| 723 | optional("jpeg_encode") { |
| 724 | enabled = skia_use_libjpeg_turbo_encode |
| 725 | public_defines = [ "SK_ENCODE_JPEG" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 726 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 727 | deps = [ "//third_party/libjpeg-turbo:libjpeg" ] |
| 728 | public = [ "include/encode/SkJpegEncoder.h" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 729 | sources = [ |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 730 | "src/images/SkJPEGWriteUtility.cpp", |
Matt Sarett | 04c3731 | 2017-05-05 14:02:13 -0400 | [diff] [blame] | 731 | "src/images/SkJpegEncoder.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 732 | ] |
| 733 | } |
| 734 | |
| 735 | optional("pdf") { |
Hal Canary | 43fb7a0 | 2016-12-30 13:09:03 -0500 | [diff] [blame] | 736 | enabled = skia_use_zlib && skia_enable_pdf |
| 737 | public_defines = [ "SK_SUPPORT_PDF" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 738 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 739 | deps = [ "//third_party/zlib" ] |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 740 | if (skia_use_libjpeg_turbo_decode) { |
| 741 | deps += [ ":jpeg_decode" ] |
| 742 | } |
| 743 | if (skia_use_libjpeg_turbo_encode) { |
| 744 | deps += [ ":jpeg_encode" ] |
Hal Canary | 83e0f1b | 2018-04-05 16:58:41 -0400 | [diff] [blame] | 745 | } |
Robert Phillips | 9b00f1f | 2020-03-24 12:29:44 -0400 | [diff] [blame] | 746 | public = skia_pdf_public |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 747 | sources = skia_pdf_sources |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 748 | sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] |
Hal Canary | 2a3093c | 2019-02-20 11:25:45 -0500 | [diff] [blame] | 749 | if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) { |
| 750 | deps += [ "//third_party/harfbuzz" ] |
| 751 | defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ] |
| 752 | } else if (skia_use_icu && skia_use_sfntly) { |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 753 | deps += [ "//third_party/sfntly" ] |
Hal Canary | 32498f0 | 2019-02-04 15:36:31 -0500 | [diff] [blame] | 754 | defines = [ "SK_PDF_USE_SFNTLY" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 755 | } |
| 756 | } |
| 757 | |
Robert Phillips | 9b00f1f | 2020-03-24 12:29:44 -0400 | [diff] [blame] | 758 | optional("xps") { |
| 759 | enabled = skia_use_xps && is_win |
| 760 | public_defines = [ "SK_SUPPORT_XPS" ] |
| 761 | public = skia_xps_public |
| 762 | sources = skia_xps_sources |
| 763 | } |
| 764 | |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 765 | optional("png_decode") { |
| 766 | enabled = skia_use_libpng_decode |
| 767 | public_defines = [ "SK_CODEC_DECODES_PNG" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 768 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 769 | deps = [ "//third_party/libpng" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 770 | sources = [ |
| 771 | "src/codec/SkIcoCodec.cpp", |
| 772 | "src/codec/SkPngCodec.cpp", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 773 | ] |
| 774 | } |
| 775 | |
| 776 | optional("png_encode") { |
| 777 | enabled = skia_use_libpng_encode |
| 778 | public_defines = [ "SK_ENCODE_PNG" ] |
| 779 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 780 | deps = [ "//third_party/libpng" ] |
| 781 | sources = [ "src/images/SkPngEncoder.cpp" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 782 | } |
| 783 | |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 784 | optional("raw") { |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 785 | enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 786 | public_defines = [ "SK_CODEC_DECODES_RAW" ] |
| 787 | |
| 788 | deps = [ |
| 789 | "//third_party/dng_sdk", |
| 790 | "//third_party/libjpeg-turbo:libjpeg", |
| 791 | "//third_party/piex", |
| 792 | ] |
| 793 | |
| 794 | # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of |
| 795 | # Skia. |
| 796 | configs_to_remove = [ "//gn:no_exceptions" ] |
| 797 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 798 | sources = [ "src/codec/SkRawCodec.cpp" ] |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 799 | } |
| 800 | |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 801 | import("third_party/skcms/skcms.gni") |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 802 | source_set("skcms") { |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 803 | cflags = [] |
| 804 | if (!is_win || is_clang) { |
| 805 | cflags += [ |
| 806 | "-w", |
| 807 | "-std=c11", |
| 808 | ] |
| 809 | } |
| 810 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 811 | public = [ "include/third_party/skcms/skcms.h" ] |
Brian Osman | ea236bf | 2019-04-29 10:28:22 -0400 | [diff] [blame] | 812 | include_dirs = [ "include/third_party/skcms" ] |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 813 | sources = rebase_path(skcms_sources, ".", "third_party/skcms") |
| 814 | } |
| 815 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 816 | optional("typeface_freetype") { |
| 817 | enabled = skia_use_freetype |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 818 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 819 | deps = [ "//third_party/freetype2" ] |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 820 | sources = [ |
| 821 | "src/ports/SkFontHost_FreeType.cpp", |
| 822 | "src/ports/SkFontHost_FreeType_common.cpp", |
| 823 | ] |
| 824 | } |
| 825 | |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 826 | optional("webp_decode") { |
| 827 | enabled = skia_use_libwebp_decode |
| 828 | public_defines = [ "SK_CODEC_DECODES_WEBP" ] |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 829 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 830 | deps = [ "//third_party/libwebp" ] |
| 831 | sources = [ "src/codec/SkWebpCodec.cpp" ] |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 832 | } |
| 833 | |
| 834 | optional("webp_encode") { |
| 835 | enabled = skia_use_libwebp_encode |
| 836 | public_defines = [ "SK_ENCODE_WEBP" ] |
| 837 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 838 | deps = [ "//third_party/libwebp" ] |
| 839 | sources = [ "src/images/SkWebpEncoder.cpp" ] |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 840 | } |
| 841 | |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 842 | optional("wuffs") { |
| 843 | enabled = skia_use_wuffs |
| 844 | public_defines = [ "SK_HAS_WUFFS_LIBRARY" ] |
| 845 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 846 | deps = [ "//third_party/wuffs" ] |
| 847 | sources = [ "src/codec/SkWuffsCodec.cpp" ] |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 848 | } |
| 849 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 850 | optional("xml") { |
| 851 | enabled = skia_use_expat |
Florin Malita | 442fff9 | 2016-11-08 16:07:52 +0000 | [diff] [blame] | 852 | public_defines = [ "SK_XML" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 853 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 854 | deps = [ "//third_party/expat" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 855 | sources = [ |
Mike Klein | bd41bcc | 2017-02-09 16:38:15 -0500 | [diff] [blame] | 856 | "src/svg/SkSVGCanvas.cpp", |
| 857 | "src/svg/SkSVGDevice.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 858 | "src/xml/SkDOM.cpp", |
| 859 | "src/xml/SkXMLParser.cpp", |
| 860 | "src/xml/SkXMLWriter.cpp", |
| 861 | ] |
| 862 | } |
| 863 | |
Brian Osman | 489cf88 | 2019-07-09 10:48:28 -0400 | [diff] [blame] | 864 | optional("sksl_interpreter") { |
| 865 | enabled = skia_enable_sksl_interpreter |
| 866 | public_defines = [ "SK_ENABLE_SKSL_INTERPRETER" ] |
| 867 | } |
| 868 | |
Mike Klein | 613ad38 | 2019-06-06 11:42:02 -0500 | [diff] [blame] | 869 | optional("skvm_jit") { |
Mike Klein | 6bbeb4a | 2019-06-21 16:34:06 -0500 | [diff] [blame] | 870 | enabled = skia_enable_skvm_jit |
Mike Klein | 613ad38 | 2019-06-06 11:42:02 -0500 | [diff] [blame] | 871 | public_defines = [ "SKVM_JIT" ] |
Mike Klein | 613ad38 | 2019-06-06 11:42:02 -0500 | [diff] [blame] | 872 | } |
| 873 | |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 874 | if (skia_enable_gpu && skia_generate_workarounds) { |
| 875 | action("workaround_list") { |
| 876 | script = "tools/build_workaround_header.py" |
| 877 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 878 | inputs = [ "src/gpu/gpu_workaround_list.txt" ] |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 879 | |
| 880 | # see comments in skia_compile_processors about out dir path shenanigans. |
| 881 | output_file = |
Adrienne Walker | ab7181d | 2018-05-14 14:02:03 -0700 | [diff] [blame] | 882 | rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir) |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 883 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 884 | outputs = [ "$root_out_dir/$output_file" ] |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 885 | args = [ |
| 886 | "--output-file", |
| 887 | "$output_file", |
| 888 | ] |
| 889 | |
| 890 | foreach(file, inputs) { |
| 891 | args += [ rebase_path(file, root_build_dir) ] |
| 892 | } |
| 893 | } |
| 894 | } |
| 895 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 896 | component("skia") { |
| 897 | public_configs = [ ":skia_public" ] |
| 898 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 899 | |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 900 | public_deps = [ |
Ben Wagner | e27ee6c | 2019-02-15 14:59:30 -0500 | [diff] [blame] | 901 | ":gpu", |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 902 | ":pdf", |
| 903 | ":skcms", |
Robert Phillips | 9b00f1f | 2020-03-24 12:29:44 -0400 | [diff] [blame] | 904 | ":xps", |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 905 | ] |
| 906 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 907 | deps = [ |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 908 | ":android_utils", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 909 | ":arm64", |
| 910 | ":armv7", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 911 | ":avx", |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 912 | ":compile_processors", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 913 | ":crc32", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 914 | ":fontmgr_android", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 915 | ":fontmgr_custom", |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 916 | ":fontmgr_custom_empty", |
Hal Canary | ff2742e | 2018-01-30 11:35:47 -0500 | [diff] [blame] | 917 | ":fontmgr_empty", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 918 | ":fontmgr_fontconfig", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 919 | ":fontmgr_fuchsia", |
Ben Wagner | d13487e | 2020-06-03 23:29:43 -0400 | [diff] [blame] | 920 | ":fontmgr_mac", |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 921 | ":fontmgr_wasm", |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 922 | ":fontmgr_win", |
| 923 | ":fontmgr_win_gdi", |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 924 | ":gif", |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 925 | ":heif", |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 926 | ":hsw", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 927 | ":jpeg_decode", |
| 928 | ":jpeg_encode", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 929 | ":none", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 930 | ":png_decode", |
| 931 | ":png_encode", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 932 | ":raw", |
Brian Osman | 489cf88 | 2019-07-09 10:48:28 -0400 | [diff] [blame] | 933 | ":sksl_interpreter", |
Mike Klein | 613ad38 | 2019-06-06 11:42:02 -0500 | [diff] [blame] | 934 | ":skvm_jit", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 935 | ":sse2", |
| 936 | ":sse41", |
| 937 | ":sse42", |
| 938 | ":ssse3", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 939 | ":webp_decode", |
| 940 | ":webp_encode", |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 941 | ":wuffs", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 942 | ":xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 943 | ] |
| 944 | |
Chinmay Garde | 43f115c | 2016-11-16 15:04:12 -0800 | [diff] [blame] | 945 | # This file (and all GN files in Skia) are designed to work with an |
| 946 | # empty sources assignment filter; we handle all that explicitly. |
| 947 | # We clear the filter here for clients who may have set up a global filter. |
| 948 | set_sources_assignment_filter([]) |
| 949 | |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 950 | public = skia_core_public |
| 951 | public += skia_utils_public |
| 952 | public += skia_effects_public |
| 953 | public += skia_effects_imagefilter_public |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 954 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 955 | sources = [] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 956 | sources += skia_core_sources |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 957 | sources += skia_utils_sources |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 958 | sources += skia_effects_sources |
| 959 | sources += skia_effects_imagefilter_sources |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 960 | sources += skia_sksl_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 961 | sources += [ |
Stan Iliev | 73d8fd9 | 2017-08-02 15:36:24 -0400 | [diff] [blame] | 962 | "src/android/SkAndroidFrameworkUtils.cpp", |
Leon Scroggins III | 42ee284 | 2018-01-14 14:46:51 -0500 | [diff] [blame] | 963 | "src/android/SkAnimatedImage.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 964 | "src/codec/SkAndroidCodec.cpp", |
Nigel Tao | 612a65d | 2018-11-09 10:10:31 +1100 | [diff] [blame] | 965 | "src/codec/SkAndroidCodecAdapter.cpp", |
Leon Scroggins III | d81fed9 | 2017-06-01 13:42:28 -0400 | [diff] [blame] | 966 | "src/codec/SkBmpBaseCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 967 | "src/codec/SkBmpCodec.cpp", |
| 968 | "src/codec/SkBmpMaskCodec.cpp", |
| 969 | "src/codec/SkBmpRLECodec.cpp", |
| 970 | "src/codec/SkBmpStandardCodec.cpp", |
| 971 | "src/codec/SkCodec.cpp", |
| 972 | "src/codec/SkCodecImageGenerator.cpp", |
Leon Scroggins III | 22f673d | 2018-05-30 15:33:46 -0400 | [diff] [blame] | 973 | "src/codec/SkColorTable.cpp", |
Leon Scroggins III | 36f7e32 | 2018-08-27 11:55:46 -0400 | [diff] [blame] | 974 | "src/codec/SkEncodedInfo.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 975 | "src/codec/SkMaskSwizzler.cpp", |
| 976 | "src/codec/SkMasks.cpp", |
Leon Scroggins III | ba45830 | 2019-09-24 12:40:11 -0400 | [diff] [blame] | 977 | "src/codec/SkParseEncodedOrigin.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 978 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 979 | "src/codec/SkSampler.cpp", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 980 | "src/codec/SkStreamBuffer.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 981 | "src/codec/SkSwizzler.cpp", |
| 982 | "src/codec/SkWbmpCodec.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 983 | "src/images/SkImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 984 | "src/ports/SkDiscardableMemory_none.cpp", |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 985 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 986 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 987 | "src/ports/SkMemory_malloc.cpp", |
| 988 | "src/ports/SkOSFile_stdio.cpp", |
| 989 | "src/sfnt/SkOTTable_name.cpp", |
| 990 | "src/sfnt/SkOTUtils.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 991 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 992 | |
Kevin Lubick | 32dfdbe | 2018-10-18 09:47:01 -0400 | [diff] [blame] | 993 | defines = [] |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 994 | libs = [] |
| 995 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 996 | if (is_win) { |
| 997 | sources += [ |
| 998 | "src/ports/SkDebug_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 999 | "src/ports/SkImageEncoder_WIC.cpp", |
| 1000 | "src/ports/SkImageGeneratorWIC.cpp", |
| 1001 | "src/ports/SkOSFile_win.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 1002 | "src/ports/SkOSLibrary_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1003 | ] |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 1004 | libs += [ |
| 1005 | "FontSub.lib", |
| 1006 | "Ole32.lib", |
| 1007 | "OleAut32.lib", |
| 1008 | "User32.lib", |
Mike Klein | 0c5fdcb | 2017-11-13 12:40:46 -0500 | [diff] [blame] | 1009 | "Usp10.lib", |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 1010 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1011 | } else { |
| 1012 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1013 | "src/ports/SkOSFile_posix.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 1014 | "src/ports/SkOSLibrary_posix.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1015 | ] |
Ben Wagner | be6ae5b | 2017-08-31 16:45:23 -0400 | [diff] [blame] | 1016 | libs += [ "dl" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1017 | } |
| 1018 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1019 | if (is_android) { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 1020 | deps += [ "//third_party/expat" ] |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 1021 | if (defined(ndk) && ndk != "") { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 1022 | deps += [ "//third_party/cpu-features" ] |
| 1023 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1024 | sources += [ "src/ports/SkDebug_android.cpp" ] |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1025 | libs += [ |
| 1026 | "EGL", |
| 1027 | "GLESv2", |
| 1028 | "log", |
| 1029 | ] |
| 1030 | } |
| 1031 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1032 | if (is_linux || target_cpu == "wasm") { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1033 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
Hal Canary | 25375e8 | 2018-03-14 15:16:56 -0400 | [diff] [blame] | 1034 | if (skia_use_egl) { |
| 1035 | libs += [ "GLESv2" ] |
| 1036 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1037 | } |
| 1038 | |
| 1039 | if (is_mac) { |
| 1040 | sources += [ |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1041 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1042 | "src/ports/SkImageEncoder_CG.cpp", |
| 1043 | "src/ports/SkImageGeneratorCG.cpp", |
| 1044 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 1045 | libs += [ |
| 1046 | "ApplicationServices.framework", |
| 1047 | "OpenGL.framework", |
| 1048 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1049 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1050 | |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1051 | if (is_ios) { |
| 1052 | sources += [ |
| 1053 | "src/ports/SkDebug_stdio.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1054 | "src/ports/SkImageEncoder_CG.cpp", |
| 1055 | "src/ports/SkImageGeneratorCG.cpp", |
| 1056 | ] |
| 1057 | libs += [ |
| 1058 | "CoreFoundation.framework", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1059 | "ImageIO.framework", |
| 1060 | "MobileCoreServices.framework", |
| 1061 | ] |
| 1062 | } |
| 1063 | |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1064 | if (is_fuchsia) { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1065 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1066 | } |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 1067 | |
| 1068 | if (skia_enable_spirv_validation) { |
Stephen White | 238fc24 | 2019-08-26 10:19:23 -0400 | [diff] [blame] | 1069 | deps += [ "//third_party/spirv-tools:spvtools_val" ] |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 1070 | defines += [ "SK_ENABLE_SPIRV_VALIDATION" ] |
| 1071 | } |
Nathaniel Nifong | 0c4fbf1 | 2019-06-25 15:48:47 -0400 | [diff] [blame] | 1072 | |
| 1073 | if (skia_include_multiframe_procs) { |
| 1074 | sources += [ "tools/SkSharingProc.cpp" ] |
| 1075 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1076 | } |
| 1077 | |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1078 | # DebugCanvas used in experimental/wasm-skp-debugger |
| 1079 | if (target_cpu == "wasm") { |
| 1080 | static_library("debugcanvas") { |
| 1081 | public_configs = [ ":skia_public" ] |
| 1082 | |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1083 | sources = [ |
Nathaniel Nifong | 0426c38 | 2019-06-21 11:09:19 -0400 | [diff] [blame] | 1084 | "tools/SkSharingProc.cpp", |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1085 | "tools/UrlDataManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1086 | "tools/debugger/DebugCanvas.cpp", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 1087 | "tools/debugger/DebugLayerManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1088 | "tools/debugger/DrawCommand.cpp", |
| 1089 | "tools/debugger/JsonWriteBuffer.cpp", |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1090 | ] |
| 1091 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1092 | deps = [ ":fontmgr_wasm" ] |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1093 | } |
| 1094 | } |
| 1095 | |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1096 | static_library("pathkit") { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1097 | check_includes = false |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1098 | public_configs = [ ":skia_public" ] |
| 1099 | configs += skia_library_configs |
| 1100 | |
| 1101 | deps = [ |
| 1102 | ":arm64", |
| 1103 | ":armv7", |
| 1104 | ":avx", |
| 1105 | ":crc32", |
| 1106 | ":hsw", |
| 1107 | ":none", |
| 1108 | ":sse2", |
| 1109 | ":sse41", |
| 1110 | ":sse42", |
| 1111 | ":ssse3", |
| 1112 | ] |
| 1113 | |
| 1114 | # This file (and all GN files in Skia) are designed to work with an |
| 1115 | # empty sources assignment filter; we handle all that explicitly. |
| 1116 | # We clear the filter here for clients who may have set up a global filter. |
| 1117 | set_sources_assignment_filter([]) |
| 1118 | |
| 1119 | sources = [] |
| 1120 | sources += skia_pathops_sources |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1121 | sources += skia_pathops_public |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1122 | sources += [ |
| 1123 | "src/core/SkAnalyticEdge.cpp", |
| 1124 | "src/core/SkArenaAlloc.cpp", |
Mike Reed | cc88f3a | 2019-02-06 11:40:27 -0500 | [diff] [blame] | 1125 | "src/core/SkContourMeasure.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1126 | "src/core/SkCubicMap.cpp", |
| 1127 | "src/core/SkEdge.cpp", |
| 1128 | "src/core/SkEdgeBuilder.cpp", |
| 1129 | "src/core/SkEdgeClipper.cpp", |
| 1130 | "src/core/SkGeometry.cpp", |
Brian Salomon | 71fe945 | 2020-03-02 16:59:40 -0500 | [diff] [blame] | 1131 | "src/core/SkIDChangeListener.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1132 | "src/core/SkLineClipper.cpp", |
Hal Canary | 7823aeb | 2019-10-30 17:26:45 -0400 | [diff] [blame] | 1133 | "src/core/SkMalloc.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1134 | "src/core/SkMallocPixelRef.cpp", |
| 1135 | "src/core/SkMath.cpp", |
| 1136 | "src/core/SkMatrix.cpp", |
| 1137 | "src/core/SkOpts.cpp", |
| 1138 | "src/core/SkPaint.cpp", |
| 1139 | "src/core/SkPath.cpp", |
| 1140 | "src/core/SkPathEffect.cpp", |
| 1141 | "src/core/SkPathMeasure.cpp", |
| 1142 | "src/core/SkPathRef.cpp", |
| 1143 | "src/core/SkPoint.cpp", |
| 1144 | "src/core/SkRRect.cpp", |
| 1145 | "src/core/SkRect.cpp", |
| 1146 | "src/core/SkSemaphore.cpp", |
| 1147 | "src/core/SkStream.cpp", |
| 1148 | "src/core/SkString.cpp", |
| 1149 | "src/core/SkStringUtils.cpp", |
| 1150 | "src/core/SkStroke.cpp", |
| 1151 | "src/core/SkStrokeRec.cpp", |
| 1152 | "src/core/SkStrokerPriv.cpp", |
| 1153 | "src/core/SkThreadID.cpp", |
| 1154 | "src/core/SkUtils.cpp", |
| 1155 | "src/effects/SkDashPathEffect.cpp", |
| 1156 | "src/effects/SkTrimPathEffect.cpp", |
| 1157 | "src/ports/SkDebug_stdio.cpp", |
| 1158 | "src/ports/SkMemory_malloc.cpp", |
| 1159 | "src/utils/SkDashPath.cpp", |
| 1160 | "src/utils/SkParse.cpp", |
| 1161 | "src/utils/SkParsePath.cpp", |
| 1162 | "src/utils/SkUTF.cpp", |
| 1163 | ] |
| 1164 | } |
| 1165 | |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1166 | group("modules") { |
| 1167 | deps = [ |
Kevin Lubick | 9663484 | 2019-03-05 14:09:24 -0500 | [diff] [blame] | 1168 | "modules/particles", |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1169 | "modules/skottie", |
Mike Reed | 63559a5 | 2020-06-02 11:34:24 -0400 | [diff] [blame] | 1170 | "modules/skparagraph", |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1171 | "modules/skshaper", |
| 1172 | ] |
| 1173 | } |
| 1174 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1175 | # Targets guarded by skia_enable_tools may use //third_party freely. |
| 1176 | if (skia_enable_tools) { |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1177 | skia_public_includes = [ |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 1178 | "client_utils/android", |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1179 | "include/android", |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1180 | "include/c", |
| 1181 | "include/codec", |
| 1182 | "include/config", |
| 1183 | "include/core", |
| 1184 | "include/docs", |
| 1185 | "include/effects", |
| 1186 | "include/encode", |
| 1187 | "include/gpu", |
| 1188 | "include/pathops", |
| 1189 | "include/ports", |
| 1190 | "include/svg", |
| 1191 | "include/utils", |
| 1192 | "include/utils/mac", |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1193 | "modules/skshaper/include", |
| 1194 | "modules/skottie/include", |
| 1195 | ] |
| 1196 | |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 1197 | # Used by gn_to_bp.py to list our public include dirs. |
| 1198 | source_set("public") { |
| 1199 | configs += [ ":skia_public" ] |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1200 | include_dirs = skia_public_includes |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 1201 | } |
| 1202 | |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1203 | config("skia.h_config") { |
| 1204 | include_dirs = [ "$target_gen_dir" ] |
| 1205 | } |
| 1206 | action("skia.h") { |
| 1207 | public_configs = [ ":skia.h_config" ] |
| 1208 | skia_h = "$target_gen_dir/skia.h" |
| 1209 | script = "gn/find_headers.py" |
Florin Malita | 6e4d95f | 2018-05-30 09:27:32 -0400 | [diff] [blame] | 1210 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1211 | args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] + |
| 1212 | [ rebase_path(skia_h, root_build_dir) ] + |
| 1213 | rebase_path(skia_public_includes) |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1214 | depfile = "$skia_h.deps" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1215 | outputs = [ skia_h ] |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1216 | } |
| 1217 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1218 | if (target_cpu == "x64") { |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1219 | executable("fiddle") { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1220 | check_includes = false |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1221 | libs = [] |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1222 | sources = [ |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1223 | "tools/fiddle/draw.cpp", |
| 1224 | "tools/fiddle/fiddle_main.cpp", |
| 1225 | ] |
Joe Gregorio | a8fabd3 | 2017-05-31 09:45:19 -0400 | [diff] [blame] | 1226 | |
| 1227 | if (skia_use_egl) { |
| 1228 | sources += [ "tools/fiddle/egl_context.cpp" ] |
Joe Gregorio | a8fabd3 | 2017-05-31 09:45:19 -0400 | [diff] [blame] | 1229 | } else { |
| 1230 | sources += [ "tools/fiddle/null_context.cpp" ] |
| 1231 | } |
Joe Gregorio | 1e735c0 | 2017-04-19 14:05:14 -0400 | [diff] [blame] | 1232 | testonly = true |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1233 | deps = [ |
Joe Gregorio | 1e735c0 | 2017-04-19 14:05:14 -0400 | [diff] [blame] | 1234 | ":flags", |
Robert Phillips | 57e0828 | 2017-11-16 14:59:48 -0500 | [diff] [blame] | 1235 | ":gpu_tool_utils", |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1236 | ":skia", |
| 1237 | ":skia.h", |
Florin Malita | 6e4d95f | 2018-05-30 09:27:32 -0400 | [diff] [blame] | 1238 | "modules/skottie", |
Florin Malita | a1dcaae | 2019-03-25 17:38:43 -0400 | [diff] [blame] | 1239 | "modules/skshaper", |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1240 | ] |
| 1241 | } |
| 1242 | } |
| 1243 | |
Mike Klein | 9e25bb9 | 2019-04-29 09:46:36 -0500 | [diff] [blame] | 1244 | config("our_vulkan_headers") { |
Mike Klein | 9e25bb9 | 2019-04-29 09:46:36 -0500 | [diff] [blame] | 1245 | include_dirs = [ "include/third_party/vulkan" ] |
| 1246 | } |
| 1247 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1248 | source_set("public_headers_warnings_check") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1249 | sources = [ "tools/public_headers_warnings_check.cpp" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1250 | configs -= [ "//gn:warnings_except_public_headers" ] |
Mike Klein | 9e25bb9 | 2019-04-29 09:46:36 -0500 | [diff] [blame] | 1251 | configs += [ ":our_vulkan_headers" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1252 | deps = [ |
| 1253 | ":skia", |
| 1254 | ":skia.h", |
| 1255 | "modules/skottie", |
Florin Malita | a1dcaae | 2019-03-25 17:38:43 -0400 | [diff] [blame] | 1256 | "modules/skshaper", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1257 | ] |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 1258 | |
| 1259 | if (skia_use_dawn) { |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 1260 | deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ] |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 1261 | } |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1262 | } |
| 1263 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1264 | template("test_lib") { |
| 1265 | config(target_name + "_config") { |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 1266 | if (defined(invoker.public_defines)) { |
| 1267 | defines = invoker.public_defines |
| 1268 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1269 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1270 | source_set(target_name) { |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1271 | forward_variables_from(invoker, "*", []) |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1272 | check_includes = false |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1273 | public_configs = [ |
| 1274 | ":" + target_name + "_config", |
| 1275 | ":skia_private", |
| 1276 | ] |
| 1277 | |
| 1278 | if (!defined(deps)) { |
| 1279 | deps = [] |
| 1280 | } |
| 1281 | deps += [ ":skia" ] |
| 1282 | testonly = true |
| 1283 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1284 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1285 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1286 | template("test_app") { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1287 | if (is_ios) { |
Hal Canary | 3388c1a | 2019-09-16 12:53:17 -0400 | [diff] [blame] | 1288 | ios_app_bundle(target_name) { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1289 | forward_variables_from(invoker, |
| 1290 | "*", |
| 1291 | [ |
| 1292 | "output_name", |
| 1293 | "visibility", |
| 1294 | "is_shared_library", |
| 1295 | ]) |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1296 | testonly = true |
Hal Canary | 3388c1a | 2019-09-16 12:53:17 -0400 | [diff] [blame] | 1297 | extra_configs = [ ":skia_private" ] |
| 1298 | launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard" |
| 1299 | data_sources = [ "resources" ] |
| 1300 | if ("True" == exec_script("//gn/checkdir.py", |
| 1301 | [ rebase_path("skps", root_build_dir) ], |
| 1302 | "trim string")) { |
| 1303 | data_sources += [ "skps" ] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1304 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1305 | } |
| 1306 | } else { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1307 | # !is_ios |
| 1308 | |
Jim Van Verth | 92411c7 | 2020-04-03 15:18:31 -0400 | [diff] [blame] | 1309 | output_dir = root_build_dir |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1310 | if (defined(invoker.is_shared_library) && invoker.is_shared_library) { |
| 1311 | shared_library("lib" + target_name) { |
| 1312 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 1313 | configs += [ ":skia_private" ] |
| 1314 | testonly = true |
| 1315 | } |
| 1316 | } else { |
| 1317 | _executable = target_name |
| 1318 | executable(_executable) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1319 | check_includes = false |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1320 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 1321 | configs += [ ":skia_private" ] |
| 1322 | testonly = true |
| 1323 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1324 | } |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1325 | if (is_android && skia_android_serial != "" && defined(_executable)) { |
| 1326 | action("push_" + target_name) { |
| 1327 | script = "gn/push_to_android.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1328 | deps = [ ":" + _executable ] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1329 | _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1330 | outputs = [ _stamp ] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1331 | args = [ |
| 1332 | rebase_path("$root_build_dir/$_executable"), |
| 1333 | skia_android_serial, |
| 1334 | rebase_path(_stamp), |
| 1335 | ] |
| 1336 | testonly = true |
| 1337 | } |
Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame] | 1338 | } |
| 1339 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1340 | } |
| 1341 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1342 | test_lib("gpu_tool_utils") { |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1343 | public_defines = [] |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 1344 | |
Mike Klein | 9e25bb9 | 2019-04-29 09:46:36 -0500 | [diff] [blame] | 1345 | # Bots and even devs may not have Vulkan headers, so put |
| 1346 | # include/third_party/vulkan on our path so they're always available. |
| 1347 | all_dependent_configs = [ ":our_vulkan_headers" ] |
| 1348 | |
Mike Klein | 333fb45 | 2019-04-24 08:48:11 -0500 | [diff] [blame] | 1349 | defines = [] |
| 1350 | if (skia_enable_discrete_gpu) { |
| 1351 | defines += [ "SK_ENABLE_DISCRETE_GPU" ] |
| 1352 | } |
| 1353 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1354 | deps = [] |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1355 | public_deps = [] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1356 | sources = [ |
| 1357 | "tools/gpu/GrContextFactory.cpp", |
| 1358 | "tools/gpu/GrTest.cpp", |
Brian Salomon | 00a5eb8 | 2018-07-11 15:32:05 -0400 | [diff] [blame] | 1359 | "tools/gpu/MemoryCache.cpp", |
| 1360 | "tools/gpu/MemoryCache.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1361 | "tools/gpu/ProxyUtils.cpp", |
| 1362 | "tools/gpu/TestContext.cpp", |
Brian Salomon | e21af50 | 2019-11-22 16:56:36 -0500 | [diff] [blame] | 1363 | "tools/gpu/TestOps.cpp", |
| 1364 | "tools/gpu/TestOps.h", |
Michael Ludwig | d9958f8 | 2019-03-21 13:08:36 -0400 | [diff] [blame] | 1365 | "tools/gpu/YUVUtils.cpp", |
| 1366 | "tools/gpu/YUVUtils.h", |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1367 | "tools/gpu/gl/GLTestContext.cpp", # See comment below about |
| 1368 | # GrContextFactory workaround. |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1369 | "tools/gpu/mock/MockTestContext.cpp", |
| 1370 | ] |
Brian Salomon | 1171d31 | 2020-03-19 08:47:44 -0400 | [diff] [blame] | 1371 | |
| 1372 | libs = [] |
| 1373 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1374 | if (skia_use_gl) { |
Herb Derby | 64aa513 | 2020-06-03 12:14:55 -0400 | [diff] [blame] | 1375 | sources += |
| 1376 | [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1377 | if (is_ios) { |
| 1378 | sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ] |
| 1379 | libs += [ "OpenGLES.framework" ] |
| 1380 | } else if (is_mac) { |
| 1381 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
Brian Osman | 0c75727 | 2018-12-10 10:27:26 -0500 | [diff] [blame] | 1382 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1383 | if (skia_use_angle) { |
| 1384 | deps += [ "//third_party/angle2" ] |
| 1385 | sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ] |
| 1386 | } |
Brian Salomon | 1171d31 | 2020-03-19 08:47:44 -0400 | [diff] [blame] | 1387 | } |
| 1388 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1389 | # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in |
| 1390 | # in GrContextFactory. This only matters for OSes that can run Vulkan. |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1391 | if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") { |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1392 | if (is_android || skia_use_egl) { |
| 1393 | sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] |
| 1394 | libs += [ "EGL" ] |
| 1395 | } else if (is_linux) { |
| 1396 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
| 1397 | libs += [ |
| 1398 | "GLU", |
| 1399 | "GL", |
| 1400 | "X11", |
| 1401 | ] |
| 1402 | } else if (is_win) { |
| 1403 | sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ] |
| 1404 | libs += [ "Gdi32.lib" ] |
| 1405 | if (target_cpu != "arm64") { |
| 1406 | libs += [ "OpenGL32.lib" ] |
| 1407 | } |
| 1408 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1409 | } |
Greg Daniel | 54200e4 | 2018-12-11 17:03:39 -0500 | [diff] [blame] | 1410 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1411 | if (skia_use_vulkan) { |
| 1412 | sources += [ "tools/gpu/vk/VkTestContext.cpp" ] |
| 1413 | sources += [ "tools/gpu/vk/VkTestUtils.cpp" ] |
| 1414 | } |
| 1415 | if (skia_use_metal) { |
| 1416 | sources += [ "tools/gpu/mtl/MtlTestContext.mm" ] |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 1417 | } |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 1418 | if (skia_use_direct3d) { |
| 1419 | sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ] |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 1420 | sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ] |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 1421 | } |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 1422 | if (skia_use_dawn) { |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 1423 | public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ] |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 1424 | sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ] |
Stephen White | 3ae5b29 | 2020-06-01 15:45:56 -0400 | [diff] [blame] | 1425 | if (is_clang) { |
| 1426 | cflags_cc = [ "-Wno-microsoft-cast" ] |
| 1427 | } |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 1428 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1429 | |
| 1430 | if (is_fuchsia && using_fuchsia_sdk) { |
| 1431 | libs += |
| 1432 | [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] |
| 1433 | } |
| 1434 | |
| 1435 | cflags_objcc = [ "-fobjc-arc" ] |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 1436 | } # test_lib("gpu_tool_utils") |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1437 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1438 | test_lib("flags") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1439 | sources = [ "tools/flags/CommandLineFlags.cpp" ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1440 | } |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1441 | |
| 1442 | test_lib("common_flags_config") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1443 | sources = [ "tools/flags/CommonFlagsConfig.cpp" ] |
| 1444 | deps = [ ":flags" ] |
| 1445 | public_deps = [ ":gpu_tool_utils" ] |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1446 | } |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1447 | test_lib("common_flags_gpu") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1448 | sources = [ "tools/flags/CommonFlagsGpu.cpp" ] |
| 1449 | deps = [ ":flags" ] |
| 1450 | public_deps = [ ":gpu_tool_utils" ] |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1451 | } |
| 1452 | test_lib("common_flags_images") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1453 | sources = [ "tools/flags/CommonFlagsImages.cpp" ] |
| 1454 | deps = [ ":flags" ] |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1455 | } |
| 1456 | test_lib("common_flags_aa") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1457 | sources = [ "tools/flags/CommonFlagsAA.cpp" ] |
| 1458 | deps = [ ":flags" ] |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1459 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1460 | |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 1461 | test_lib("trace") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1462 | deps = [ ":flags" ] |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 1463 | sources = [ |
| 1464 | "tools/trace/ChromeTracingTracer.cpp", |
| 1465 | "tools/trace/ChromeTracingTracer.h", |
| 1466 | "tools/trace/EventTracingPriv.cpp", |
| 1467 | "tools/trace/EventTracingPriv.h", |
| 1468 | "tools/trace/SkDebugfTracer.cpp", |
| 1469 | "tools/trace/SkDebugfTracer.h", |
| 1470 | ] |
| 1471 | } |
| 1472 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1473 | test_lib("tool_utils") { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1474 | sources = [ |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 1475 | "tools/AndroidSkDebugToStdOut.cpp", |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 1476 | "tools/AutoreleasePool.h", |
Robert Phillips | 9660108 | 2018-05-29 16:13:26 -0400 | [diff] [blame] | 1477 | "tools/DDLPromiseImageHelper.cpp", |
| 1478 | "tools/DDLTileHelper.cpp", |
mtklein | 0590fa5 | 2016-09-01 07:06:54 -0700 | [diff] [blame] | 1479 | "tools/LsanSuppressions.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1480 | "tools/ProcStats.cpp", |
| 1481 | "tools/Resources.cpp", |
Hal Canary | e574f1e | 2019-07-15 14:01:37 -0400 | [diff] [blame] | 1482 | "tools/SkMetaData.cpp", |
| 1483 | "tools/SkMetaData.h", |
Nathaniel Nifong | 0426c38 | 2019-06-21 11:09:19 -0400 | [diff] [blame] | 1484 | "tools/SkSharingProc.cpp", |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 1485 | "tools/ToolUtils.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1486 | "tools/UrlDataManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1487 | "tools/debugger/DebugCanvas.cpp", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 1488 | "tools/debugger/DebugLayerManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1489 | "tools/debugger/DrawCommand.cpp", |
| 1490 | "tools/debugger/JsonWriteBuffer.cpp", |
Mike Klein | 0cffcbf9 | 2019-03-20 11:08:46 -0500 | [diff] [blame] | 1491 | "tools/fonts/RandomScalerContext.cpp", |
| 1492 | "tools/fonts/TestEmptyTypeface.h", |
| 1493 | "tools/fonts/TestFontMgr.cpp", |
| 1494 | "tools/fonts/TestFontMgr.h", |
| 1495 | "tools/fonts/TestSVGTypeface.cpp", |
| 1496 | "tools/fonts/TestSVGTypeface.h", |
| 1497 | "tools/fonts/TestTypeface.cpp", |
| 1498 | "tools/fonts/TestTypeface.h", |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 1499 | "tools/fonts/ToolUtilsFont.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1500 | "tools/random_parse_path.cpp", |
Hal Canary | 4124807 | 2019-07-11 16:32:53 -0400 | [diff] [blame] | 1501 | "tools/timer/TimeUtils.h", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1502 | "tools/timer/Timer.cpp", |
| 1503 | ] |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1504 | if (target_cpu != "wasm") { |
| 1505 | sources += [ "tools/CrashHandler.cpp" ] |
| 1506 | } |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 1507 | libs = [] |
| 1508 | if (is_ios) { |
| 1509 | sources += [ "tools/ios_utils.m" ] |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 1510 | sources += [ "tools/ios_utils.h" ] |
| 1511 | if (skia_use_metal) { |
| 1512 | sources += [ "tools/AutoreleasePool.mm" ] |
| 1513 | } |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 1514 | libs += [ "Foundation.framework" ] |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 1515 | } else if (is_mac) { |
| 1516 | if (skia_use_metal) { |
| 1517 | sources += [ "tools/AutoreleasePool.mm" ] |
| 1518 | libs += [ "Foundation.framework" ] |
| 1519 | } |
Mike Klein | bf15b66 | 2019-04-15 11:32:16 -0500 | [diff] [blame] | 1520 | } else if (is_win) { |
| 1521 | libs += [ "DbgHelp.lib" ] |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 1522 | } |
Mike Klein | bf15b66 | 2019-04-15 11:32:16 -0500 | [diff] [blame] | 1523 | |
Hal Canary | fd9bcab | 2018-04-24 11:47:23 -0400 | [diff] [blame] | 1524 | defines = [] |
| 1525 | if (skia_tools_require_resources) { |
| 1526 | defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ] |
| 1527 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1528 | deps = [ |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 1529 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1530 | ":flags", |
Mike Klein | e4ad58a | 2019-03-26 09:05:52 -0500 | [diff] [blame] | 1531 | ] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1532 | public_deps = [ ":gpu_tool_utils" ] |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1533 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1534 | |
Mike Klein | e11e5c1 | 2019-04-24 12:46:06 -0500 | [diff] [blame] | 1535 | test_lib("etc1") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1536 | sources = [ "third_party/etc1/etc1.cpp" ] |
Mike Klein | e11e5c1 | 2019-04-24 12:46:06 -0500 | [diff] [blame] | 1537 | } |
| 1538 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1539 | import("gn/gm.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1540 | test_lib("gm") { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1541 | sources = gm_sources |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 1542 | if (skia_use_gl) { |
| 1543 | sources += gl_gm_sources |
| 1544 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1545 | deps = [ |
Mike Klein | e11e5c1 | 2019-04-24 12:46:06 -0500 | [diff] [blame] | 1546 | ":etc1", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 1547 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1548 | ":skia", |
| 1549 | ":tool_utils", |
Mike Reed | 2f0edd5 | 2018-05-31 14:22:30 -0400 | [diff] [blame] | 1550 | "modules/skottie", |
Florin Malita | 2687072 | 2018-09-20 14:35:30 -0400 | [diff] [blame] | 1551 | "modules/skottie:gm", |
Mike Reed | 63559a5 | 2020-06-02 11:34:24 -0400 | [diff] [blame] | 1552 | "modules/skparagraph", |
| 1553 | "modules/skparagraph:gm", |
Brian Osman | c725e8f | 2019-04-10 14:08:44 -0400 | [diff] [blame] | 1554 | "modules/skshaper", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1555 | ] |
Mike Klein | c4abade | 2019-08-09 10:11:35 -0400 | [diff] [blame] | 1556 | if (is_skia_dev_build) { |
| 1557 | sources += [ "gm/fiddle.cpp" ] |
| 1558 | deps += [ ":skia.h" ] |
| 1559 | } |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1560 | public_deps = [ ":gpu_tool_utils" ] |
Mike Reed | 7bf160e | 2019-05-17 16:50:51 -0400 | [diff] [blame] | 1561 | |
| 1562 | if (skia_use_ffmpeg) { |
Florin Malita | 123e3b8 | 2020-04-24 11:10:27 -0400 | [diff] [blame] | 1563 | deps += [ "experimental/ffmpeg:video_decoder" ] |
Mike Reed | 7bf160e | 2019-05-17 16:50:51 -0400 | [diff] [blame] | 1564 | sources += [ "gm/video_decoder.cpp" ] |
| 1565 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1566 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1567 | |
Mike Klein | 7b7077c | 2019-06-03 17:10:59 -0500 | [diff] [blame] | 1568 | test_lib("skvm_builders") { |
| 1569 | sources = [ |
| 1570 | "tools/SkVMBuilders.cpp", |
| 1571 | "tools/SkVMBuilders.h", |
| 1572 | ] |
| 1573 | } |
| 1574 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1575 | import("gn/tests.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1576 | test_lib("tests") { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1577 | sources = tests_sources + pathops_tests_sources |
Robert Phillips | 0c6daf0 | 2019-05-16 12:43:11 -0400 | [diff] [blame] | 1578 | if (skia_use_metal) { |
| 1579 | sources += metal_tests_sources |
Jim Van Verth | 9187e49 | 2019-11-11 16:14:13 -0500 | [diff] [blame] | 1580 | cflags_objcc = [ "-fobjc-arc" ] |
Robert Phillips | 0c6daf0 | 2019-05-16 12:43:11 -0400 | [diff] [blame] | 1581 | } |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 1582 | if (skia_use_gl) { |
| 1583 | sources += gl_tests_sources |
| 1584 | } |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 1585 | if (!skia_enable_fontmgr_android) { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1586 | sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 1587 | } |
Ben Wagner | 37a06c0 | 2018-06-22 21:11:00 +0000 | [diff] [blame] | 1588 | if (!(skia_use_freetype && skia_use_fontconfig)) { |
| 1589 | sources -= [ "//tests/FontMgrFontConfigTest.cpp" ] |
| 1590 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1591 | deps = [ |
Hal Canary | 0f66681 | 2018-03-22 15:21:12 -0400 | [diff] [blame] | 1592 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1593 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1594 | ":skia", |
Mike Klein | 7b7077c | 2019-06-03 17:10:59 -0500 | [diff] [blame] | 1595 | ":skvm_builders", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1596 | ":tool_utils", |
Florin Malita | 94d4d3e | 2018-06-18 13:10:51 -0400 | [diff] [blame] | 1597 | "modules/skottie:tests", |
Julia Lavrova | a3552c5 | 2019-05-30 16:12:56 -0400 | [diff] [blame] | 1598 | "modules/skparagraph:tests", |
Brian Osman | ccb8752 | 2018-06-01 19:20:00 +0000 | [diff] [blame] | 1599 | "modules/sksg:tests", |
Brian Osman | c725e8f | 2019-04-10 14:08:44 -0400 | [diff] [blame] | 1600 | "modules/skshaper", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1601 | "//third_party/libpng", |
Leon Scroggins III | 194580d | 2019-02-22 12:32:16 -0500 | [diff] [blame] | 1602 | "//third_party/libwebp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1603 | "//third_party/zlib", |
| 1604 | ] |
Mike Klein | d63442d | 2017-03-27 14:16:04 -0400 | [diff] [blame] | 1605 | public_deps = [ |
| 1606 | ":gpu_tool_utils", # Test.h #includes headers from this target. |
| 1607 | ] |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1608 | } |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 1609 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1610 | import("gn/bench.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1611 | test_lib("bench") { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1612 | sources = bench_sources |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1613 | deps = [ |
| 1614 | ":flags", |
| 1615 | ":gm", |
| 1616 | ":gpu_tool_utils", |
| 1617 | ":skia", |
Mike Klein | 7b7077c | 2019-06-03 17:10:59 -0500 | [diff] [blame] | 1618 | ":skvm_builders", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1619 | ":tool_utils", |
Julia Lavrova | a3552c5 | 2019-05-30 16:12:56 -0400 | [diff] [blame] | 1620 | "modules/skparagraph:bench", |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 1621 | "modules/skshaper", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1622 | ] |
| 1623 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1624 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1625 | test_lib("experimental_svg_model") { |
Hal Canary | 0f66681 | 2018-03-22 15:21:12 -0400 | [diff] [blame] | 1626 | if (skia_use_expat) { |
Hal Canary | 0f66681 | 2018-03-22 15:21:12 -0400 | [diff] [blame] | 1627 | sources = [ |
| 1628 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 1629 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
| 1630 | "experimental/svg/model/SkSVGCircle.cpp", |
| 1631 | "experimental/svg/model/SkSVGClipPath.cpp", |
| 1632 | "experimental/svg/model/SkSVGContainer.cpp", |
| 1633 | "experimental/svg/model/SkSVGDOM.cpp", |
| 1634 | "experimental/svg/model/SkSVGEllipse.cpp", |
| 1635 | "experimental/svg/model/SkSVGGradient.cpp", |
| 1636 | "experimental/svg/model/SkSVGLine.cpp", |
| 1637 | "experimental/svg/model/SkSVGLinearGradient.cpp", |
| 1638 | "experimental/svg/model/SkSVGNode.cpp", |
| 1639 | "experimental/svg/model/SkSVGPath.cpp", |
| 1640 | "experimental/svg/model/SkSVGPattern.cpp", |
| 1641 | "experimental/svg/model/SkSVGPoly.cpp", |
| 1642 | "experimental/svg/model/SkSVGRadialGradient.cpp", |
| 1643 | "experimental/svg/model/SkSVGRect.cpp", |
| 1644 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 1645 | "experimental/svg/model/SkSVGSVG.cpp", |
| 1646 | "experimental/svg/model/SkSVGShape.cpp", |
| 1647 | "experimental/svg/model/SkSVGStop.cpp", |
Xavier Phan | e29cdaf | 2020-03-26 16:15:14 +0000 | [diff] [blame] | 1648 | "experimental/svg/model/SkSVGText.cpp", |
Hal Canary | 0f66681 | 2018-03-22 15:21:12 -0400 | [diff] [blame] | 1649 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 1650 | "experimental/svg/model/SkSVGUse.cpp", |
Florin Malita | f4403e7 | 2020-04-10 14:14:04 +0000 | [diff] [blame] | 1651 | "experimental/svg/model/SkSVGValue.cpp", |
Hal Canary | 0f66681 | 2018-03-22 15:21:12 -0400 | [diff] [blame] | 1652 | ] |
| 1653 | deps = [ |
| 1654 | ":skia", |
| 1655 | ":xml", |
| 1656 | ] |
| 1657 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1658 | } |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 1659 | |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 1660 | test_lib("experimental_xform") { |
| 1661 | sources = [ |
| 1662 | "experimental/xform/SkShape.cpp", |
| 1663 | "experimental/xform/SkXform.cpp", |
| 1664 | "experimental/xform/XContext.cpp", |
| 1665 | ] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1666 | deps = [ ":skia" ] |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 1667 | } |
| 1668 | |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1669 | if (skia_use_lua) { |
| 1670 | test_lib("lua") { |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1671 | sources = [ |
| 1672 | "src/utils/SkLua.cpp", |
| 1673 | "src/utils/SkLuaCanvas.cpp", |
| 1674 | ] |
| 1675 | deps = [ |
Herb Derby | 264182c | 2018-05-29 15:53:40 -0400 | [diff] [blame] | 1676 | "modules/skshaper", |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1677 | "//third_party/lua", |
| 1678 | ] |
| 1679 | } |
| 1680 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1681 | test_app("lua_app") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1682 | sources = [ "tools/lua/lua_app.cpp" ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1683 | deps = [ |
| 1684 | ":lua", |
| 1685 | ":skia", |
| 1686 | "//third_party/lua", |
| 1687 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1688 | } |
| 1689 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1690 | test_app("lua_pictures") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1691 | sources = [ "tools/lua/lua_pictures.cpp" ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1692 | deps = [ |
| 1693 | ":flags", |
| 1694 | ":lua", |
| 1695 | ":skia", |
| 1696 | ":tool_utils", |
| 1697 | "//third_party/lua", |
| 1698 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1699 | } |
| 1700 | } |
| 1701 | |
Florin Malita | bfe876a | 2018-09-02 12:33:59 -0400 | [diff] [blame] | 1702 | if (is_linux || is_mac) { |
Florin Malita | 79725d3 | 2018-06-05 16:16:57 -0400 | [diff] [blame] | 1703 | test_app("skottie_tool") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1704 | deps = [ "modules/skottie:tool" ] |
Florin Malita | 79725d3 | 2018-06-05 16:16:57 -0400 | [diff] [blame] | 1705 | } |
| 1706 | } |
| 1707 | |
Hal Canary | 5b39dc8 | 2019-04-17 13:29:46 -0400 | [diff] [blame] | 1708 | test_app("make_skqp_model") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1709 | sources = [ "tools/skqp/make_skqp_model.cpp" ] |
| 1710 | deps = [ ":skia" ] |
Hal Canary | 5b39dc8 | 2019-04-17 13:29:46 -0400 | [diff] [blame] | 1711 | } |
| 1712 | |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1713 | import("gn/samples.gni") |
| 1714 | test_lib("samples") { |
| 1715 | sources = samples_sources |
| 1716 | if (skia_enable_ccpr) { |
| 1717 | sources += samples_sources_ccpr |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1718 | } |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1719 | public_deps = [ ":tool_utils" ] |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1720 | deps = [ |
| 1721 | ":experimental_svg_model", |
| 1722 | ":flags", |
| 1723 | ":gpu_tool_utils", |
| 1724 | ":xml", |
| 1725 | "modules/skparagraph:samples", |
| 1726 | "modules/skshaper", |
| 1727 | ] |
| 1728 | |
| 1729 | if (skia_use_lua) { |
| 1730 | sources += [ "samplecode/SampleLua.cpp" ] |
| 1731 | deps += [ |
| 1732 | ":lua", |
| 1733 | "//third_party/lua", |
| 1734 | ] |
| 1735 | } |
| 1736 | } |
| 1737 | if (target_cpu != "wasm") { |
Nigel Tao | 3ab9b1f | 2020-05-28 13:29:13 +1000 | [diff] [blame] | 1738 | test_app("convert-to-nia") { |
| 1739 | sources = [ "tools/convert-to-nia.cpp" ] |
| 1740 | deps = [ ":skia" ] |
| 1741 | } |
Mike Klein | 7af351a | 2018-07-27 09:54:43 -0400 | [diff] [blame] | 1742 | test_app("imgcvt") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1743 | sources = [ "tools/imgcvt.cpp" ] |
Mike Klein | 7af351a | 2018-07-27 09:54:43 -0400 | [diff] [blame] | 1744 | deps = [ |
| 1745 | ":skcms", |
| 1746 | ":skia", |
| 1747 | ] |
| 1748 | } |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1749 | test_lib("hash_and_encode") { |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1750 | sources = [ |
| 1751 | "tools/HashAndEncode.cpp", |
| 1752 | "tools/HashAndEncode.h", |
| 1753 | ] |
| 1754 | deps = [ |
| 1755 | ":flags", |
| 1756 | ":skia", |
| 1757 | "//third_party/libpng", |
| 1758 | ] |
| 1759 | } |
| 1760 | test_app("fm") { |
| 1761 | sources = [ |
Mike Klein | fee0079 | 2019-11-21 16:18:47 -0600 | [diff] [blame] | 1762 | "dm/DMGpuTestProcs.cpp", # blech |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1763 | "tools/fm/fm.cpp", |
| 1764 | ] |
| 1765 | deps = [ |
| 1766 | ":common_flags_aa", |
| 1767 | ":common_flags_gpu", |
Mike Klein | 6253d90 | 2019-03-27 15:09:12 -0500 | [diff] [blame] | 1768 | ":experimental_svg_model", |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1769 | ":flags", |
| 1770 | ":gm", |
| 1771 | ":gpu_tool_utils", |
| 1772 | ":hash_and_encode", |
| 1773 | ":skia", |
Mike Klein | fee0079 | 2019-11-21 16:18:47 -0600 | [diff] [blame] | 1774 | ":tests", |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1775 | ":tool_utils", |
| 1776 | ":trace", |
Mike Klein | 2292426 | 2019-04-02 14:14:56 -0400 | [diff] [blame] | 1777 | "modules/skottie", |
| 1778 | "modules/skottie:utils", |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1779 | ] |
| 1780 | } |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1781 | test_app("dm") { |
| 1782 | sources = [ |
| 1783 | "dm/DM.cpp", |
Hal Canary | b6c5e5b | 2017-10-09 16:13:02 -0400 | [diff] [blame] | 1784 | "dm/DMGpuTestProcs.cpp", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1785 | "dm/DMJsonWriter.cpp", |
| 1786 | "dm/DMSrcSink.cpp", |
| 1787 | ] |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1788 | deps = [ |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1789 | ":common_flags_aa", |
| 1790 | ":common_flags_config", |
| 1791 | ":common_flags_gpu", |
| 1792 | ":common_flags_images", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1793 | ":experimental_svg_model", |
| 1794 | ":flags", |
| 1795 | ":gm", |
| 1796 | ":gpu_tool_utils", |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1797 | ":hash_and_encode", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1798 | ":skia", |
| 1799 | ":tests", |
| 1800 | ":tool_utils", |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 1801 | ":trace", |
Florin Malita | 3d856bd | 2018-05-26 09:49:28 -0400 | [diff] [blame] | 1802 | "modules/skottie", |
Florin Malita | a831655 | 2018-11-09 16:19:44 -0500 | [diff] [blame] | 1803 | "modules/skottie:utils", |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1804 | ] |
| 1805 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1806 | } |
| 1807 | |
Mike Klein | a8a51ce | 2018-01-09 12:34:11 -0500 | [diff] [blame] | 1808 | if (!is_win) { |
| 1809 | test_app("remote_demo") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1810 | sources = [ "tools/remote_demo.cpp" ] |
| 1811 | deps = [ ":skia" ] |
Mike Klein | a8a51ce | 2018-01-09 12:34:11 -0500 | [diff] [blame] | 1812 | } |
| 1813 | } |
| 1814 | |
Hal Canary | e107faa | 2019-10-23 12:52:33 -0400 | [diff] [blame] | 1815 | if (!is_win) { |
| 1816 | test_app("blob_cache_sim") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1817 | sources = [ "tools/blob_cache_sim.cpp" ] |
| 1818 | deps = [ ":skia" ] |
Hal Canary | e107faa | 2019-10-23 12:52:33 -0400 | [diff] [blame] | 1819 | } |
| 1820 | } |
| 1821 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1822 | test_app("nanobench") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1823 | sources = [ "bench/nanobench.cpp" ] |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1824 | deps = [ |
| 1825 | ":bench", |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1826 | ":common_flags_aa", |
| 1827 | ":common_flags_config", |
| 1828 | ":common_flags_gpu", |
| 1829 | ":common_flags_images", |
fmalita | 6519c21 | 2016-09-14 08:05:17 -0700 | [diff] [blame] | 1830 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1831 | ":flags", |
| 1832 | ":gm", |
| 1833 | ":gpu_tool_utils", |
| 1834 | ":skia", |
| 1835 | ":tool_utils", |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 1836 | ":trace", |
Mike Reed | 63559a5 | 2020-06-02 11:34:24 -0400 | [diff] [blame] | 1837 | "modules/skparagraph", |
Julia Lavrova | a3552c5 | 2019-05-30 16:12:56 -0400 | [diff] [blame] | 1838 | "modules/skshaper", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1839 | ] |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1840 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 1841 | |
Ravi Mistry | 10d36c5 | 2017-01-31 09:49:18 -0500 | [diff] [blame] | 1842 | test_app("skpinfo") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1843 | sources = [ "tools/skpinfo.cpp" ] |
Ravi Mistry | 10d36c5 | 2017-01-31 09:49:18 -0500 | [diff] [blame] | 1844 | deps = [ |
| 1845 | ":flags", |
| 1846 | ":skia", |
| 1847 | ] |
| 1848 | } |
| 1849 | |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 1850 | if (skia_use_ffmpeg) { |
| 1851 | test_app("skottie2movie") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1852 | sources = [ "tools/skottie2movie.cpp" ] |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 1853 | deps = [ |
| 1854 | ":flags", |
Mike Reed | 5f12eaa | 2019-09-24 12:01:58 -0400 | [diff] [blame] | 1855 | ":gpu_tool_utils", |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 1856 | ":skia", |
Florin Malita | ec40360 | 2020-04-24 12:14:03 -0400 | [diff] [blame] | 1857 | "experimental/ffmpeg:video_encoder", |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 1858 | "modules/skottie", |
Mike Reed | 5093e23 | 2019-05-30 10:10:50 -0400 | [diff] [blame] | 1859 | "modules/skottie:utils", |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 1860 | ] |
| 1861 | } |
| 1862 | } |
| 1863 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1864 | test_app("skpbench") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1865 | sources = [ "tools/skpbench/skpbench.cpp" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1866 | deps = [ |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1867 | ":common_flags_config", |
| 1868 | ":common_flags_gpu", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1869 | ":flags", |
| 1870 | ":gpu_tool_utils", |
| 1871 | ":skia", |
| 1872 | ":tool_utils", |
| 1873 | ] |
csmartdalton | 4b5179b | 2016-09-19 11:03:58 -0700 | [diff] [blame] | 1874 | } |
| 1875 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1876 | test_app("sktexttopdf") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1877 | sources = [ "tools/using_skia_and_harfbuzz.cpp" ] |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1878 | deps = [ |
| 1879 | ":skia", |
Herb Derby | 264182c | 2018-05-29 15:53:40 -0400 | [diff] [blame] | 1880 | "modules/skshaper", |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1881 | ] |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1882 | } |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1883 | |
Ben Wagner | 219f362 | 2017-07-17 15:32:25 -0400 | [diff] [blame] | 1884 | test_app("create_test_font") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1885 | sources = [ "tools/fonts/create_test_font.cpp" ] |
| 1886 | deps = [ ":skia" ] |
Ben Wagner | 219f362 | 2017-07-17 15:32:25 -0400 | [diff] [blame] | 1887 | assert_no_deps = [ |
| 1888 | # tool_utils requires the output of this app. |
| 1889 | ":tool_utils", |
| 1890 | ] |
| 1891 | } |
| 1892 | |
Florin Malita | 5d3ff43 | 2018-07-31 16:38:43 -0400 | [diff] [blame] | 1893 | if (skia_use_expat) { |
| 1894 | test_app("create_test_font_color") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1895 | sources = [ "tools/fonts/create_test_font_color.cpp" ] |
Florin Malita | 5d3ff43 | 2018-07-31 16:38:43 -0400 | [diff] [blame] | 1896 | deps = [ |
| 1897 | ":flags", |
| 1898 | ":skia", |
| 1899 | ":tool_utils", |
| 1900 | ] |
| 1901 | } |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 1902 | } |
| 1903 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1904 | test_app("get_images_from_skps") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1905 | sources = [ "tools/get_images_from_skps.cpp" ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1906 | deps = [ |
| 1907 | ":flags", |
| 1908 | ":skia", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1909 | ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1910 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1911 | |
Brian Osman | 6788a54 | 2018-12-10 11:56:01 -0500 | [diff] [blame] | 1912 | if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1913 | test_app("skiaserve") { |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1914 | sources = [ |
| 1915 | "tools/skiaserve/Request.cpp", |
| 1916 | "tools/skiaserve/Response.cpp", |
| 1917 | "tools/skiaserve/skiaserve.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1918 | "tools/skiaserve/urlhandlers/BreakHandler.cpp", |
| 1919 | "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp", |
| 1920 | "tools/skiaserve/urlhandlers/CmdHandler.cpp", |
| 1921 | "tools/skiaserve/urlhandlers/ColorModeHandler.cpp", |
| 1922 | "tools/skiaserve/urlhandlers/DataHandler.cpp", |
| 1923 | "tools/skiaserve/urlhandlers/DownloadHandler.cpp", |
| 1924 | "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp", |
| 1925 | "tools/skiaserve/urlhandlers/ImgHandler.cpp", |
| 1926 | "tools/skiaserve/urlhandlers/InfoHandler.cpp", |
Brian Salomon | 144a5c5 | 2016-12-20 16:48:59 -0500 | [diff] [blame] | 1927 | "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp", |
| 1928 | "tools/skiaserve/urlhandlers/OpsHandler.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1929 | "tools/skiaserve/urlhandlers/OverdrawHandler.cpp", |
| 1930 | "tools/skiaserve/urlhandlers/PostHandler.cpp", |
| 1931 | "tools/skiaserve/urlhandlers/QuitHandler.cpp", |
| 1932 | "tools/skiaserve/urlhandlers/RootHandler.cpp", |
| 1933 | ] |
| 1934 | deps = [ |
| 1935 | ":flags", |
| 1936 | ":gpu_tool_utils", |
| 1937 | ":skia", |
| 1938 | ":tool_utils", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1939 | "//third_party/libmicrohttpd", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1940 | ] |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1941 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1942 | } |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1943 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1944 | test_app("fuzz") { |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1945 | sources = [ |
Kevin Lubick | bc9a1a8 | 2018-09-17 14:46:57 -0400 | [diff] [blame] | 1946 | "fuzz/Fuzz.cpp", |
Hal Canary | 24ac42b | 2017-02-14 13:35:14 -0500 | [diff] [blame] | 1947 | "fuzz/FuzzCanvas.cpp", |
Cary Clark | 91390c8 | 2018-03-09 14:02:46 -0500 | [diff] [blame] | 1948 | "fuzz/FuzzCommon.cpp", |
Kevin Lubick | fec1dea | 2016-11-22 13:57:18 -0500 | [diff] [blame] | 1949 | "fuzz/FuzzDrawFunctions.cpp", |
Kevin Lubick | e4be55d | 2018-03-30 15:05:13 -0400 | [diff] [blame] | 1950 | "fuzz/FuzzEncoders.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1951 | "fuzz/FuzzGradients.cpp", |
Kevin Lubick | bc9a1a8 | 2018-09-17 14:46:57 -0400 | [diff] [blame] | 1952 | "fuzz/FuzzMain.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1953 | "fuzz/FuzzParsePath.cpp", |
Cary Clark | 91390c8 | 2018-03-09 14:02:46 -0500 | [diff] [blame] | 1954 | "fuzz/FuzzPathMeasure.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1955 | "fuzz/FuzzPathop.cpp", |
Jim Van Verth | 061cc21 | 2018-07-11 14:09:09 -0400 | [diff] [blame] | 1956 | "fuzz/FuzzPolyUtils.cpp", |
Hal Canary | 13872dd | 2018-04-06 10:25:12 -0400 | [diff] [blame] | 1957 | "fuzz/FuzzRegionOp.cpp", |
Kevin Lubick | 2be14d3 | 2019-10-21 13:44:48 -0400 | [diff] [blame] | 1958 | "fuzz/FuzzSkDescriptor.cpp", |
Leon Scroggins III | 0b8fcbc | 2018-10-16 15:52:17 -0400 | [diff] [blame] | 1959 | "fuzz/oss_fuzz/FuzzAndroidCodec.cpp", |
Kevin Lubick | 2416f96 | 2018-02-12 08:26:39 -0500 | [diff] [blame] | 1960 | "fuzz/oss_fuzz/FuzzAnimatedImage.cpp", |
| 1961 | "fuzz/oss_fuzz/FuzzImage.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 1962 | "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp", |
Leon Scroggins III | 0b8fcbc | 2018-10-16 15:52:17 -0400 | [diff] [blame] | 1963 | "fuzz/oss_fuzz/FuzzIncrementalImage.cpp", |
Florin Malita | 80452be | 2018-06-19 11:27:20 -0400 | [diff] [blame] | 1964 | "fuzz/oss_fuzz/FuzzJSON.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 1965 | "fuzz/oss_fuzz/FuzzPathDeserialize.cpp", |
Kevin Lubick | 2541edf | 2018-01-11 10:27:14 -0500 | [diff] [blame] | 1966 | "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp", |
| 1967 | "fuzz/oss_fuzz/FuzzRegionSetPath.cpp", |
Kevin Lubick | e9c1ce8 | 2019-03-11 11:09:40 -0400 | [diff] [blame] | 1968 | "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp", |
| 1969 | "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp", |
Kevin Lubick | 0f0a710 | 2019-03-18 16:20:55 -0400 | [diff] [blame] | 1970 | "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp", |
Kevin Lubick | e9c1ce8 | 2019-03-11 11:09:40 -0400 | [diff] [blame] | 1971 | "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp", |
Kevin Lubick | 2be14d3 | 2019-10-21 13:44:48 -0400 | [diff] [blame] | 1972 | "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 1973 | "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp", |
Kevin Lubick | 9ff5dc9 | 2018-01-09 12:47:33 -0500 | [diff] [blame] | 1974 | "tools/UrlDataManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1975 | "tools/debugger/DebugCanvas.cpp", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 1976 | "tools/debugger/DebugLayerManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1977 | "tools/debugger/DrawCommand.cpp", |
| 1978 | "tools/debugger/JsonWriteBuffer.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1979 | ] |
| 1980 | deps = [ |
| 1981 | ":flags", |
Hal Canary | 44801ca | 2017-03-15 11:39:06 -0400 | [diff] [blame] | 1982 | ":gpu_tool_utils", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1983 | ":skia", |
Florin Malita | 3d856bd | 2018-05-26 09:49:28 -0400 | [diff] [blame] | 1984 | "modules/skottie:fuzz", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1985 | ] |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1986 | } |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 1987 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1988 | test_app("pathops_unittest") { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1989 | sources = pathops_tests_sources + [ |
Mike Klein | 6e55fef | 2016-10-26 11:41:47 -0400 | [diff] [blame] | 1990 | rebase_path("tests/skia_test.cpp"), |
| 1991 | rebase_path("tests/Test.cpp"), |
| 1992 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 1993 | deps = [ |
| 1994 | ":flags", |
| 1995 | ":gpu_tool_utils", |
| 1996 | ":skia", |
| 1997 | ":tool_utils", |
| 1998 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 1999 | } |
| 2000 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2001 | test_app("dump_record") { |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2002 | sources = [ |
| 2003 | "tools/DumpRecord.cpp", |
| 2004 | "tools/dump_record.cpp", |
| 2005 | ] |
| 2006 | deps = [ |
| 2007 | ":flags", |
| 2008 | ":skia", |
| 2009 | ] |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2010 | } |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2011 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2012 | test_app("skdiff") { |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2013 | sources = [ |
| 2014 | "tools/skdiff/skdiff.cpp", |
| 2015 | "tools/skdiff/skdiff_html.cpp", |
| 2016 | "tools/skdiff/skdiff_main.cpp", |
| 2017 | "tools/skdiff/skdiff_utils.cpp", |
| 2018 | ] |
| 2019 | deps = [ |
| 2020 | ":skia", |
| 2021 | ":tool_utils", |
| 2022 | ] |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2023 | } |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2024 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2025 | test_app("skp_parser") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2026 | sources = [ "tools/skp_parser.cpp" ] |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2027 | deps = [ |
| 2028 | ":skia", |
| 2029 | ":tool_utils", |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2030 | ] |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2031 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2032 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2033 | if (!is_win) { |
Colin Cross | 654eb2a | 2019-11-08 13:08:36 -0800 | [diff] [blame] | 2034 | source_set("skqp_lib") { |
| 2035 | check_includes = false |
| 2036 | testonly = true |
| 2037 | if (!is_official_build) { |
| 2038 | configs -= [ "//gn:warnings" ] |
| 2039 | } |
| 2040 | public_configs = [ ":skia_private" ] |
Hal Canary | 0e07ad7 | 2018-02-08 13:06:56 -0500 | [diff] [blame] | 2041 | defines = |
| 2042 | [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ] |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2043 | sources = [ |
| 2044 | "dm/DMGpuTestProcs.cpp", |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2045 | "tools/skqp/src/skqp.cpp", |
| 2046 | "tools/skqp/src/skqp_model.cpp", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2047 | ] |
| 2048 | deps = [ |
| 2049 | ":gm", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2050 | ":skia", |
| 2051 | ":tests", |
Hal Canary | d7b3845 | 2017-12-11 17:46:26 -0500 | [diff] [blame] | 2052 | ":tool_utils", |
| 2053 | ] |
| 2054 | } |
| 2055 | test_app("skqp") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2056 | sources = [ "tools/skqp/src/skqp_main.cpp" ] |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 2057 | include_dirs = [ "//" ] |
| 2058 | lib_dirs = [] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2059 | deps = [ ":skqp_lib" ] |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2060 | } |
| 2061 | test_app("jitter_gms") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2062 | sources = [ "tools/skqp/jitter_gms.cpp" ] |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2063 | deps = [ |
| 2064 | ":gm", |
| 2065 | ":skia", |
| 2066 | ":skqp_lib", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2067 | ] |
| 2068 | } |
| 2069 | } |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 2070 | if (is_fuchsia) { |
| 2071 | # Build a package repository for skqp on Fuchsia. |
| 2072 | group("skqp_repo") { |
| 2073 | testonly = true |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2074 | deps = [ "//build/fuchsia/skqp:skqp_repo" ] |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 2075 | } |
| 2076 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2077 | if (is_android) { |
Colin Cross | 654eb2a | 2019-11-08 13:08:36 -0800 | [diff] [blame] | 2078 | shared_library("libskqp_app") { |
| 2079 | configs += [ ":skia_private" ] |
| 2080 | if (!is_official_build) { |
| 2081 | configs -= [ "//gn:warnings" ] |
| 2082 | } |
| 2083 | testonly = true |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2084 | sources = [ "tools/skqp/src/jni_skqp.cpp" ] |
Hal Canary | 28f8938 | 2017-12-12 09:42:14 -0500 | [diff] [blame] | 2085 | deps = [ |
| 2086 | ":skia", |
| 2087 | ":skqp_lib", |
Hal Canary | b4d01a9 | 2018-01-29 13:10:08 -0500 | [diff] [blame] | 2088 | ":tool_utils", |
Hal Canary | 28f8938 | 2017-12-12 09:42:14 -0500 | [diff] [blame] | 2089 | ] |
| 2090 | libs = [ "android" ] |
| 2091 | } |
| 2092 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2093 | if (is_android && skia_use_gl) { |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2094 | test_app("skottie_android") { |
| 2095 | is_shared_library = true |
| 2096 | |
| 2097 | sources = [ |
| 2098 | "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp", |
| 2099 | "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp", |
| 2100 | ] |
| 2101 | libs = [] |
| 2102 | |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2103 | deps = [ |
| 2104 | ":skia", |
| 2105 | "modules/skottie", |
Stan Iliev | a7a52b9 | 2018-10-01 15:36:32 -0400 | [diff] [blame] | 2106 | "modules/sksg:samples", |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2107 | ] |
| 2108 | } |
| 2109 | } |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2110 | |
Hal Canary | a9de760 | 2018-01-19 13:08:23 -0500 | [diff] [blame] | 2111 | test_app("list_gms") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2112 | sources = [ "tools/list_gms.cpp" ] |
Hal Canary | a9de760 | 2018-01-19 13:08:23 -0500 | [diff] [blame] | 2113 | deps = [ |
| 2114 | ":gm", |
| 2115 | ":skia", |
| 2116 | ] |
| 2117 | } |
| 2118 | test_app("list_gpu_unit_tests") { |
| 2119 | sources = [ |
| 2120 | "dm/DMGpuTestProcs.cpp", |
| 2121 | "tools/list_gpu_unit_tests.cpp", |
| 2122 | ] |
| 2123 | deps = [ |
| 2124 | ":skia", |
| 2125 | ":tests", |
| 2126 | ] |
| 2127 | } |
| 2128 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2129 | test_lib("sk_app") { |
Hal Canary | 378be8d | 2019-04-26 08:20:14 -0400 | [diff] [blame] | 2130 | public_deps = [ |
Hal Canary | 378be8d | 2019-04-26 08:20:14 -0400 | [diff] [blame] | 2131 | ":gpu_tool_utils", |
Hal Canary | 0569447 | 2019-05-03 17:14:21 -0400 | [diff] [blame] | 2132 | ":skia", |
Hal Canary | 378be8d | 2019-04-26 08:20:14 -0400 | [diff] [blame] | 2133 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2134 | sources = [ |
| 2135 | "tools/sk_app/CommandSet.cpp", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2136 | "tools/sk_app/Window.cpp", |
| 2137 | ] |
| 2138 | libs = [] |
| 2139 | |
| 2140 | if (is_android) { |
| 2141 | sources += [ |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2142 | "tools/sk_app/android/RasterWindowContext_android.cpp", |
| 2143 | "tools/sk_app/android/Window_android.cpp", |
| 2144 | "tools/sk_app/android/main_android.cpp", |
| 2145 | "tools/sk_app/android/surface_glue_android.cpp", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2146 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2147 | libs += [ "android" ] |
| 2148 | } else if (is_linux) { |
| 2149 | sources += [ |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2150 | "tools/sk_app/unix/RasterWindowContext_unix.cpp", |
| 2151 | "tools/sk_app/unix/Window_unix.cpp", |
| 2152 | "tools/sk_app/unix/keysym2ucs.c", |
| 2153 | "tools/sk_app/unix/main_unix.cpp", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2154 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2155 | libs += [ |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2156 | "GL", # Used by raster window context, so cannot be behind skia_use_gl. |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2157 | "X11", |
| 2158 | ] |
| 2159 | } else if (is_win) { |
| 2160 | sources += [ |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2161 | "tools/sk_app/win/RasterWindowContext_win.cpp", |
| 2162 | "tools/sk_app/win/Window_win.cpp", |
| 2163 | "tools/sk_app/win/main_win.cpp", |
| 2164 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2165 | } else if (is_mac) { |
| 2166 | sources += [ |
Jim Van Verth | 1f086ca | 2019-01-28 14:46:04 -0500 | [diff] [blame] | 2167 | "tools/sk_app/mac/RasterWindowContext_mac.mm", |
| 2168 | "tools/sk_app/mac/Window_mac.mm", |
| 2169 | "tools/sk_app/mac/main_mac.mm", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2170 | ] |
| 2171 | libs += [ |
| 2172 | "QuartzCore.framework", |
| 2173 | "Cocoa.framework", |
| 2174 | "Foundation.framework", |
| 2175 | ] |
| 2176 | } else if (is_ios) { |
| 2177 | sources += [ |
Jim Van Verth | 68cb8b0 | 2019-08-29 14:59:17 -0400 | [diff] [blame] | 2178 | "tools/sk_app/ios/RasterWindowContext_ios.mm", |
| 2179 | "tools/sk_app/ios/Window_ios.mm", |
| 2180 | "tools/sk_app/ios/main_ios.mm", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2181 | ] |
Jim Van Verth | 68cb8b0 | 2019-08-29 14:59:17 -0400 | [diff] [blame] | 2182 | libs += [ "QuartzCore.framework" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2183 | } |
| 2184 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2185 | if (skia_use_gl) { |
| 2186 | sources += [ "tools/sk_app/GLWindowContext.cpp" ] |
| 2187 | if (is_android) { |
| 2188 | sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ] |
| 2189 | } else if (is_linux) { |
| 2190 | sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ] |
| 2191 | } else if (is_win) { |
| 2192 | sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ] |
| 2193 | if (skia_use_angle) { |
| 2194 | sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ] |
| 2195 | } |
| 2196 | } else if (is_mac) { |
| 2197 | sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ] |
| 2198 | } else if (is_ios) { |
| 2199 | sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ] |
| 2200 | } |
| 2201 | } |
| 2202 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2203 | if (skia_use_vulkan) { |
| 2204 | sources += [ "tools/sk_app/VulkanWindowContext.cpp" ] |
| 2205 | if (is_android) { |
| 2206 | sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ] |
| 2207 | } else if (is_linux) { |
| 2208 | sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ] |
| 2209 | libs += [ "X11-xcb" ] |
| 2210 | } else if (is_win) { |
| 2211 | sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ] |
| 2212 | } |
| 2213 | } |
| 2214 | |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2215 | if (skia_use_metal) { |
| 2216 | sources += [ "tools/sk_app/MetalWindowContext.mm" ] |
| 2217 | if (is_mac) { |
| 2218 | sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ] |
Jim Van Verth | 68cb8b0 | 2019-08-29 14:59:17 -0400 | [diff] [blame] | 2219 | } else if (is_ios) { |
Jim Van Verth | e58d532 | 2019-09-03 09:42:57 -0400 | [diff] [blame] | 2220 | sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ] |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2221 | } |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2222 | } |
| 2223 | |
Jim Van Verth | 682a2f4 | 2020-05-13 16:54:09 -0400 | [diff] [blame] | 2224 | if (skia_use_direct3d) { |
| 2225 | sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ] |
| 2226 | } |
| 2227 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2228 | if (skia_use_dawn) { |
| 2229 | sources += [ "tools/sk_app/DawnWindowContext.cpp" ] |
| 2230 | if (is_linux) { |
| 2231 | if (dawn_enable_vulkan) { |
| 2232 | sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ] |
| 2233 | defines = [ "VK_USE_PLATFORM_XCB_KHR" ] |
| 2234 | libs += [ "X11-xcb" ] |
| 2235 | } |
| 2236 | } else if (is_win) { |
| 2237 | if (dawn_enable_d3d12) { |
| 2238 | sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ] |
| 2239 | } |
| 2240 | } else if (is_mac) { |
| 2241 | if (dawn_enable_metal) { |
| 2242 | sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ] |
| 2243 | } |
| 2244 | } |
| 2245 | } |
| 2246 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2247 | deps = [ ":tool_utils" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2248 | if (is_android) { |
| 2249 | deps += [ "//third_party/native_app_glue" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2250 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2251 | if (skia_use_gl && skia_use_angle) { |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2252 | deps += [ "//third_party/angle2" ] |
Mike Klein | a92c383 | 2016-12-08 09:49:39 -0500 | [diff] [blame] | 2253 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2254 | } |
Ethan Nicholas | 4f3985c | 2016-11-14 11:16:37 -0500 | [diff] [blame] | 2255 | |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2256 | if (!skia_use_vulkan && (is_mac || is_linux || is_win)) { |
| 2257 | test_app("fiddle_examples") { |
| 2258 | sources = [ |
Brian Osman | c725e8f | 2019-04-10 14:08:44 -0400 | [diff] [blame] | 2259 | "tools/fiddle/all_examples.cpp", |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2260 | "tools/fiddle/examples.cpp", |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2261 | "tools/fiddle/examples.h", |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2262 | ] |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2263 | if (is_win) { |
Hal Canary | 6c8422c | 2020-01-10 15:22:09 -0500 | [diff] [blame] | 2264 | cflags = [ |
| 2265 | "/wd4756", # Overflow in constant arithmetic |
| 2266 | "/wd4305", # truncation from 'double' to 'float' |
| 2267 | ] |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2268 | } |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2269 | deps = [ |
| 2270 | ":skia", |
| 2271 | ":skia.h", |
| 2272 | "modules/skottie", |
Florin Malita | a1dcaae | 2019-03-25 17:38:43 -0400 | [diff] [blame] | 2273 | "modules/skshaper", |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2274 | ] |
| 2275 | } |
| 2276 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2277 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2278 | # sk_app can work without GL but viewer always runs raster through a GL window context. |
| 2279 | if (skia_use_gl) { |
| 2280 | test_app("viewer") { |
| 2281 | is_shared_library = is_android |
| 2282 | sources = [ |
| 2283 | "tools/viewer/AnimTimer.h", |
| 2284 | "tools/viewer/BisectSlide.cpp", |
| 2285 | "tools/viewer/GMSlide.cpp", |
| 2286 | "tools/viewer/ImGuiLayer.cpp", |
| 2287 | "tools/viewer/ImageSlide.cpp", |
| 2288 | "tools/viewer/ParticlesSlide.cpp", |
| 2289 | "tools/viewer/SKPSlide.cpp", |
| 2290 | "tools/viewer/SampleSlide.cpp", |
| 2291 | "tools/viewer/SkSLSlide.cpp", |
| 2292 | "tools/viewer/SkottieSlide.cpp", |
| 2293 | "tools/viewer/SlideDir.cpp", |
| 2294 | "tools/viewer/StatsLayer.cpp", |
| 2295 | "tools/viewer/SvgSlide.cpp", |
| 2296 | "tools/viewer/TouchGesture.cpp", |
| 2297 | "tools/viewer/TouchGesture.h", |
| 2298 | "tools/viewer/Viewer.cpp", |
| 2299 | ] |
| 2300 | libs = [] |
| 2301 | |
| 2302 | deps = [ |
| 2303 | ":common_flags_gpu", |
| 2304 | ":experimental_svg_model", |
| 2305 | ":flags", |
| 2306 | ":gm", |
| 2307 | ":gpu_tool_utils", |
| 2308 | ":samples", |
| 2309 | ":sk_app", |
| 2310 | ":skia", |
| 2311 | ":tool_utils", |
| 2312 | ":trace", |
| 2313 | "modules/particles", |
| 2314 | "modules/skottie", |
| 2315 | "modules/skottie:utils", |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2316 | "modules/sksg:samples", |
| 2317 | "//third_party/imgui", |
| 2318 | ] |
| 2319 | if (skia_use_experimental_xform) { |
| 2320 | deps += [ ":experimental_xform" ] |
| 2321 | sources += [ "gm/xform.cpp" ] |
| 2322 | } |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 2323 | } |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2324 | } |
| 2325 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2326 | if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) { |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2327 | test_app("HelloWorld") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2328 | sources = [ "example/HelloWorld.cpp" ] |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2329 | libs = [] |
| 2330 | |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2331 | deps = [ |
| 2332 | ":flags", |
| 2333 | ":gpu_tool_utils", |
| 2334 | ":sk_app", |
| 2335 | ":skia", |
| 2336 | ":tool_utils", |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2337 | ] |
| 2338 | } |
| 2339 | } |
| 2340 | |
Mike Klein | 9f6468f | 2020-05-19 13:14:40 -0500 | [diff] [blame] | 2341 | if (skia_use_gl && (is_linux || is_mac || is_ios)) { |
Jim Van Verth | 4c70c75 | 2017-07-11 12:03:01 -0400 | [diff] [blame] | 2342 | test_app("SkiaSDLExample") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2343 | sources = [ "example/SkiaSDLExample.cpp" ] |
Jim Van Verth | 4c70c75 | 2017-07-11 12:03:01 -0400 | [diff] [blame] | 2344 | libs = [] |
Jim Van Verth | 4c70c75 | 2017-07-11 12:03:01 -0400 | [diff] [blame] | 2345 | deps = [ |
| 2346 | ":gpu_tool_utils", |
| 2347 | ":skia", |
| 2348 | "//third_party/libsdl", |
| 2349 | ] |
| 2350 | } |
| 2351 | } |
| 2352 | |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2353 | if (skia_qt_path != "" && (is_win || is_linux || is_mac)) { |
| 2354 | action_foreach("generate_mocs") { |
| 2355 | script = "gn/call.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2356 | sources = [ "tools/mdbviz/MainWindow.h" ] |
| 2357 | outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ] |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2358 | args = [ |
| 2359 | "$skia_qt_path" + "/bin/moc", |
| 2360 | "{{source}}", |
| 2361 | "-o", |
| 2362 | "gen/mdbviz/{{source_name_part}}_moc.cpp", |
| 2363 | ] |
| 2364 | } |
| 2365 | action_foreach("generate_resources") { |
| 2366 | script = "gn/call.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2367 | sources = [ "tools/mdbviz/resources.qrc" ] |
| 2368 | outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ] |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2369 | args = [ |
| 2370 | "$skia_qt_path" + "/bin/rcc", |
| 2371 | "{{source}}", |
| 2372 | "-o", |
| 2373 | "gen/mdbviz/{{source_name_part}}_res.cpp", |
| 2374 | ] |
| 2375 | } |
| 2376 | test_app("mdbviz") { |
| 2377 | if (is_win) { |
| 2378 | # on Windows we need to disable some exception handling warnings due to the Qt headers |
| 2379 | cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017 |
| 2380 | } |
| 2381 | sources = [ |
Robert Phillips | 5fccf9d | 2017-09-05 15:10:12 -0400 | [diff] [blame] | 2382 | "tools/UrlDataManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 2383 | "tools/debugger/DebugCanvas.cpp", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 2384 | "tools/debugger/DebugLayerManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 2385 | "tools/debugger/DrawCommand.cpp", |
| 2386 | "tools/debugger/JsonWriteBuffer.cpp", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2387 | "tools/mdbviz/MainWindow.cpp", |
Robert Phillips | deaf568 | 2017-09-06 13:07:21 -0400 | [diff] [blame] | 2388 | "tools/mdbviz/Model.cpp", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2389 | "tools/mdbviz/main.cpp", |
| 2390 | |
| 2391 | # generated files |
| 2392 | "$target_gen_dir/mdbviz/MainWindow_moc.cpp", |
| 2393 | "$target_gen_dir/mdbviz/resources_res.cpp", |
| 2394 | ] |
| 2395 | lib_dirs = [ "$skia_qt_path/lib" ] |
| 2396 | libs = [ |
| 2397 | "Qt5Core.lib", |
| 2398 | "Qt5Gui.lib", |
| 2399 | "Qt5Widgets.lib", |
| 2400 | ] |
| 2401 | include_dirs = [ |
| 2402 | "$skia_qt_path/include", |
Robert Phillips | 276066b | 2017-09-06 17:17:44 -0400 | [diff] [blame] | 2403 | "$skia_qt_path/include/QtCore", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2404 | "$skia_qt_path/include/QtWidgets", |
| 2405 | ] |
| 2406 | deps = [ |
| 2407 | ":generate_mocs", |
| 2408 | ":generate_resources", |
| 2409 | ":skia", |
| 2410 | ] |
| 2411 | } |
| 2412 | } |
| 2413 | |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 2414 | if (is_android && defined(ndk) && ndk != "") { |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2415 | copy("gdbserver") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2416 | sources = [ "$ndk/$ndk_gdbserver" ] |
| 2417 | outputs = [ "$root_out_dir/gdbserver" ] |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2418 | } |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2419 | } |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 2420 | |
| 2421 | if (skia_use_opencl) { |
| 2422 | test_app("hello-opencl") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2423 | sources = [ "tools/hello-opencl.cpp" ] |
| 2424 | deps = [ "//third_party/opencl" ] |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 2425 | } |
| 2426 | } |
Hal Canary | b8f81af | 2019-04-24 13:56:16 -0400 | [diff] [blame] | 2427 | |
Brian Osman | f564f15 | 2019-07-23 15:14:30 -0400 | [diff] [blame] | 2428 | executable("cpu_modules") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2429 | sources = [ "tools/cpu_modules.cpp" ] |
Brian Osman | f564f15 | 2019-07-23 15:14:30 -0400 | [diff] [blame] | 2430 | deps = [ |
| 2431 | ":skia", |
| 2432 | "modules/particles", |
| 2433 | ] |
| 2434 | } |
| 2435 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2436 | if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) { |
Hal Canary | 1f94d39 | 2019-07-30 09:27:56 -0400 | [diff] [blame] | 2437 | test_app("editor") { |
| 2438 | is_shared_library = is_android |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2439 | deps = [ "modules/skplaintexteditor:editor_app" ] |
Hal Canary | 1f94d39 | 2019-07-30 09:27:56 -0400 | [diff] [blame] | 2440 | } |
Hal Canary | b8f81af | 2019-04-24 13:56:16 -0400 | [diff] [blame] | 2441 | } |
Hal Canary | e5b65d2 | 2019-09-19 11:33:31 -0400 | [diff] [blame] | 2442 | |
| 2443 | executable("image_diff_metric") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2444 | sources = [ "tools/image_diff_metric.cpp" ] |
| 2445 | deps = [ ":skia" ] |
Hal Canary | e5b65d2 | 2019-09-19 11:33:31 -0400 | [diff] [blame] | 2446 | } |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 2447 | |
| 2448 | group("modules_testonly") { |
| 2449 | testonly = true |
| 2450 | deps = [] |
| 2451 | if (target_cpu == "wasm") { |
| 2452 | deps += [ "modules/canvaskit:viewer_wasm" ] |
| 2453 | } |
| 2454 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 2455 | } |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 2456 | |
Chinmay Garde | a1ea0a9 | 2019-10-01 16:37:10 -0700 | [diff] [blame] | 2457 | if (is_ios && skia_use_metal && !skia_enable_flutter_defines) { |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 2458 | group("minimal_ios_mtl_skia_app") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2459 | deps = [ "experimental/minimal_ios_mtl_skia_app" ] |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 2460 | } |
Hal Canary | 2748306 | 2019-12-06 15:01:08 -0500 | [diff] [blame] | 2461 | } |
| 2462 | |
Hal Canary | 60ff651 | 2020-01-21 12:39:20 -0500 | [diff] [blame] | 2463 | if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) { |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 2464 | group("skottie_ios") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2465 | deps = [ "tools/skottie_ios_app" ] |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 2466 | } |
| 2467 | } |