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") { |
Kevin Lubick | 2f9a098 | 2020-08-20 10:33:39 -0400 | [diff] [blame] | 52 | defines += [ |
| 53 | "SK_ASSUME_WEBGL=1", |
| 54 | "SK_USE_WEBGL", |
| 55 | ] |
Kevin Lubick | 27ba703 | 2019-03-21 08:13:54 -0400 | [diff] [blame] | 56 | } |
Chinmay Garde | f832c0a | 2020-03-18 14:37:23 -0700 | [diff] [blame] | 57 | |
| 58 | # Some older versions of the Clang toolchain change the visibility of |
| 59 | # symbols decorated with API_AVAILABLE macro to be visible. Users of such |
| 60 | # toolchains suppress the use of this macro till toolchain updates are made. |
| 61 | if (is_mac || is_ios) { |
| 62 | if (skia_enable_api_available_macro) { |
| 63 | defines += [ "SK_ENABLE_API_AVAILABLE" ] |
| 64 | } else { |
| 65 | cflags_objcc += [ "-Wno-unguarded-availability" ] |
| 66 | } |
| 67 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | # Skia internal APIs, used by Skia itself and a few test tools. |
| 71 | config("skia_private") { |
| 72 | visibility = [ ":*" ] |
| 73 | |
Mike Reed | a9e241d | 2017-05-03 10:52:00 -0400 | [diff] [blame] | 74 | defines = [ "SK_GAMMA_APPLY_TO_A8" ] |
Herb Derby | bbfc015 | 2020-10-06 11:24:40 -0400 | [diff] [blame] | 75 | if (skia_enable_gpu) { |
| 76 | defines += [ "GR_OP_ALLOCATE_USE_NEW" ] |
| 77 | } |
Leon Scroggins III | c41a5f5 | 2018-11-15 15:54:59 -0500 | [diff] [blame] | 78 | if (skia_use_fixed_gamma_text) { |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 79 | defines += [ |
| 80 | "SK_GAMMA_EXPONENT=1.4", |
| 81 | "SK_GAMMA_CONTRAST=0.0", |
| 82 | ] |
| 83 | } |
Mike Klein | b45d862 | 2019-04-24 14:04:01 -0500 | [diff] [blame] | 84 | if (is_skia_dev_build) { |
| 85 | defines += [ |
| 86 | "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1", |
| 87 | "GR_TEST_UTILS=1", |
| 88 | ] |
mtklein | 88a7ac0 | 2016-09-14 11:16:49 -0700 | [diff] [blame] | 89 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 90 | libs = [] |
| 91 | lib_dirs = [] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 92 | if (skia_use_gl && skia_use_angle) { |
Brian Osman | 34755e2 | 2016-12-05 09:46:02 -0500 | [diff] [blame] | 93 | defines += [ "SK_ANGLE" ] |
| 94 | } |
Greg Daniel | b16beb9 | 2020-04-27 14:26:21 +0000 | [diff] [blame] | 95 | if (skia_use_vma) { |
| 96 | defines += [ "SK_USE_VMA" ] |
| 97 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 101 | config("skia_library") { |
| 102 | visibility = [ ":*" ] |
Mike Klein | f5f4e81 | 2019-04-29 15:45:14 +0000 | [diff] [blame] | 103 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | skia_library_configs = [ |
| 107 | ":skia_public", |
| 108 | ":skia_private", |
| 109 | ":skia_library", |
| 110 | ] |
| 111 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 112 | # Use for CPU-specific Skia code that needs particular compiler flags. |
| 113 | template("opts") { |
Mike Klein | 6d1df6d | 2018-11-07 15:03:58 -0500 | [diff] [blame] | 114 | visibility = [ ":*" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 115 | if (invoker.enabled) { |
| 116 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 117 | check_includes = false |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 118 | forward_variables_from(invoker, "*") |
| 119 | configs += skia_library_configs |
| 120 | } |
| 121 | } else { |
| 122 | # If not enabled, a phony empty target that swallows all otherwise unused variables. |
| 123 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 124 | check_includes = false |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 125 | forward_variables_from(invoker, |
| 126 | "*", |
| 127 | [ |
| 128 | "sources", |
| 129 | "cflags", |
| 130 | ]) |
| 131 | } |
| 132 | } |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 133 | } |
| 134 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 135 | is_x86 = current_cpu == "x64" || current_cpu == "x86" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 136 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 137 | opts("none") { |
| 138 | enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 139 | sources = skia_opts.none_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 140 | cflags = [] |
| 141 | } |
| 142 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 143 | opts("armv7") { |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 144 | enabled = current_cpu == "arm" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 145 | sources = skia_opts.armv7_sources + skia_opts.neon_sources |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 146 | cflags = [] |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | opts("arm64") { |
| 150 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 151 | sources = skia_opts.arm64_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 152 | cflags = [] |
| 153 | } |
| 154 | |
| 155 | opts("crc32") { |
| 156 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 157 | sources = skia_opts.crc32_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 158 | cflags = [ "-march=armv8-a+crc" ] |
| 159 | } |
| 160 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 161 | opts("sse2") { |
| 162 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 163 | sources = skia_opts.sse2_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 164 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 165 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ] |
| 166 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 167 | cflags = [ "-msse2" ] |
| 168 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 169 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 170 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 171 | opts("ssse3") { |
| 172 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 173 | sources = skia_opts.ssse3_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 174 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 175 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ] |
| 176 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 177 | cflags = [ "-mssse3" ] |
| 178 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 179 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 180 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 181 | opts("sse41") { |
| 182 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 183 | sources = skia_opts.sse41_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 184 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 185 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ] |
| 186 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 187 | cflags = [ "-msse4.1" ] |
| 188 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 189 | } |
mtklein | 4e97607 | 2016-08-08 09:06:27 -0700 | [diff] [blame] | 190 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 191 | opts("sse42") { |
| 192 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 193 | sources = skia_opts.sse42_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 194 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 195 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ] |
| 196 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 197 | cflags = [ "-msse4.2" ] |
| 198 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | opts("avx") { |
| 202 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 203 | sources = skia_opts.avx_sources |
Mike Klein | 4d4b3aa | 2018-03-21 13:07:35 -0400 | [diff] [blame] | 204 | if (is_win) { |
Mike Klein | 17b6e48 | 2016-11-18 22:11:41 +0000 | [diff] [blame] | 205 | cflags = [ "/arch:AVX" ] |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 206 | } else { |
| 207 | cflags = [ "-mavx" ] |
Mike Klein | 1cc767b | 2019-12-13 13:02:22 -0500 | [diff] [blame] | 208 | if (is_mac && is_debug) { |
Mike Klein | f800c1d | 2020-06-04 11:53:56 -0500 | [diff] [blame] | 209 | cflags += [ "-fno-stack-check" ] # Work around skia:9709 |
Mike Klein | 1cc767b | 2019-12-13 13:02:22 -0500 | [diff] [blame] | 210 | } |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 211 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 212 | } |
| 213 | |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 214 | opts("hsw") { |
| 215 | enabled = is_x86 |
| 216 | sources = skia_opts.hsw_sources |
Mike Klein | 4d4b3aa | 2018-03-21 13:07:35 -0400 | [diff] [blame] | 217 | if (is_win) { |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 218 | cflags = [ "/arch:AVX2" ] |
| 219 | } else { |
Mike Klein | e87c486 | 2018-03-23 00:13:58 +0000 | [diff] [blame] | 220 | cflags = [ "-march=haswell" ] |
Mike Klein | db38022 | 2020-01-22 13:53:18 -0600 | [diff] [blame] | 221 | if (is_mac && is_debug) { |
Mike Klein | f800c1d | 2020-06-04 11:53:56 -0500 | [diff] [blame] | 222 | cflags += [ "-fno-stack-check" ] # Work around skia:9709 |
Mike Klein | db38022 | 2020-01-22 13:53:18 -0600 | [diff] [blame] | 223 | } |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 224 | } |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 225 | } |
| 226 | |
Mike Klein | ad56c4c | 2020-06-05 06:57:30 -0500 | [diff] [blame] | 227 | opts("skx") { |
| 228 | enabled = is_x86 |
| 229 | sources = skia_opts.skx_sources |
| 230 | if (is_win) { |
| 231 | cflags = [ "/arch:AVX512" ] |
| 232 | } else { |
| 233 | cflags = [ "-march=skylake-avx512" ] |
| 234 | if (is_mac && is_debug) { |
| 235 | cflags += [ "-fno-stack-check" ] # Work around skia:9709 |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 240 | # 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] | 241 | template("optional") { |
Mike Klein | 6d1df6d | 2018-11-07 15:03:58 -0500 | [diff] [blame] | 242 | visibility = [ ":*" ] |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 243 | if (invoker.enabled) { |
| 244 | config(target_name + "_public") { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 245 | if (defined(invoker.public_defines)) { |
| 246 | defines = invoker.public_defines |
| 247 | } |
Chris Dalton | 3a67b8e | 2018-05-03 09:30:29 -0600 | [diff] [blame] | 248 | if (defined(invoker.public_configs)) { |
| 249 | configs = invoker.public_configs |
| 250 | } |
Hal Canary | 2dad990 | 2019-11-20 16:01:31 -0500 | [diff] [blame] | 251 | if (defined(invoker.public_include_dirs)) { |
| 252 | include_dirs = invoker.public_include_dirs |
| 253 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 254 | } |
| 255 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 256 | check_includes = false |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 257 | forward_variables_from(invoker, |
| 258 | "*", |
| 259 | [ |
| 260 | "public_defines", |
| 261 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 262 | "configs_to_remove", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 263 | ]) |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 264 | all_dependent_configs = [ ":" + target_name + "_public" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 265 | configs += skia_library_configs |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 266 | if (defined(invoker.configs_to_remove)) { |
| 267 | configs -= invoker.configs_to_remove |
| 268 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 269 | } |
| 270 | } else { |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 271 | source_set(target_name) { |
| 272 | forward_variables_from(invoker, |
| 273 | "*", |
| 274 | [ |
Ben Wagner | ea765a3 | 2020-06-05 13:42:30 -0400 | [diff] [blame] | 275 | "public", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 276 | "public_defines", |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 277 | "public_deps", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 278 | "deps", |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 279 | "libs", |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 280 | "frameworks", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 281 | "sources", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 282 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 283 | "configs_to_remove", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 284 | ]) |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 285 | if (defined(invoker.sources_when_disabled)) { |
| 286 | sources = invoker.sources_when_disabled |
| 287 | } |
| 288 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 289 | } |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 290 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 291 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 292 | |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 293 | optional("android_utils") { |
| 294 | enabled = skia_enable_android_utils |
| 295 | |
Leon Scroggins III | 87caae6 | 2020-05-04 10:02:45 -0400 | [diff] [blame] | 296 | public = [ |
| 297 | "client_utils/android/BRDAllocator.h", |
| 298 | "client_utils/android/BitmapRegionDecoder.h", |
| 299 | "client_utils/android/FrontBufferedStream.h", |
| 300 | ] |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 301 | public_defines = [ "SK_ENABLE_ANDROID_UTILS" ] |
Leon Scroggins III | 87caae6 | 2020-05-04 10:02:45 -0400 | [diff] [blame] | 302 | sources = [ |
| 303 | "client_utils/android/BitmapRegionDecoder.cpp", |
| 304 | "client_utils/android/FrontBufferedStream.cpp", |
| 305 | ] |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 306 | } |
| 307 | |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 308 | group("fontmgr_factory") { |
| 309 | public_deps = [ skia_fontmgr_factory ] |
| 310 | } |
| 311 | |
| 312 | optional("fontmgr_empty_factory") { |
| 313 | enabled = true |
| 314 | sources = [ "src/ports/SkFontMgr_empty_factory.cpp" ] |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 315 | } |
| 316 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 317 | optional("fontmgr_android") { |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 318 | enabled = skia_enable_fontmgr_android |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 319 | |
| 320 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 321 | ":typeface_freetype", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 322 | "//third_party/expat", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 323 | ] |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 324 | public = [ "include/ports/SkFontMgr_android.h" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 325 | sources = [ |
| 326 | "src/ports/SkFontMgr_android.cpp", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 327 | "src/ports/SkFontMgr_android_parser.cpp", |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 328 | "src/ports/SkFontMgr_android_parser.h", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 329 | ] |
| 330 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 331 | optional("fontmgr_android_factory") { |
| 332 | enabled = skia_enable_fontmgr_android |
| 333 | deps = [ ":fontmgr_android" ] |
| 334 | sources = [ "src/ports/SkFontMgr_android_factory.cpp" ] |
| 335 | } |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 336 | |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 337 | optional("fontmgr_custom") { |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 338 | enabled = |
| 339 | skia_enable_fontmgr_custom_directory || |
| 340 | skia_enable_fontmgr_custom_embedded || skia_enable_fontmgr_custom_empty |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 341 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 342 | deps = [ ":typeface_freetype" ] |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 343 | public = [ "src/ports/SkFontMgr_custom.h" ] |
| 344 | sources = [ "src/ports/SkFontMgr_custom.cpp" ] |
| 345 | } |
| 346 | |
| 347 | optional("fontmgr_custom_directory") { |
| 348 | enabled = skia_enable_fontmgr_custom_directory |
| 349 | |
| 350 | deps = [ |
| 351 | ":fontmgr_custom", |
| 352 | ":typeface_freetype", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 353 | ] |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 354 | public = [ "include/ports/SkFontMgr_directory.h" ] |
| 355 | sources = [ "src/ports/SkFontMgr_custom_directory.cpp" ] |
| 356 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 357 | optional("fontmgr_custom_directory_factory") { |
| 358 | enabled = skia_enable_fontmgr_custom_directory |
| 359 | deps = [ ":fontmgr_custom_directory" ] |
| 360 | sources = [ "src/ports/SkFontMgr_custom_directory_factory.cpp" ] |
| 361 | } |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 362 | |
| 363 | optional("fontmgr_custom_embedded") { |
| 364 | enabled = skia_enable_fontmgr_custom_embedded |
| 365 | |
| 366 | deps = [ |
| 367 | ":fontmgr_custom", |
| 368 | ":typeface_freetype", |
| 369 | ] |
| 370 | sources = [ "src/ports/SkFontMgr_custom_embedded.cpp" ] |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 371 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 372 | optional("fontmgr_custom_embedded_factory") { |
| 373 | enabled = skia_enable_fontmgr_custom_embedded |
| 374 | deps = [ ":fontmgr_custom_embedded" ] |
| 375 | sources = [ "src/ports/SkFontMgr_custom_embedded_factory.cpp" ] |
| 376 | } |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 377 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 378 | optional("fontmgr_custom_empty") { |
| 379 | enabled = skia_enable_fontmgr_custom_empty |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 380 | |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 381 | deps = [ |
| 382 | ":fontmgr_custom", |
| 383 | ":typeface_freetype", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 384 | ] |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 385 | public = [ "include/ports/SkFontMgr_empty.h" ] |
| 386 | sources = [ "src/ports/SkFontMgr_custom_empty.cpp" ] |
Hal Canary | ff2742e | 2018-01-30 11:35:47 -0500 | [diff] [blame] | 387 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 388 | optional("fontmgr_custom_empty_factory") { |
| 389 | enabled = skia_enable_fontmgr_custom_empty |
| 390 | deps = [ ":fontmgr_custom_empty" ] |
| 391 | sources = [ "src/ports/SkFontMgr_custom_empty_factory.cpp" ] |
| 392 | } |
Hal Canary | ff2742e | 2018-01-30 11:35:47 -0500 | [diff] [blame] | 393 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 394 | optional("fontmgr_fontconfig") { |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 395 | enabled = skia_enable_fontmgr_fontconfig |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 396 | |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 397 | # The public header includes fontconfig.h and uses FcConfig* |
| 398 | public_deps = [ "//third_party:fontconfig" ] |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 399 | public = [ "include/ports/SkFontMgr_fontconfig.h" ] |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 400 | deps = [ ":typeface_freetype" ] |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 401 | sources = [ "src/ports/SkFontMgr_fontconfig.cpp" ] |
| 402 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 403 | optional("fontmgr_fontconfig_factory") { |
| 404 | enabled = skia_enable_fontmgr_fontconfig |
| 405 | deps = [ ":fontmgr_fontconfig" ] |
| 406 | sources = [ "src/ports/SkFontMgr_fontconfig_factory.cpp" ] |
| 407 | } |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 408 | |
| 409 | optional("fontmgr_FontConfigInterface") { |
| 410 | enabled = skia_enable_fontmgr_FontConfigInterface |
| 411 | |
| 412 | deps = [ |
| 413 | ":typeface_freetype", |
| 414 | "//third_party:fontconfig", |
| 415 | ] |
| 416 | public = [ |
| 417 | "include/ports/SkFontConfigInterface.h", |
| 418 | "include/ports/SkFontMgr_FontConfigInterface.h", |
| 419 | ] |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 420 | sources = [ |
bungeman | 1ae0e01 | 2016-09-19 12:13:16 -0700 | [diff] [blame] | 421 | "src/ports/SkFontConfigInterface.cpp", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 422 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 423 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 424 | "src/ports/SkFontConfigTypeface.h", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 425 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 426 | ] |
| 427 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 428 | optional("fontmgr_FontConfigInterface_factory") { |
| 429 | enabled = skia_enable_fontmgr_FontConfigInterface |
| 430 | deps = [ ":fontmgr_FontConfigInterface" ] |
| 431 | sources = [ "src/ports/SkFontMgr_FontConfigInterface_factory.cpp" ] |
| 432 | } |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 433 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 434 | optional("fontmgr_fuchsia") { |
| 435 | enabled = skia_enable_fontmgr_fuchsia |
| 436 | |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 437 | deps = [] |
| 438 | |
| 439 | if (is_fuchsia && using_fuchsia_sdk) { |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 440 | deps += [ "//build/fuchsia/fidl:fuchsia.fonts" ] |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 441 | } else { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 442 | deps = [ "//sdk/fidl/fuchsia.fonts" ] |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 443 | } |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 444 | public = [ "src/ports/SkFontMgr_fuchsia.h" ] |
| 445 | sources = [ "src/ports/SkFontMgr_fuchsia.cpp" ] |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 446 | } |
| 447 | |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 448 | optional("fontmgr_mac_ct") { |
Ben Wagner | d13487e | 2020-06-03 23:29:43 -0400 | [diff] [blame] | 449 | enabled = skia_use_fonthost_mac |
| 450 | |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 451 | public = [ |
| 452 | "include/ports/SkFontMgr_mac_ct.h", |
| 453 | "include/ports/SkTypeface_mac.h", |
| 454 | ] |
Ben Wagner | 0ef90dd | 2020-06-05 11:25:42 -0400 | [diff] [blame] | 455 | sources = [ |
Ben Wagner | 0ef90dd | 2020-06-05 11:25:42 -0400 | [diff] [blame] | 456 | "src/ports/SkFontMgr_mac_ct.cpp", |
Ben Wagner | 0ef90dd | 2020-06-05 11:25:42 -0400 | [diff] [blame] | 457 | "src/ports/SkScalerContext_mac_ct.cpp", |
| 458 | "src/ports/SkScalerContext_mac_ct.h", |
| 459 | "src/ports/SkTypeface_mac_ct.cpp", |
| 460 | "src/ports/SkTypeface_mac_ct.h", |
| 461 | ] |
Ben Wagner | d13487e | 2020-06-03 23:29:43 -0400 | [diff] [blame] | 462 | |
| 463 | if (is_mac) { |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 464 | frameworks = [ |
Ben Wagner | d13487e | 2020-06-03 23:29:43 -0400 | [diff] [blame] | 465 | # AppKit symbols NSFontWeightXXX may be dlsym'ed. |
| 466 | "AppKit.framework", |
| 467 | "ApplicationServices.framework", |
| 468 | ] |
| 469 | } |
| 470 | |
| 471 | if (is_ios) { |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 472 | frameworks = [ |
Ben Wagner | d13487e | 2020-06-03 23:29:43 -0400 | [diff] [blame] | 473 | "CoreFoundation.framework", |
| 474 | "CoreGraphics.framework", |
| 475 | "CoreText.framework", |
| 476 | |
| 477 | # UIKit symbols UIFontWeightXXX may be dlsym'ed. |
| 478 | "UIKit.framework", |
| 479 | ] |
| 480 | } |
| 481 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 482 | optional("fontmgr_mac_ct_factory") { |
| 483 | enabled = skia_use_fonthost_mac |
| 484 | deps = [ ":fontmgr_mac_ct" ] |
| 485 | sources = [ "src/ports/SkFontMgr_mac_ct_factory.cpp" ] |
| 486 | } |
Ben Wagner | d13487e | 2020-06-03 23:29:43 -0400 | [diff] [blame] | 487 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 488 | optional("fontmgr_win") { |
| 489 | enabled = skia_enable_fontmgr_win |
| 490 | |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 491 | public = [ "include/ports/SkTypeface_win.h" ] |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 492 | sources = [ |
| 493 | "src/fonts/SkFontMgr_indirect.cpp", |
| 494 | "src/ports/SkFontMgr_win_dw.cpp", |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 495 | "src/ports/SkScalerContext_win_dw.cpp", |
| 496 | "src/ports/SkTypeface_win_dw.cpp", |
| 497 | ] |
| 498 | } |
Ben Wagner | 8c3daeb | 2020-06-29 11:59:10 -0400 | [diff] [blame] | 499 | optional("fontmgr_win_factory") { |
| 500 | enabled = skia_enable_fontmgr_win |
| 501 | deps = [ ":fontmgr_win" ] |
| 502 | sources = [ "src/ports/SkFontMgr_win_dw_factory.cpp" ] |
| 503 | } |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 504 | |
| 505 | optional("fontmgr_win_gdi") { |
| 506 | enabled = skia_enable_fontmgr_win_gdi |
| 507 | |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 508 | public = [ "include/ports/SkTypeface_win.h" ] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 509 | sources = [ "src/ports/SkFontHost_win.cpp" ] |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 510 | libs = [ "Gdi32.lib" ] |
| 511 | } |
| 512 | |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 513 | if (skia_lex) { |
Ethan Nicholas | ca82a92 | 2017-09-07 09:39:50 -0400 | [diff] [blame] | 514 | executable("sksllex") { |
| 515 | sources = [ |
| 516 | "src/sksl/lex/Main.cpp", |
| 517 | "src/sksl/lex/NFA.cpp", |
| 518 | "src/sksl/lex/RegexNode.cpp", |
| 519 | "src/sksl/lex/RegexParser.cpp", |
| 520 | ] |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 521 | include_dirs = [ "." ] |
Ethan Nicholas | ca82a92 | 2017-09-07 09:39:50 -0400 | [diff] [blame] | 522 | } |
| 523 | |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 524 | action("run_sksllex") { |
| 525 | script = "gn/run_sksllex.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 526 | deps = [ ":sksllex(//gn/toolchain:$host_toolchain)" ] |
| 527 | sources = [ "src/sksl/lex/sksl.lex" ] |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 528 | |
| 529 | # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a |
| 530 | # path that starts with target_out_dir and then uses ".." to back up into the src dir. |
| 531 | outputs = [ |
| 532 | "$target_out_dir/" + |
| 533 | rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir), |
| 534 | # the script also modifies the corresponding .cpp file, but if we tell GN that it gets |
| 535 | # confused due to the same file being named by two different paths |
| 536 | ] |
| 537 | sksllex_path = "$root_out_dir/" |
| 538 | sksllex_path += "sksllex" |
| 539 | if (host_os == "win") { |
| 540 | sksllex_path += ".exe" |
| 541 | } |
| 542 | args = [ |
| 543 | rebase_path(sksllex_path), |
| 544 | rebase_path("bin/clang-format"), |
John Stiles | 796e702 | 2020-06-11 19:57:22 -0400 | [diff] [blame] | 545 | rebase_path("bin/fetch-clang-format"), |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 546 | rebase_path("src"), |
| 547 | ] |
| 548 | } |
| 549 | } else { |
| 550 | group("run_sksllex") { |
| 551 | } |
| 552 | } |
| 553 | |
John Stiles | d836f84 | 2020-09-14 10:21:44 -0400 | [diff] [blame] | 554 | # `Compile Processors` and `Compile SkSL Tests` both rely on skslc. |
| 555 | if (skia_compile_processors || skia_compile_sksl_tests) { |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 556 | executable("skslc") { |
| 557 | defines = [ "SKSL_STANDALONE" ] |
Brian Osman | a6ca975 | 2020-10-02 13:41:21 -0400 | [diff] [blame] | 558 | sources = [ |
| 559 | "src/core/SkMalloc.cpp", |
| 560 | "src/core/SkMath.cpp", |
John Stiles | 060503e | 2020-10-22 15:02:26 -0400 | [diff] [blame] | 561 | "src/core/SkSemaphore.cpp", |
| 562 | "src/core/SkThreadID.cpp", |
John Stiles | 23e6866 | 2020-10-29 10:17:15 -0400 | [diff] [blame] | 563 | "src/gpu/GrBlockAllocator.cpp", |
| 564 | "src/gpu/GrMemoryPool.cpp", |
Brian Osman | a6ca975 | 2020-10-02 13:41:21 -0400 | [diff] [blame] | 565 | "src/ports/SkMemory_malloc.cpp", |
| 566 | "src/sksl/SkSLMain.cpp", |
| 567 | ] |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 568 | sources += skia_sksl_sources |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 569 | sources += skia_sksl_gpu_sources |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 570 | include_dirs = [ "." ] |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 571 | deps = [ |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 572 | ":run_sksllex", |
Stephen White | 238fc24 | 2019-08-26 10:19:23 -0400 | [diff] [blame] | 573 | "//third_party/spirv-tools:spvtools", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 574 | ] |
| 575 | } |
| 576 | |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 577 | skslc_path = "$root_out_dir/" |
| 578 | if (host_toolchain != default_toolchain_name) { |
| 579 | skslc_path += "$host_toolchain/" |
| 580 | } |
| 581 | skslc_path += "skslc" |
| 582 | if (host_os == "win") { |
| 583 | skslc_path += ".exe" |
| 584 | } |
| 585 | |
Brian Osman | dd49617 | 2020-08-08 08:17:18 -0400 | [diff] [blame] | 586 | action("create_sksl_fp") { |
| 587 | script = "gn/create_sksl_fp.py" |
| 588 | sources = [ |
| 589 | "include/private/GrSharedEnums.h", |
| 590 | "src/sksl/sksl_fp_raw.sksl", |
| 591 | ] |
| 592 | outputs = [ "$root_out_dir/sksl_fp.sksl" ] |
| 593 | args = [ |
| 594 | rebase_path(sources[0]), |
| 595 | rebase_path(sources[1]), |
| 596 | rebase_path(outputs[0]), |
| 597 | ] |
| 598 | } |
| 599 | |
| 600 | copy("sksl_pre_includes") { |
| 601 | sources = [ |
| 602 | "src/sksl/sksl_frag.sksl", |
| 603 | "src/sksl/sksl_geom.sksl", |
| 604 | "src/sksl/sksl_gpu.sksl", |
| 605 | "src/sksl/sksl_interp.sksl", |
| 606 | "src/sksl/sksl_pipeline.sksl", |
| 607 | "src/sksl/sksl_vert.sksl", |
| 608 | ] |
| 609 | outputs = [ "$root_out_dir/{{source_file_part}}" ] |
| 610 | } |
| 611 | |
| 612 | dehydrate_sksl_sources = get_target_outputs(":sksl_pre_includes") |
| 613 | dehydrate_sksl_sources += get_target_outputs(":create_sksl_fp") |
| 614 | |
| 615 | dehydrate_sksl_outputs = [] |
| 616 | foreach(src, dehydrate_sksl_sources) { |
| 617 | name = get_path_info(src, "name") |
| 618 | |
| 619 | # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a |
| 620 | # path that starts with target_out_dir and then uses ".." to back up into the src dir. |
| 621 | dehydrate_sksl_outputs += [ "$target_out_dir/" + rebase_path( |
| 622 | "src/sksl/generated/$name.dehydrated.sksl", |
| 623 | target_out_dir) ] |
| 624 | } |
| 625 | |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 626 | action("dehydrate_sksl") { |
| 627 | script = "gn/dehydrate_sksl.py" |
Brian Osman | dd49617 | 2020-08-08 08:17:18 -0400 | [diff] [blame] | 628 | deps = [ |
| 629 | ":create_sksl_fp", |
| 630 | ":sksl_pre_includes", |
| 631 | ":skslc(//gn/toolchain:$host_toolchain)", |
| 632 | ] |
| 633 | sources = dehydrate_sksl_sources |
| 634 | outputs = dehydrate_sksl_outputs |
Brian Osman | a578138 | 2020-08-07 21:28:12 +0000 | [diff] [blame] | 635 | args = [ |
| 636 | rebase_path(skslc_path), |
Brian Osman | dd49617 | 2020-08-08 08:17:18 -0400 | [diff] [blame] | 637 | rebase_path("src/sksl/generated"), |
Brian Osman | a578138 | 2020-08-07 21:28:12 +0000 | [diff] [blame] | 638 | ] |
Brian Osman | dd49617 | 2020-08-08 08:17:18 -0400 | [diff] [blame] | 639 | args += rebase_path(dehydrate_sksl_sources) |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 640 | } |
John Stiles | d836f84 | 2020-09-14 10:21:44 -0400 | [diff] [blame] | 641 | } else { |
| 642 | group("dehydrate_sksl") { |
| 643 | } |
| 644 | } |
| 645 | |
| 646 | skia_gpu_processor_outputs = [] |
| 647 | if (skia_compile_processors) { |
| 648 | foreach(src, skia_gpu_processor_sources) { |
| 649 | dir = get_path_info(src, "dir") |
| 650 | name = get_path_info(src, "name") |
| 651 | |
| 652 | # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a |
| 653 | # path that starts with target_out_dir and then uses ".." to back up into the src dir. |
| 654 | skia_gpu_processor_outputs += [ |
| 655 | "$target_out_dir/" + |
| 656 | rebase_path("$dir/generated/$name.h", target_out_dir), |
| 657 | # the script also modifies the corresponding .cpp file, but if we tell GN that it gets |
| 658 | # confused due to the same file being named by two different paths |
| 659 | ] |
| 660 | } |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 661 | |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 662 | action("compile_processors") { |
| 663 | script = "gn/compile_processors.py" |
| 664 | deps = [ |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 665 | ":create_sksl_fp", |
Brian Osman | dd49617 | 2020-08-08 08:17:18 -0400 | [diff] [blame] | 666 | ":sksl_pre_includes", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 667 | ":skslc(//gn/toolchain:$host_toolchain)", |
| 668 | ] |
| 669 | sources = skia_gpu_processor_sources |
| 670 | outputs = skia_gpu_processor_outputs |
Ethan Nicholas | b9f6afb | 2017-07-27 16:02:37 -0400 | [diff] [blame] | 671 | args = [ |
| 672 | rebase_path(skslc_path), |
Eric Boren | b121be7 | 2017-07-28 10:00:51 -0400 | [diff] [blame] | 673 | rebase_path("bin/clang-format"), |
John Stiles | 796e702 | 2020-06-11 19:57:22 -0400 | [diff] [blame] | 674 | rebase_path("bin/fetch-clang-format"), |
Ethan Nicholas | b9f6afb | 2017-07-27 16:02:37 -0400 | [diff] [blame] | 675 | ] |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 676 | args += rebase_path(skia_gpu_processor_sources) |
| 677 | } |
| 678 | } else { |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 679 | group("compile_processors") { |
| 680 | } |
John Stiles | d836f84 | 2020-09-14 10:21:44 -0400 | [diff] [blame] | 681 | } |
| 682 | |
| 683 | if (skia_compile_sksl_tests) { |
| 684 | import("gn/sksl_tests.gni") |
John Stiles | d836f84 | 2020-09-14 10:21:44 -0400 | [diff] [blame] | 685 | |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 686 | template("compile_sksl") { |
| 687 | # Compile the passed-in `sources` into `outputs` using skslc, with the given language/settings. |
| 688 | action("compile_sksl_${target_name}") { |
| 689 | script = "gn/compile_sksl_tests.py" |
| 690 | deps = [ |
| 691 | ":create_sksl_fp", |
| 692 | ":sksl_pre_includes", |
| 693 | ":skslc(//gn/toolchain:$host_toolchain)", |
| 694 | ] |
| 695 | sources = invoker.sources |
| 696 | outputs = [] |
| 697 | foreach(src, sources) { |
| 698 | dir = get_path_info(src, "dir") |
| 699 | name = get_path_info(src, "name") |
| 700 | foreach(outputPattern, invoker.outputPatterns) { |
| 701 | outputs += [ target_out_dir + "/" + rebase_path( |
| 702 | dir + outputPattern[0] + name + outputPattern[1], |
| 703 | target_out_dir) ] |
| 704 | } |
| 705 | } |
| 706 | args = [ |
| 707 | rebase_path(skslc_path), |
| 708 | invoker.lang, |
| 709 | invoker.settings, |
| 710 | ] |
| 711 | args += rebase_path(sources) |
| 712 | } |
John Stiles | d836f84 | 2020-09-14 10:21:44 -0400 | [diff] [blame] | 713 | } |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 714 | compile_sksl("fp_tests") { |
| 715 | sources = sksl_fp_tests_sources |
| 716 | outputPatterns = [ |
| 717 | [ |
| 718 | "/golden/", |
| 719 | ".cpp", |
| 720 | ], |
| 721 | [ |
| 722 | "/golden/", |
| 723 | ".h", |
| 724 | ], |
| 725 | ] |
| 726 | lang = "--fp" |
| 727 | settings = "--settings" |
John Stiles | 0ed9f31 | 2020-09-16 17:46:37 -0400 | [diff] [blame] | 728 | } |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 729 | compile_sksl("glsl_tests") { |
| 730 | sources = sksl_glsl_tests_sources + sksl_glsl_settings_tests_sources |
| 731 | outputPatterns = [ [ |
| 732 | "/golden/", |
| 733 | ".glsl", |
| 734 | ] ] |
| 735 | lang = "--glsl" |
| 736 | settings = "--settings" |
John Stiles | 0ed9f31 | 2020-09-16 17:46:37 -0400 | [diff] [blame] | 737 | } |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 738 | compile_sksl("glsl_nosettings_tests") { |
John Stiles | 0ed9f31 | 2020-09-16 17:46:37 -0400 | [diff] [blame] | 739 | sources = sksl_glsl_settings_tests_sources |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 740 | outputPatterns = [ [ |
| 741 | "/golden/", |
| 742 | "StandaloneSettings.glsl", |
| 743 | ] ] |
| 744 | lang = "--glsl" |
| 745 | settings = "--nosettings" |
John Stiles | d836f84 | 2020-09-14 10:21:44 -0400 | [diff] [blame] | 746 | } |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 747 | compile_sksl("metal_tests") { |
| 748 | sources = sksl_metal_tests_sources |
| 749 | outputPatterns = [ [ |
| 750 | "/golden/", |
| 751 | ".metal", |
| 752 | ] ] |
| 753 | lang = "--metal" |
| 754 | settings = "--settings" |
| 755 | } |
John Stiles | d836f84 | 2020-09-14 10:21:44 -0400 | [diff] [blame] | 756 | } else { |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 757 | group("compile_sksl_fp_tests") { |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 758 | } |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 759 | group("compile_sksl_glsl_tests") { |
| 760 | } |
| 761 | group("compile_sksl_glsl_nosettings_tests") { |
John Stiles | 0ed9f31 | 2020-09-16 17:46:37 -0400 | [diff] [blame] | 762 | } |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 763 | group("compile_sksl_metal_tests") { |
| 764 | } |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 765 | } |
| 766 | |
Ben Wagner | e27ee6c | 2019-02-15 14:59:30 -0500 | [diff] [blame] | 767 | optional("gpu") { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 768 | enabled = skia_enable_gpu |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 769 | deps = [ |
| 770 | ":compile_processors", |
John Stiles | 7e24871 | 2020-09-24 16:42:09 -0400 | [diff] [blame] | 771 | ":compile_sksl_fp_tests", |
| 772 | ":compile_sksl_glsl_nosettings_tests", |
| 773 | ":compile_sksl_glsl_tests", |
John Stiles | aeae3a5 | 2020-09-25 13:35:58 -0400 | [diff] [blame] | 774 | ":compile_sksl_metal_tests", |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 775 | ":dehydrate_sksl", |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 776 | ":run_sksllex", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 777 | ] |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 778 | if (skia_generate_workarounds) { |
| 779 | deps += [ ":workaround_list" ] |
| 780 | } |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 781 | public_defines = [] |
Chris Dalton | 3a67b8e | 2018-05-03 09:30:29 -0600 | [diff] [blame] | 782 | public_configs = [] |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 783 | public_deps = [] |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 784 | |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 785 | sources = |
| 786 | skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs |
Kevin Lubick | 93faa67 | 2018-10-10 15:54:53 -0400 | [diff] [blame] | 787 | if (!skia_enable_ccpr) { |
| 788 | sources -= skia_ccpr_sources |
| 789 | sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ] |
| 790 | } |
Kevin Lubick | 4bf2c26 | 2018-10-15 09:35:54 -0400 | [diff] [blame] | 791 | if (!skia_enable_nvpr) { |
| 792 | sources -= skia_nvpr_sources |
| 793 | sources += [ "src/gpu/GrPathRendering_none.cpp" ] |
| 794 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 795 | |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 796 | libs = [] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 797 | frameworks = [] |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 798 | |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 799 | if (skia_use_gl) { |
| 800 | public_defines += [ "SK_GL" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 801 | if (is_android) { |
| 802 | sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ] |
| 803 | |
| 804 | # this lib is required to link against AHardwareBuffer |
| 805 | if (defined(ndk_api) && ndk_api >= 26) { |
| 806 | libs += [ "android" ] |
| 807 | } |
| 808 | } else if (skia_use_egl) { |
| 809 | sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ] |
| 810 | libs += [ "EGL" ] |
Kevin Lubick | 204c3be | 2020-08-19 14:30:58 -0400 | [diff] [blame] | 811 | } else if (skia_use_webgl) { |
| 812 | sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 813 | } else if (is_linux && skia_use_x11) { |
| 814 | sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ] |
| 815 | libs += [ "GL" ] |
| 816 | } else if (is_mac) { |
| 817 | sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ] |
| 818 | } else if (is_ios) { |
| 819 | sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ] |
| 820 | } else if (is_win) { |
| 821 | sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ] |
| 822 | if (target_cpu != "arm64") { |
| 823 | libs += [ "OpenGL32.lib" ] |
| 824 | } |
| 825 | } else { |
| 826 | sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ] |
| 827 | } |
John Rosasco | a9b348f | 2019-11-08 13:18:15 -0800 | [diff] [blame] | 828 | sources += skia_gl_gpu_sources |
| 829 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 830 | |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 831 | if (skia_use_vulkan) { |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 832 | public_defines += [ "SK_VULKAN" ] |
Greg Daniel | b16beb9 | 2020-04-27 14:26:21 +0000 | [diff] [blame] | 833 | if (skia_use_vma) { |
| 834 | deps += [ "third_party/vulkanmemoryallocator" ] |
| 835 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 836 | sources += skia_vk_sources |
egdaniel | e4a9bd7 | 2016-09-21 07:36:14 -0700 | [diff] [blame] | 837 | if (skia_enable_vulkan_debug_layers) { |
| 838 | public_defines += [ "SK_ENABLE_VK_LAYERS" ] |
| 839 | } |
Craig Stout | cb6b4bd | 2018-12-13 10:20:07 -0800 | [diff] [blame] | 840 | if (is_fuchsia) { |
John Rosasco | e57ca49 | 2019-11-13 14:30:45 -0800 | [diff] [blame] | 841 | if (using_fuchsia_sdk) { |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 842 | public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ] |
| 843 | } else { |
Brian Osman | 489cf88 | 2019-07-09 10:48:28 -0400 | [diff] [blame] | 844 | public_deps += [ "//src/graphics/lib/vulkan" ] |
Chinmay Garde | 8982076 | 2019-05-06 16:44:06 -0700 | [diff] [blame] | 845 | } |
Craig Stout | cb6b4bd | 2018-12-13 10:20:07 -0800 | [diff] [blame] | 846 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 847 | } |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 848 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 849 | if (is_android && (skia_use_gl || skia_use_vulkan)) { |
| 850 | # this lib is required to link against AHardwareBuffer |
| 851 | if (defined(ndk_api) && ndk_api >= 26) { |
| 852 | libs += [ "android" ] |
| 853 | } |
| 854 | } |
| 855 | |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 856 | if (skia_use_dawn) { |
| 857 | public_defines += [ "SK_DAWN" ] |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 858 | sources += skia_dawn_sources |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 859 | public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ] |
Stephen White | fbffb99 | 2019-10-17 10:32:40 -0400 | [diff] [blame] | 860 | deps += [ |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 861 | "//third_party/externals/dawn/src/dawn:dawn_proc", |
| 862 | "//third_party/externals/dawn/src/dawn:dawncpp", |
| 863 | "//third_party/externals/dawn/src/dawn_native", |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 864 | ] |
| 865 | if (dawn_enable_d3d12) { |
| 866 | libs += [ |
| 867 | "d3d12.lib", |
| 868 | "dxgi.lib", |
| 869 | "d3dcompiler.lib", |
| 870 | ] |
| 871 | } else if (dawn_enable_metal) { |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 872 | frameworks += [ "Metal.framework" ] |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 873 | } |
| 874 | } |
| 875 | |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 876 | if (skia_use_direct3d) { |
| 877 | public_defines += [ "SK_DIRECT3D" ] |
Jim Van Verth | 1b89eb7 | 2020-09-23 16:29:51 -0400 | [diff] [blame] | 878 | deps += [ |
| 879 | "//third_party/d3d12allocator", |
| 880 | "//third_party/spirv-cross:spirv_cross", |
| 881 | ] |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 882 | sources += skia_direct3d_sources |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 883 | if (skia_enable_direct3d_debug_layer) { |
| 884 | public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ] |
| 885 | } |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 886 | libs += [ |
| 887 | "d3d12.lib", |
| 888 | "dxgi.lib", |
| 889 | "d3dcompiler.lib", |
| 890 | ] |
| 891 | } |
| 892 | |
Greg Daniel | 6b7e0e2 | 2017-07-12 16:21:09 -0400 | [diff] [blame] | 893 | cflags_objcc = [] |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 894 | if (skia_use_metal) { |
| 895 | public_defines += [ "SK_METAL" ] |
| 896 | sources += skia_metal_sources |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 897 | frameworks += [ "Metal.framework" ] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 898 | frameworks += [ "Foundation.framework" ] |
Jim Van Verth | 36b86af | 2020-08-24 17:16:46 +0000 | [diff] [blame] | 899 | cflags_objcc += [ "-fobjc-arc" ] |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 900 | } |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 901 | |
Kevin Lubick | f4def34 | 2018-10-04 12:52:50 -0400 | [diff] [blame] | 902 | if (is_debug) { |
| 903 | public_defines += [ "SK_ENABLE_DUMP_GPU" ] |
| 904 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 905 | } |
| 906 | |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 907 | optional("gif") { |
Hal Canary | 2dad990 | 2019-11-20 16:01:31 -0500 | [diff] [blame] | 908 | enabled = !skia_use_wuffs && skia_use_libgifcodec |
Hal Canary | 1ec9a28 | 2019-11-21 10:15:50 -0500 | [diff] [blame] | 909 | _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni" |
| 910 | if ("True" == |
| 911 | exec_script("gn/checkpath.py", |
| 912 | [ rebase_path(_libgifcodec_gni_path, root_build_dir) ], |
| 913 | "trim string")) { |
| 914 | public_defines = [ "SK_USE_LIBGIFCODEC" ] |
| 915 | public_include_dirs = [ |
| 916 | ".", |
| 917 | skia_libgifcodec_path, |
| 918 | ] |
| 919 | include_dirs = public_include_dirs |
| 920 | import(_libgifcodec_gni_path) |
| 921 | sources = rebase_path(libgifcodec_sources + libgifcodec_public, |
| 922 | ".", |
| 923 | skia_libgifcodec_path) |
| 924 | } |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 925 | } |
| 926 | |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 927 | optional("heif") { |
| 928 | enabled = skia_use_libheif |
| 929 | public_defines = [ "SK_HAS_HEIF_LIBRARY" ] |
| 930 | |
| 931 | deps = [] |
| 932 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 933 | sources = [ "src/codec/SkHeifCodec.cpp" ] |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 934 | } |
| 935 | |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 936 | optional("jpeg_decode") { |
| 937 | enabled = skia_use_libjpeg_turbo_decode |
| 938 | public_defines = [ "SK_CODEC_DECODES_JPEG" ] |
| 939 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 940 | deps = [ "//third_party/libjpeg-turbo:libjpeg" ] |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 941 | sources = [ |
| 942 | "src/codec/SkJpegCodec.cpp", |
| 943 | "src/codec/SkJpegDecoderMgr.cpp", |
| 944 | "src/codec/SkJpegUtility.cpp", |
| 945 | ] |
| 946 | } |
| 947 | |
| 948 | optional("jpeg_encode") { |
| 949 | enabled = skia_use_libjpeg_turbo_encode |
| 950 | public_defines = [ "SK_ENCODE_JPEG" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 951 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 952 | deps = [ "//third_party/libjpeg-turbo:libjpeg" ] |
| 953 | public = [ "include/encode/SkJpegEncoder.h" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 954 | sources = [ |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 955 | "src/images/SkJPEGWriteUtility.cpp", |
Matt Sarett | 04c3731 | 2017-05-05 14:02:13 -0400 | [diff] [blame] | 956 | "src/images/SkJpegEncoder.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 957 | ] |
| 958 | } |
| 959 | |
Leon Scroggins III | 326b989 | 2020-08-05 16:51:10 -0400 | [diff] [blame] | 960 | optional("ndk_images") { |
| 961 | enabled = skia_use_ndk_images |
| 962 | public_defines = [ "SK_ENABLE_NDK_IMAGES" ] |
| 963 | sources = [ |
| 964 | "src/ports/SkImageEncoder_NDK.cpp", |
| 965 | "src/ports/SkImageGeneratorNDK.cpp", |
| 966 | "src/ports/SkNDKConversions.cpp", |
| 967 | ] |
Leon Scroggins III | f21d6b9 | 2020-08-05 10:44:17 -0400 | [diff] [blame] | 968 | libs = [ "jnigraphics" ] |
| 969 | } |
| 970 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 971 | optional("pdf") { |
Hal Canary | 43fb7a0 | 2016-12-30 13:09:03 -0500 | [diff] [blame] | 972 | enabled = skia_use_zlib && skia_enable_pdf |
| 973 | public_defines = [ "SK_SUPPORT_PDF" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 974 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 975 | deps = [ "//third_party/zlib" ] |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 976 | if (skia_use_libjpeg_turbo_decode) { |
| 977 | deps += [ ":jpeg_decode" ] |
| 978 | } |
| 979 | if (skia_use_libjpeg_turbo_encode) { |
| 980 | deps += [ ":jpeg_encode" ] |
Hal Canary | 83e0f1b | 2018-04-05 16:58:41 -0400 | [diff] [blame] | 981 | } |
Robert Phillips | 9b00f1f | 2020-03-24 12:29:44 -0400 | [diff] [blame] | 982 | public = skia_pdf_public |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 983 | sources = skia_pdf_sources |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 984 | sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] |
Hal Canary | 2a3093c | 2019-02-20 11:25:45 -0500 | [diff] [blame] | 985 | if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) { |
| 986 | deps += [ "//third_party/harfbuzz" ] |
| 987 | defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ] |
| 988 | } else if (skia_use_icu && skia_use_sfntly) { |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 989 | deps += [ "//third_party/sfntly" ] |
Hal Canary | 32498f0 | 2019-02-04 15:36:31 -0500 | [diff] [blame] | 990 | defines = [ "SK_PDF_USE_SFNTLY" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 991 | } |
| 992 | } |
| 993 | |
Robert Phillips | 9b00f1f | 2020-03-24 12:29:44 -0400 | [diff] [blame] | 994 | optional("xps") { |
| 995 | enabled = skia_use_xps && is_win |
| 996 | public_defines = [ "SK_SUPPORT_XPS" ] |
| 997 | public = skia_xps_public |
| 998 | sources = skia_xps_sources |
| 999 | } |
| 1000 | |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1001 | optional("png_decode") { |
| 1002 | enabled = skia_use_libpng_decode |
| 1003 | public_defines = [ "SK_CODEC_DECODES_PNG" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1004 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1005 | deps = [ "//third_party/libpng" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1006 | sources = [ |
| 1007 | "src/codec/SkIcoCodec.cpp", |
| 1008 | "src/codec/SkPngCodec.cpp", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1009 | ] |
| 1010 | } |
| 1011 | |
| 1012 | optional("png_encode") { |
| 1013 | enabled = skia_use_libpng_encode |
| 1014 | public_defines = [ "SK_ENCODE_PNG" ] |
| 1015 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1016 | deps = [ "//third_party/libpng" ] |
| 1017 | sources = [ "src/images/SkPngEncoder.cpp" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1018 | } |
| 1019 | |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 1020 | optional("raw") { |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1021 | enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 1022 | public_defines = [ "SK_CODEC_DECODES_RAW" ] |
| 1023 | |
| 1024 | deps = [ |
| 1025 | "//third_party/dng_sdk", |
| 1026 | "//third_party/libjpeg-turbo:libjpeg", |
| 1027 | "//third_party/piex", |
| 1028 | ] |
| 1029 | |
| 1030 | # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of |
| 1031 | # Skia. |
| 1032 | configs_to_remove = [ "//gn:no_exceptions" ] |
| 1033 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1034 | sources = [ "src/codec/SkRawCodec.cpp" ] |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 1035 | } |
| 1036 | |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 1037 | import("third_party/skcms/skcms.gni") |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 1038 | source_set("skcms") { |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 1039 | cflags = [] |
| 1040 | if (!is_win || is_clang) { |
| 1041 | cflags += [ |
| 1042 | "-w", |
| 1043 | "-std=c11", |
| 1044 | ] |
| 1045 | } |
| 1046 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1047 | public = [ "include/third_party/skcms/skcms.h" ] |
Brian Osman | ea236bf | 2019-04-29 10:28:22 -0400 | [diff] [blame] | 1048 | include_dirs = [ "include/third_party/skcms" ] |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 1049 | sources = rebase_path(skcms_sources, ".", "third_party/skcms") |
| 1050 | } |
| 1051 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 1052 | optional("typeface_freetype") { |
| 1053 | enabled = skia_use_freetype |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 1054 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1055 | deps = [ "//third_party/freetype2" ] |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 1056 | sources = [ |
| 1057 | "src/ports/SkFontHost_FreeType.cpp", |
| 1058 | "src/ports/SkFontHost_FreeType_common.cpp", |
Ben Wagner | 9d5c55c | 2020-06-27 12:52:14 -0400 | [diff] [blame] | 1059 | "src/ports/SkFontHost_FreeType_common.h", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 1060 | ] |
| 1061 | } |
| 1062 | |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1063 | optional("webp_decode") { |
| 1064 | enabled = skia_use_libwebp_decode |
| 1065 | public_defines = [ "SK_CODEC_DECODES_WEBP" ] |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 1066 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1067 | deps = [ "//third_party/libwebp" ] |
| 1068 | sources = [ "src/codec/SkWebpCodec.cpp" ] |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1069 | } |
| 1070 | |
| 1071 | optional("webp_encode") { |
| 1072 | enabled = skia_use_libwebp_encode |
| 1073 | public_defines = [ "SK_ENCODE_WEBP" ] |
| 1074 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1075 | deps = [ "//third_party/libwebp" ] |
| 1076 | sources = [ "src/images/SkWebpEncoder.cpp" ] |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 1077 | } |
| 1078 | |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 1079 | optional("wuffs") { |
| 1080 | enabled = skia_use_wuffs |
Nigel Tao | 5cfa719 | 2020-08-17 21:14:13 +1000 | [diff] [blame] | 1081 | public_defines = [ "SK_HAS_WUFFS_LIBRARY" ] |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 1082 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1083 | deps = [ "//third_party/wuffs" ] |
| 1084 | sources = [ "src/codec/SkWuffsCodec.cpp" ] |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 1085 | } |
| 1086 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1087 | optional("xml") { |
| 1088 | enabled = skia_use_expat |
Florin Malita | 442fff9 | 2016-11-08 16:07:52 +0000 | [diff] [blame] | 1089 | public_defines = [ "SK_XML" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1090 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1091 | deps = [ "//third_party/expat" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1092 | sources = [ |
Mike Klein | bd41bcc | 2017-02-09 16:38:15 -0500 | [diff] [blame] | 1093 | "src/svg/SkSVGCanvas.cpp", |
| 1094 | "src/svg/SkSVGDevice.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1095 | "src/xml/SkDOM.cpp", |
| 1096 | "src/xml/SkXMLParser.cpp", |
| 1097 | "src/xml/SkXMLWriter.cpp", |
| 1098 | ] |
| 1099 | } |
| 1100 | |
Mike Klein | 853d4ed | 2020-08-20 00:41:00 +0000 | [diff] [blame] | 1101 | optional("sksl_interpreter") { |
| 1102 | enabled = skia_enable_sksl_interpreter |
| 1103 | public_defines = [ "SK_ENABLE_SKSL_INTERPRETER" ] |
| 1104 | } |
| 1105 | |
Mike Klein | 613ad38 | 2019-06-06 11:42:02 -0500 | [diff] [blame] | 1106 | optional("skvm_jit") { |
Mike Klein | 13ec544 | 2020-08-14 07:36:54 -0500 | [diff] [blame] | 1107 | enabled = skia_enable_skvm_jit_when_possible |
| 1108 | public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ] |
Mike Klein | 2b54e83 | 2020-07-10 12:56:07 -0500 | [diff] [blame] | 1109 | if (skia_vtune_path != "") { |
| 1110 | public_defines += [ "SKVM_JIT_VTUNE" ] |
| 1111 | public_include_dirs = [ "$skia_vtune_path/include" ] |
| 1112 | libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ] |
| 1113 | } |
Mike Klein | 613ad38 | 2019-06-06 11:42:02 -0500 | [diff] [blame] | 1114 | } |
| 1115 | |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 1116 | if (skia_enable_gpu && skia_generate_workarounds) { |
| 1117 | action("workaround_list") { |
| 1118 | script = "tools/build_workaround_header.py" |
| 1119 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1120 | inputs = [ "src/gpu/gpu_workaround_list.txt" ] |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 1121 | |
| 1122 | # see comments in skia_compile_processors about out dir path shenanigans. |
| 1123 | output_file = |
Adrienne Walker | ab7181d | 2018-05-14 14:02:03 -0700 | [diff] [blame] | 1124 | rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir) |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 1125 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1126 | outputs = [ "$root_out_dir/$output_file" ] |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 1127 | args = [ |
| 1128 | "--output-file", |
| 1129 | "$output_file", |
| 1130 | ] |
| 1131 | |
| 1132 | foreach(file, inputs) { |
| 1133 | args += [ rebase_path(file, root_build_dir) ] |
| 1134 | } |
| 1135 | } |
| 1136 | } |
| 1137 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1138 | component("skia") { |
| 1139 | public_configs = [ ":skia_public" ] |
| 1140 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1141 | |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 1142 | public_deps = [ |
Ben Wagner | 32d5cfa | 2020-06-11 14:41:47 -0400 | [diff] [blame] | 1143 | ":fontmgr_FontConfigInterface", |
| 1144 | ":fontmgr_android", |
| 1145 | ":fontmgr_custom_directory", |
| 1146 | ":fontmgr_custom_embedded", |
| 1147 | ":fontmgr_custom_empty", |
| 1148 | ":fontmgr_fontconfig", |
| 1149 | ":fontmgr_fuchsia", |
| 1150 | ":fontmgr_mac_ct", |
| 1151 | ":fontmgr_win", |
| 1152 | ":fontmgr_win_gdi", |
Ben Wagner | e27ee6c | 2019-02-15 14:59:30 -0500 | [diff] [blame] | 1153 | ":gpu", |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 1154 | ":pdf", |
| 1155 | ":skcms", |
Robert Phillips | 9b00f1f | 2020-03-24 12:29:44 -0400 | [diff] [blame] | 1156 | ":xps", |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 1157 | ] |
| 1158 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1159 | deps = [ |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 1160 | ":android_utils", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 1161 | ":arm64", |
| 1162 | ":armv7", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 1163 | ":avx", |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 1164 | ":compile_processors", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 1165 | ":crc32", |
Ethan Nicholas | c18bb51 | 2020-07-28 14:46:53 -0400 | [diff] [blame] | 1166 | ":dehydrate_sksl", |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 1167 | ":fontmgr_factory", |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 1168 | ":gif", |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 1169 | ":heif", |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 1170 | ":hsw", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1171 | ":jpeg_decode", |
| 1172 | ":jpeg_encode", |
Leon Scroggins III | 326b989 | 2020-08-05 16:51:10 -0400 | [diff] [blame] | 1173 | ":ndk_images", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 1174 | ":none", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1175 | ":png_decode", |
| 1176 | ":png_encode", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 1177 | ":raw", |
Mike Klein | 853d4ed | 2020-08-20 00:41:00 +0000 | [diff] [blame] | 1178 | ":sksl_interpreter", |
Mike Klein | 613ad38 | 2019-06-06 11:42:02 -0500 | [diff] [blame] | 1179 | ":skvm_jit", |
Mike Klein | a9026da | 2020-06-05 08:57:05 -0500 | [diff] [blame] | 1180 | ":skx", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 1181 | ":sse2", |
| 1182 | ":sse41", |
| 1183 | ":sse42", |
| 1184 | ":ssse3", |
Leon Scroggins III | a77f30c | 2020-03-09 14:23:30 -0400 | [diff] [blame] | 1185 | ":webp_decode", |
| 1186 | ":webp_encode", |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 1187 | ":wuffs", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 1188 | ":xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1189 | ] |
| 1190 | |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1191 | public = skia_core_public |
| 1192 | public += skia_utils_public |
| 1193 | public += skia_effects_public |
| 1194 | public += skia_effects_imagefilter_public |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1195 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1196 | sources = [] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 1197 | sources += skia_core_sources |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 1198 | sources += skia_utils_sources |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 1199 | sources += skia_effects_sources |
| 1200 | sources += skia_effects_imagefilter_sources |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 1201 | sources += skia_sksl_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1202 | sources += [ |
Stan Iliev | 73d8fd9 | 2017-08-02 15:36:24 -0400 | [diff] [blame] | 1203 | "src/android/SkAndroidFrameworkUtils.cpp", |
Leon Scroggins III | 42ee284 | 2018-01-14 14:46:51 -0500 | [diff] [blame] | 1204 | "src/android/SkAnimatedImage.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1205 | "src/codec/SkAndroidCodec.cpp", |
Nigel Tao | 612a65d | 2018-11-09 10:10:31 +1100 | [diff] [blame] | 1206 | "src/codec/SkAndroidCodecAdapter.cpp", |
Leon Scroggins III | d81fed9 | 2017-06-01 13:42:28 -0400 | [diff] [blame] | 1207 | "src/codec/SkBmpBaseCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 1208 | "src/codec/SkBmpCodec.cpp", |
| 1209 | "src/codec/SkBmpMaskCodec.cpp", |
| 1210 | "src/codec/SkBmpRLECodec.cpp", |
| 1211 | "src/codec/SkBmpStandardCodec.cpp", |
| 1212 | "src/codec/SkCodec.cpp", |
| 1213 | "src/codec/SkCodecImageGenerator.cpp", |
Leon Scroggins III | 22f673d | 2018-05-30 15:33:46 -0400 | [diff] [blame] | 1214 | "src/codec/SkColorTable.cpp", |
Leon Scroggins III | 36f7e32 | 2018-08-27 11:55:46 -0400 | [diff] [blame] | 1215 | "src/codec/SkEncodedInfo.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 1216 | "src/codec/SkMaskSwizzler.cpp", |
| 1217 | "src/codec/SkMasks.cpp", |
Leon Scroggins III | ba45830 | 2019-09-24 12:40:11 -0400 | [diff] [blame] | 1218 | "src/codec/SkParseEncodedOrigin.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1219 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 1220 | "src/codec/SkSampler.cpp", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 1221 | "src/codec/SkStreamBuffer.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 1222 | "src/codec/SkSwizzler.cpp", |
| 1223 | "src/codec/SkWbmpCodec.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1224 | "src/images/SkImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1225 | "src/ports/SkDiscardableMemory_none.cpp", |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 1226 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 1227 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1228 | "src/ports/SkMemory_malloc.cpp", |
| 1229 | "src/ports/SkOSFile_stdio.cpp", |
| 1230 | "src/sfnt/SkOTTable_name.cpp", |
| 1231 | "src/sfnt/SkOTUtils.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1232 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 1233 | |
Kevin Lubick | 32dfdbe | 2018-10-18 09:47:01 -0400 | [diff] [blame] | 1234 | defines = [] |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1235 | libs = [] |
| 1236 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1237 | if (is_win) { |
| 1238 | sources += [ |
| 1239 | "src/ports/SkDebug_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1240 | "src/ports/SkImageEncoder_WIC.cpp", |
| 1241 | "src/ports/SkImageGeneratorWIC.cpp", |
| 1242 | "src/ports/SkOSFile_win.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 1243 | "src/ports/SkOSLibrary_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1244 | ] |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 1245 | libs += [ |
| 1246 | "FontSub.lib", |
| 1247 | "Ole32.lib", |
| 1248 | "OleAut32.lib", |
| 1249 | "User32.lib", |
Mike Klein | 0c5fdcb | 2017-11-13 12:40:46 -0500 | [diff] [blame] | 1250 | "Usp10.lib", |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 1251 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1252 | } else { |
| 1253 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1254 | "src/ports/SkOSFile_posix.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 1255 | "src/ports/SkOSLibrary_posix.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1256 | ] |
Ben Wagner | be6ae5b | 2017-08-31 16:45:23 -0400 | [diff] [blame] | 1257 | libs += [ "dl" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1258 | } |
| 1259 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1260 | if (is_android) { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 1261 | deps += [ "//third_party/expat" ] |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 1262 | if (defined(ndk) && ndk != "") { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 1263 | deps += [ "//third_party/cpu-features" ] |
| 1264 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1265 | sources += [ "src/ports/SkDebug_android.cpp" ] |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1266 | libs += [ |
| 1267 | "EGL", |
| 1268 | "GLESv2", |
| 1269 | "log", |
| 1270 | ] |
| 1271 | } |
| 1272 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1273 | if (is_linux || target_cpu == "wasm") { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1274 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
Hal Canary | 25375e8 | 2018-03-14 15:16:56 -0400 | [diff] [blame] | 1275 | if (skia_use_egl) { |
| 1276 | libs += [ "GLESv2" ] |
| 1277 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1278 | } |
| 1279 | |
| 1280 | if (is_mac) { |
| 1281 | sources += [ |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1282 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1283 | "src/ports/SkImageEncoder_CG.cpp", |
| 1284 | "src/ports/SkImageGeneratorCG.cpp", |
| 1285 | ] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 1286 | frameworks = [ |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 1287 | "ApplicationServices.framework", |
| 1288 | "OpenGL.framework", |
| 1289 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1290 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1291 | |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1292 | if (is_ios) { |
| 1293 | sources += [ |
| 1294 | "src/ports/SkDebug_stdio.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1295 | "src/ports/SkImageEncoder_CG.cpp", |
| 1296 | "src/ports/SkImageGeneratorCG.cpp", |
| 1297 | ] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 1298 | frameworks = [ |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1299 | "CoreFoundation.framework", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1300 | "ImageIO.framework", |
| 1301 | "MobileCoreServices.framework", |
| 1302 | ] |
| 1303 | } |
| 1304 | |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1305 | if (is_fuchsia) { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1306 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1307 | } |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 1308 | |
| 1309 | if (skia_enable_spirv_validation) { |
Stephen White | 238fc24 | 2019-08-26 10:19:23 -0400 | [diff] [blame] | 1310 | deps += [ "//third_party/spirv-tools:spvtools_val" ] |
Brian Osman | fb32ddf | 2019-06-18 10:14:20 -0400 | [diff] [blame] | 1311 | defines += [ "SK_ENABLE_SPIRV_VALIDATION" ] |
| 1312 | } |
Nathaniel Nifong | 0c4fbf1 | 2019-06-25 15:48:47 -0400 | [diff] [blame] | 1313 | |
| 1314 | if (skia_include_multiframe_procs) { |
| 1315 | sources += [ "tools/SkSharingProc.cpp" ] |
| 1316 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1317 | } |
| 1318 | |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1319 | # DebugCanvas used in experimental/wasm-skp-debugger |
| 1320 | if (target_cpu == "wasm") { |
| 1321 | static_library("debugcanvas") { |
| 1322 | public_configs = [ ":skia_public" ] |
| 1323 | |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1324 | sources = [ |
Nathaniel Nifong | 0426c38 | 2019-06-21 11:09:19 -0400 | [diff] [blame] | 1325 | "tools/SkSharingProc.cpp", |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1326 | "tools/UrlDataManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1327 | "tools/debugger/DebugCanvas.cpp", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 1328 | "tools/debugger/DebugLayerManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1329 | "tools/debugger/DrawCommand.cpp", |
| 1330 | "tools/debugger/JsonWriteBuffer.cpp", |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1331 | ] |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1332 | } |
| 1333 | } |
| 1334 | |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1335 | static_library("pathkit") { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1336 | check_includes = false |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1337 | public_configs = [ ":skia_public" ] |
| 1338 | configs += skia_library_configs |
| 1339 | |
| 1340 | deps = [ |
| 1341 | ":arm64", |
| 1342 | ":armv7", |
| 1343 | ":avx", |
| 1344 | ":crc32", |
| 1345 | ":hsw", |
| 1346 | ":none", |
| 1347 | ":sse2", |
| 1348 | ":sse41", |
| 1349 | ":sse42", |
| 1350 | ":ssse3", |
| 1351 | ] |
| 1352 | |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1353 | sources = [] |
| 1354 | sources += skia_pathops_sources |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1355 | sources += skia_pathops_public |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1356 | sources += [ |
| 1357 | "src/core/SkAnalyticEdge.cpp", |
| 1358 | "src/core/SkArenaAlloc.cpp", |
Mike Reed | cc88f3a | 2019-02-06 11:40:27 -0500 | [diff] [blame] | 1359 | "src/core/SkContourMeasure.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1360 | "src/core/SkCubicMap.cpp", |
| 1361 | "src/core/SkEdge.cpp", |
| 1362 | "src/core/SkEdgeBuilder.cpp", |
| 1363 | "src/core/SkEdgeClipper.cpp", |
| 1364 | "src/core/SkGeometry.cpp", |
Brian Salomon | 71fe945 | 2020-03-02 16:59:40 -0500 | [diff] [blame] | 1365 | "src/core/SkIDChangeListener.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1366 | "src/core/SkLineClipper.cpp", |
Hal Canary | 7823aeb | 2019-10-30 17:26:45 -0400 | [diff] [blame] | 1367 | "src/core/SkMalloc.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1368 | "src/core/SkMallocPixelRef.cpp", |
| 1369 | "src/core/SkMath.cpp", |
| 1370 | "src/core/SkMatrix.cpp", |
| 1371 | "src/core/SkOpts.cpp", |
| 1372 | "src/core/SkPaint.cpp", |
| 1373 | "src/core/SkPath.cpp", |
Mike Reed | 06d7c9d | 2020-08-26 12:56:51 -0400 | [diff] [blame] | 1374 | "src/core/SkPathBuilder.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1375 | "src/core/SkPathEffect.cpp", |
| 1376 | "src/core/SkPathMeasure.cpp", |
| 1377 | "src/core/SkPathRef.cpp", |
| 1378 | "src/core/SkPoint.cpp", |
| 1379 | "src/core/SkRRect.cpp", |
Mike Klein | 45f36b5 | 2020-06-08 14:10:29 -0500 | [diff] [blame] | 1380 | "src/core/SkReadBuffer.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1381 | "src/core/SkRect.cpp", |
| 1382 | "src/core/SkSemaphore.cpp", |
| 1383 | "src/core/SkStream.cpp", |
| 1384 | "src/core/SkString.cpp", |
| 1385 | "src/core/SkStringUtils.cpp", |
| 1386 | "src/core/SkStroke.cpp", |
| 1387 | "src/core/SkStrokeRec.cpp", |
| 1388 | "src/core/SkStrokerPriv.cpp", |
| 1389 | "src/core/SkThreadID.cpp", |
| 1390 | "src/core/SkUtils.cpp", |
| 1391 | "src/effects/SkDashPathEffect.cpp", |
| 1392 | "src/effects/SkTrimPathEffect.cpp", |
| 1393 | "src/ports/SkDebug_stdio.cpp", |
| 1394 | "src/ports/SkMemory_malloc.cpp", |
| 1395 | "src/utils/SkDashPath.cpp", |
| 1396 | "src/utils/SkParse.cpp", |
| 1397 | "src/utils/SkParsePath.cpp", |
| 1398 | "src/utils/SkUTF.cpp", |
| 1399 | ] |
| 1400 | } |
| 1401 | |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1402 | group("modules") { |
| 1403 | deps = [ |
Kevin Lubick | 9663484 | 2019-03-05 14:09:24 -0500 | [diff] [blame] | 1404 | "modules/particles", |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1405 | "modules/skottie", |
Mike Reed | 63559a5 | 2020-06-02 11:34:24 -0400 | [diff] [blame] | 1406 | "modules/skparagraph", |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1407 | "modules/skshaper", |
| 1408 | ] |
| 1409 | } |
| 1410 | |
Brian Osman | cd28fa6 | 2020-07-07 16:01:26 -0400 | [diff] [blame] | 1411 | config("our_vulkan_headers") { |
| 1412 | include_dirs = [ "include/third_party/vulkan" ] |
| 1413 | } |
| 1414 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1415 | # Targets guarded by skia_enable_tools may use //third_party freely. |
| 1416 | if (skia_enable_tools) { |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1417 | skia_public_includes = [ |
Leon Scroggins III | 63cfb36 | 2020-04-24 13:00:48 -0400 | [diff] [blame] | 1418 | "client_utils/android", |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1419 | "include/android", |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1420 | "include/c", |
| 1421 | "include/codec", |
| 1422 | "include/config", |
| 1423 | "include/core", |
| 1424 | "include/docs", |
| 1425 | "include/effects", |
| 1426 | "include/encode", |
| 1427 | "include/gpu", |
| 1428 | "include/pathops", |
| 1429 | "include/ports", |
| 1430 | "include/svg", |
| 1431 | "include/utils", |
| 1432 | "include/utils/mac", |
Julia Lavrova | 70258c7 | 2020-07-15 11:28:57 -0400 | [diff] [blame] | 1433 | "modules/skparagraph/include", |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1434 | "modules/skshaper/include", |
| 1435 | "modules/skottie/include", |
| 1436 | ] |
| 1437 | |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 1438 | # Used by gn_to_bp.py to list our public include dirs. |
| 1439 | source_set("public") { |
| 1440 | configs += [ ":skia_public" ] |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1441 | include_dirs = skia_public_includes |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 1442 | } |
| 1443 | |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1444 | config("skia.h_config") { |
| 1445 | include_dirs = [ "$target_gen_dir" ] |
| 1446 | } |
| 1447 | action("skia.h") { |
| 1448 | public_configs = [ ":skia.h_config" ] |
| 1449 | skia_h = "$target_gen_dir/skia.h" |
| 1450 | script = "gn/find_headers.py" |
Florin Malita | 6e4d95f | 2018-05-30 09:27:32 -0400 | [diff] [blame] | 1451 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1452 | args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] + |
| 1453 | [ rebase_path(skia_h, root_build_dir) ] + |
| 1454 | rebase_path(skia_public_includes) |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1455 | depfile = "$skia_h.deps" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1456 | outputs = [ skia_h ] |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1457 | } |
| 1458 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1459 | if (target_cpu == "x64") { |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1460 | executable("fiddle") { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1461 | check_includes = false |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1462 | libs = [] |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1463 | sources = [ |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1464 | "tools/fiddle/draw.cpp", |
| 1465 | "tools/fiddle/fiddle_main.cpp", |
| 1466 | ] |
Joe Gregorio | a8fabd3 | 2017-05-31 09:45:19 -0400 | [diff] [blame] | 1467 | |
| 1468 | if (skia_use_egl) { |
| 1469 | sources += [ "tools/fiddle/egl_context.cpp" ] |
Joe Gregorio | a8fabd3 | 2017-05-31 09:45:19 -0400 | [diff] [blame] | 1470 | } else { |
| 1471 | sources += [ "tools/fiddle/null_context.cpp" ] |
| 1472 | } |
Joe Gregorio | 1e735c0 | 2017-04-19 14:05:14 -0400 | [diff] [blame] | 1473 | testonly = true |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1474 | deps = [ |
Joe Gregorio | 1e735c0 | 2017-04-19 14:05:14 -0400 | [diff] [blame] | 1475 | ":flags", |
Robert Phillips | 57e0828 | 2017-11-16 14:59:48 -0500 | [diff] [blame] | 1476 | ":gpu_tool_utils", |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1477 | ":skia", |
| 1478 | ":skia.h", |
Florin Malita | 6e4d95f | 2018-05-30 09:27:32 -0400 | [diff] [blame] | 1479 | "modules/skottie", |
Florin Malita | a1dcaae | 2019-03-25 17:38:43 -0400 | [diff] [blame] | 1480 | "modules/skshaper", |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1481 | ] |
| 1482 | } |
| 1483 | } |
| 1484 | |
Mike Klein | e5463e6 | 2020-06-11 13:53:53 -0500 | [diff] [blame] | 1485 | config("cpp14") { |
| 1486 | if (is_win) { |
| 1487 | cflags_cc = [ "/std:c++14" ] |
| 1488 | } else { |
| 1489 | cflags_cc = [ "-std=c++14" ] |
| 1490 | } |
| 1491 | } |
| 1492 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1493 | source_set("public_headers_warnings_check") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1494 | sources = [ "tools/public_headers_warnings_check.cpp" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1495 | configs -= [ "//gn:warnings_except_public_headers" ] |
Mike Klein | e5463e6 | 2020-06-11 13:53:53 -0500 | [diff] [blame] | 1496 | configs += [ |
| 1497 | ":our_vulkan_headers", |
| 1498 | ":cpp14", |
| 1499 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1500 | deps = [ |
| 1501 | ":skia", |
| 1502 | ":skia.h", |
| 1503 | "modules/skottie", |
Florin Malita | a1dcaae | 2019-03-25 17:38:43 -0400 | [diff] [blame] | 1504 | "modules/skshaper", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1505 | ] |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 1506 | |
| 1507 | if (skia_use_dawn) { |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 1508 | deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ] |
Stephen White | 0d70b71 | 2019-07-10 15:51:30 -0400 | [diff] [blame] | 1509 | } |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1510 | } |
| 1511 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1512 | template("test_lib") { |
| 1513 | config(target_name + "_config") { |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 1514 | if (defined(invoker.public_defines)) { |
| 1515 | defines = invoker.public_defines |
| 1516 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1517 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1518 | source_set(target_name) { |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 1519 | forward_variables_from(invoker, "*", []) |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1520 | check_includes = false |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1521 | public_configs = [ |
| 1522 | ":" + target_name + "_config", |
| 1523 | ":skia_private", |
| 1524 | ] |
| 1525 | |
| 1526 | if (!defined(deps)) { |
| 1527 | deps = [] |
| 1528 | } |
| 1529 | deps += [ ":skia" ] |
| 1530 | testonly = true |
| 1531 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1532 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1533 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1534 | template("test_app") { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1535 | if (is_ios) { |
Hal Canary | 3388c1a | 2019-09-16 12:53:17 -0400 | [diff] [blame] | 1536 | ios_app_bundle(target_name) { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1537 | forward_variables_from(invoker, |
| 1538 | "*", |
| 1539 | [ |
| 1540 | "output_name", |
| 1541 | "visibility", |
| 1542 | "is_shared_library", |
| 1543 | ]) |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1544 | testonly = true |
Hal Canary | 3388c1a | 2019-09-16 12:53:17 -0400 | [diff] [blame] | 1545 | extra_configs = [ ":skia_private" ] |
| 1546 | launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard" |
| 1547 | data_sources = [ "resources" ] |
| 1548 | if ("True" == exec_script("//gn/checkdir.py", |
| 1549 | [ rebase_path("skps", root_build_dir) ], |
| 1550 | "trim string")) { |
| 1551 | data_sources += [ "skps" ] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1552 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1553 | } |
| 1554 | } else { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1555 | # !is_ios |
| 1556 | |
Jim Van Verth | 92411c7 | 2020-04-03 15:18:31 -0400 | [diff] [blame] | 1557 | output_dir = root_build_dir |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1558 | if (defined(invoker.is_shared_library) && invoker.is_shared_library) { |
| 1559 | shared_library("lib" + target_name) { |
| 1560 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 1561 | configs += [ ":skia_private" ] |
| 1562 | testonly = true |
| 1563 | } |
| 1564 | } else { |
| 1565 | _executable = target_name |
| 1566 | executable(_executable) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1567 | check_includes = false |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1568 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 1569 | configs += [ ":skia_private" ] |
| 1570 | testonly = true |
| 1571 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1572 | } |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1573 | if (is_android && skia_android_serial != "" && defined(_executable)) { |
| 1574 | action("push_" + target_name) { |
| 1575 | script = "gn/push_to_android.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1576 | deps = [ ":" + _executable ] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1577 | _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1578 | outputs = [ _stamp ] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1579 | args = [ |
| 1580 | rebase_path("$root_build_dir/$_executable"), |
| 1581 | skia_android_serial, |
| 1582 | rebase_path(_stamp), |
| 1583 | ] |
| 1584 | testonly = true |
| 1585 | } |
Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame] | 1586 | } |
| 1587 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1588 | } |
| 1589 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1590 | test_lib("gpu_tool_utils") { |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1591 | public_defines = [] |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 1592 | |
Mike Klein | 9e25bb9 | 2019-04-29 09:46:36 -0500 | [diff] [blame] | 1593 | # Bots and even devs may not have Vulkan headers, so put |
| 1594 | # include/third_party/vulkan on our path so they're always available. |
| 1595 | all_dependent_configs = [ ":our_vulkan_headers" ] |
| 1596 | |
Mike Klein | 333fb45 | 2019-04-24 08:48:11 -0500 | [diff] [blame] | 1597 | defines = [] |
| 1598 | if (skia_enable_discrete_gpu) { |
| 1599 | defines += [ "SK_ENABLE_DISCRETE_GPU" ] |
| 1600 | } |
| 1601 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1602 | deps = [] |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1603 | public_deps = [] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1604 | sources = [ |
Brian Salomon | 72c7b98 | 2020-10-06 10:07:38 -0400 | [diff] [blame] | 1605 | "tools/gpu/BackendSurfaceFactory.cpp", |
| 1606 | "tools/gpu/BackendSurfaceFactory.h", |
Brian Salomon | 63a0a75 | 2020-06-26 13:32:09 -0400 | [diff] [blame] | 1607 | "tools/gpu/BackendTextureImageFactory.cpp", |
| 1608 | "tools/gpu/BackendTextureImageFactory.h", |
Robert Phillips | 00f78de | 2020-07-01 16:09:43 -0400 | [diff] [blame] | 1609 | "tools/gpu/FlushFinishTracker.cpp", |
| 1610 | "tools/gpu/FlushFinishTracker.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1611 | "tools/gpu/GrContextFactory.cpp", |
| 1612 | "tools/gpu/GrTest.cpp", |
Brian Salomon | f9b0042 | 2020-10-08 16:00:14 -0400 | [diff] [blame] | 1613 | "tools/gpu/ManagedBackendTexture.cpp", |
| 1614 | "tools/gpu/ManagedBackendTexture.h", |
Brian Salomon | 00a5eb8 | 2018-07-11 15:32:05 -0400 | [diff] [blame] | 1615 | "tools/gpu/MemoryCache.cpp", |
| 1616 | "tools/gpu/MemoryCache.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1617 | "tools/gpu/ProxyUtils.cpp", |
| 1618 | "tools/gpu/TestContext.cpp", |
Brian Salomon | e21af50 | 2019-11-22 16:56:36 -0500 | [diff] [blame] | 1619 | "tools/gpu/TestOps.cpp", |
| 1620 | "tools/gpu/TestOps.h", |
Michael Ludwig | d9958f8 | 2019-03-21 13:08:36 -0400 | [diff] [blame] | 1621 | "tools/gpu/YUVUtils.cpp", |
| 1622 | "tools/gpu/YUVUtils.h", |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1623 | "tools/gpu/gl/GLTestContext.cpp", # See comment below about |
| 1624 | # GrContextFactory workaround. |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1625 | "tools/gpu/mock/MockTestContext.cpp", |
| 1626 | ] |
Brian Salomon | 1171d31 | 2020-03-19 08:47:44 -0400 | [diff] [blame] | 1627 | |
| 1628 | libs = [] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 1629 | frameworks = [] |
Brian Salomon | 1171d31 | 2020-03-19 08:47:44 -0400 | [diff] [blame] | 1630 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1631 | if (skia_use_gl) { |
Herb Derby | 64aa513 | 2020-06-03 12:14:55 -0400 | [diff] [blame] | 1632 | sources += |
| 1633 | [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1634 | if (is_ios) { |
| 1635 | sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 1636 | frameworks += [ "OpenGLES.framework" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1637 | } else if (is_mac) { |
| 1638 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
Brian Osman | 0c75727 | 2018-12-10 10:27:26 -0500 | [diff] [blame] | 1639 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1640 | if (skia_use_angle) { |
| 1641 | deps += [ "//third_party/angle2" ] |
| 1642 | sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ] |
| 1643 | } |
Brian Salomon | 1171d31 | 2020-03-19 08:47:44 -0400 | [diff] [blame] | 1644 | } |
| 1645 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1646 | # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in |
| 1647 | # in GrContextFactory. This only matters for OSes that can run Vulkan. |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1648 | if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") { |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1649 | if (is_android || skia_use_egl) { |
| 1650 | sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] |
| 1651 | libs += [ "EGL" ] |
| 1652 | } else if (is_linux) { |
| 1653 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
| 1654 | libs += [ |
| 1655 | "GLU", |
| 1656 | "GL", |
| 1657 | "X11", |
| 1658 | ] |
| 1659 | } else if (is_win) { |
| 1660 | sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ] |
| 1661 | libs += [ "Gdi32.lib" ] |
| 1662 | if (target_cpu != "arm64") { |
| 1663 | libs += [ "OpenGL32.lib" ] |
| 1664 | } |
| 1665 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1666 | } |
Greg Daniel | 54200e4 | 2018-12-11 17:03:39 -0500 | [diff] [blame] | 1667 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1668 | if (skia_use_vulkan) { |
Robert Phillips | ae413d8 | 2020-06-10 11:04:51 -0400 | [diff] [blame] | 1669 | sources += [ "tools/gpu/vk/VkTestContext.h" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1670 | sources += [ "tools/gpu/vk/VkTestContext.cpp" ] |
Robert Phillips | 0d6ce7c | 2020-06-11 08:51:50 -0400 | [diff] [blame] | 1671 | sources += [ "tools/gpu/vk/VkTestHelper.h" ] |
| 1672 | sources += [ "tools/gpu/vk/VkTestHelper.cpp" ] |
Robert Phillips | ae413d8 | 2020-06-10 11:04:51 -0400 | [diff] [blame] | 1673 | sources += [ "tools/gpu/vk/VkTestUtils.h" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1674 | sources += [ "tools/gpu/vk/VkTestUtils.cpp" ] |
Robert Phillips | ae413d8 | 2020-06-10 11:04:51 -0400 | [diff] [blame] | 1675 | sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ] |
| 1676 | sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1677 | } |
| 1678 | if (skia_use_metal) { |
| 1679 | sources += [ "tools/gpu/mtl/MtlTestContext.mm" ] |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 1680 | } |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 1681 | if (skia_use_direct3d) { |
| 1682 | sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ] |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 1683 | sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ] |
Jim Van Verth | b01e12b | 2020-02-18 14:34:38 -0500 | [diff] [blame] | 1684 | } |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 1685 | if (skia_use_dawn) { |
Zhenyao Mo | 4f17b60 | 2020-04-13 15:26:17 -0700 | [diff] [blame] | 1686 | public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ] |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 1687 | sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ] |
Stephen White | 3ae5b29 | 2020-06-01 15:45:56 -0400 | [diff] [blame] | 1688 | if (is_clang) { |
| 1689 | cflags_cc = [ "-Wno-microsoft-cast" ] |
| 1690 | } |
Stephen White | 985741a | 2019-07-18 11:43:45 -0400 | [diff] [blame] | 1691 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 1692 | |
| 1693 | if (is_fuchsia && using_fuchsia_sdk) { |
| 1694 | libs += |
| 1695 | [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] |
| 1696 | } |
Jim Van Verth | 36b86af | 2020-08-24 17:16:46 +0000 | [diff] [blame] | 1697 | |
| 1698 | cflags_objcc = [ "-fobjc-arc" ] |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 1699 | } # test_lib("gpu_tool_utils") |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1700 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1701 | test_lib("flags") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1702 | sources = [ "tools/flags/CommandLineFlags.cpp" ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1703 | } |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1704 | |
| 1705 | test_lib("common_flags_config") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1706 | sources = [ "tools/flags/CommonFlagsConfig.cpp" ] |
| 1707 | deps = [ ":flags" ] |
| 1708 | public_deps = [ ":gpu_tool_utils" ] |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1709 | } |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1710 | test_lib("common_flags_gpu") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1711 | sources = [ "tools/flags/CommonFlagsGpu.cpp" ] |
| 1712 | deps = [ ":flags" ] |
| 1713 | public_deps = [ ":gpu_tool_utils" ] |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1714 | } |
| 1715 | test_lib("common_flags_images") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1716 | sources = [ "tools/flags/CommonFlagsImages.cpp" ] |
| 1717 | deps = [ ":flags" ] |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1718 | } |
| 1719 | test_lib("common_flags_aa") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1720 | sources = [ "tools/flags/CommonFlagsAA.cpp" ] |
| 1721 | deps = [ ":flags" ] |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 1722 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1723 | |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 1724 | test_lib("trace") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1725 | deps = [ ":flags" ] |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 1726 | sources = [ |
| 1727 | "tools/trace/ChromeTracingTracer.cpp", |
| 1728 | "tools/trace/ChromeTracingTracer.h", |
| 1729 | "tools/trace/EventTracingPriv.cpp", |
| 1730 | "tools/trace/EventTracingPriv.h", |
| 1731 | "tools/trace/SkDebugfTracer.cpp", |
| 1732 | "tools/trace/SkDebugfTracer.h", |
| 1733 | ] |
| 1734 | } |
| 1735 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1736 | test_lib("tool_utils") { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1737 | sources = [ |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 1738 | "tools/AndroidSkDebugToStdOut.cpp", |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 1739 | "tools/AutoreleasePool.h", |
Robert Phillips | 9660108 | 2018-05-29 16:13:26 -0400 | [diff] [blame] | 1740 | "tools/DDLPromiseImageHelper.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1741 | "tools/DDLPromiseImageHelper.h", |
Robert Phillips | 9660108 | 2018-05-29 16:13:26 -0400 | [diff] [blame] | 1742 | "tools/DDLTileHelper.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1743 | "tools/DDLTileHelper.h", |
mtklein | 0590fa5 | 2016-09-01 07:06:54 -0700 | [diff] [blame] | 1744 | "tools/LsanSuppressions.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1745 | "tools/ProcStats.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1746 | "tools/ProcStats.h", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1747 | "tools/Resources.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1748 | "tools/Resources.h", |
Hal Canary | e574f1e | 2019-07-15 14:01:37 -0400 | [diff] [blame] | 1749 | "tools/SkMetaData.cpp", |
| 1750 | "tools/SkMetaData.h", |
Nathaniel Nifong | 0426c38 | 2019-06-21 11:09:19 -0400 | [diff] [blame] | 1751 | "tools/SkSharingProc.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1752 | "tools/SkSharingProc.h", |
| 1753 | "tools/Stats.h", |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 1754 | "tools/ToolUtils.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1755 | "tools/ToolUtils.h", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1756 | "tools/UrlDataManager.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1757 | "tools/UrlDataManager.h", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1758 | "tools/debugger/DebugCanvas.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1759 | "tools/debugger/DebugCanvas.h", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 1760 | "tools/debugger/DebugLayerManager.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1761 | "tools/debugger/DebugLayerManager.h", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1762 | "tools/debugger/DrawCommand.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1763 | "tools/debugger/DrawCommand.h", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 1764 | "tools/debugger/JsonWriteBuffer.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1765 | "tools/debugger/JsonWriteBuffer.h", |
Mike Klein | 0cffcbf9 | 2019-03-20 11:08:46 -0500 | [diff] [blame] | 1766 | "tools/fonts/RandomScalerContext.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1767 | "tools/fonts/RandomScalerContext.h", |
Mike Klein | 0cffcbf9 | 2019-03-20 11:08:46 -0500 | [diff] [blame] | 1768 | "tools/fonts/TestEmptyTypeface.h", |
| 1769 | "tools/fonts/TestFontMgr.cpp", |
| 1770 | "tools/fonts/TestFontMgr.h", |
| 1771 | "tools/fonts/TestSVGTypeface.cpp", |
| 1772 | "tools/fonts/TestSVGTypeface.h", |
| 1773 | "tools/fonts/TestTypeface.cpp", |
| 1774 | "tools/fonts/TestTypeface.h", |
Mike Klein | ea3f014 | 2019-03-20 11:12:10 -0500 | [diff] [blame] | 1775 | "tools/fonts/ToolUtilsFont.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1776 | "tools/random_parse_path.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1777 | "tools/random_parse_path.h", |
Hal Canary | 4124807 | 2019-07-11 16:32:53 -0400 | [diff] [blame] | 1778 | "tools/timer/TimeUtils.h", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1779 | "tools/timer/Timer.cpp", |
John Stiles | affae53 | 2020-07-13 18:06:53 -0400 | [diff] [blame] | 1780 | "tools/timer/Timer.h", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1781 | ] |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1782 | if (target_cpu != "wasm") { |
| 1783 | sources += [ "tools/CrashHandler.cpp" ] |
| 1784 | } |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 1785 | libs = [] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 1786 | frameworks = [] |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 1787 | if (is_ios) { |
| 1788 | sources += [ "tools/ios_utils.m" ] |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 1789 | sources += [ "tools/ios_utils.h" ] |
| 1790 | if (skia_use_metal) { |
| 1791 | sources += [ "tools/AutoreleasePool.mm" ] |
| 1792 | } |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 1793 | frameworks += [ "Foundation.framework" ] |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 1794 | } else if (is_mac) { |
| 1795 | if (skia_use_metal) { |
| 1796 | sources += [ "tools/AutoreleasePool.mm" ] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 1797 | frameworks += [ "Foundation.framework" ] |
Jim Van Verth | 8a9a371 | 2019-05-31 10:49:12 -0400 | [diff] [blame] | 1798 | } |
Mike Klein | bf15b66 | 2019-04-15 11:32:16 -0500 | [diff] [blame] | 1799 | } else if (is_win) { |
| 1800 | libs += [ "DbgHelp.lib" ] |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 1801 | } |
Mike Klein | bf15b66 | 2019-04-15 11:32:16 -0500 | [diff] [blame] | 1802 | |
Hal Canary | fd9bcab | 2018-04-24 11:47:23 -0400 | [diff] [blame] | 1803 | defines = [] |
| 1804 | if (skia_tools_require_resources) { |
| 1805 | defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ] |
| 1806 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1807 | deps = [ |
| 1808 | ":flags", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 1809 | "modules/svg", |
Mike Klein | e4ad58a | 2019-03-26 09:05:52 -0500 | [diff] [blame] | 1810 | ] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1811 | public_deps = [ ":gpu_tool_utils" ] |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1812 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1813 | |
Mike Klein | e11e5c1 | 2019-04-24 12:46:06 -0500 | [diff] [blame] | 1814 | test_lib("etc1") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1815 | sources = [ "third_party/etc1/etc1.cpp" ] |
Mike Klein | e11e5c1 | 2019-04-24 12:46:06 -0500 | [diff] [blame] | 1816 | } |
| 1817 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1818 | import("gn/gm.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1819 | test_lib("gm") { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1820 | sources = gm_sources |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 1821 | if (skia_use_gl) { |
| 1822 | sources += gl_gm_sources |
| 1823 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1824 | deps = [ |
Mike Klein | e11e5c1 | 2019-04-24 12:46:06 -0500 | [diff] [blame] | 1825 | ":etc1", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 1826 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1827 | ":skia", |
| 1828 | ":tool_utils", |
Mike Reed | 2f0edd5 | 2018-05-31 14:22:30 -0400 | [diff] [blame] | 1829 | "modules/skottie", |
Florin Malita | 2687072 | 2018-09-20 14:35:30 -0400 | [diff] [blame] | 1830 | "modules/skottie:gm", |
Mike Reed | 63559a5 | 2020-06-02 11:34:24 -0400 | [diff] [blame] | 1831 | "modules/skparagraph", |
| 1832 | "modules/skparagraph:gm", |
Brian Osman | c725e8f | 2019-04-10 14:08:44 -0400 | [diff] [blame] | 1833 | "modules/skshaper", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1834 | ] |
Mike Klein | c4abade | 2019-08-09 10:11:35 -0400 | [diff] [blame] | 1835 | if (is_skia_dev_build) { |
| 1836 | sources += [ "gm/fiddle.cpp" ] |
| 1837 | deps += [ ":skia.h" ] |
| 1838 | } |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1839 | public_deps = [ ":gpu_tool_utils" ] |
Mike Reed | 7bf160e | 2019-05-17 16:50:51 -0400 | [diff] [blame] | 1840 | |
| 1841 | if (skia_use_ffmpeg) { |
Florin Malita | 123e3b8 | 2020-04-24 11:10:27 -0400 | [diff] [blame] | 1842 | deps += [ "experimental/ffmpeg:video_decoder" ] |
Mike Reed | 7bf160e | 2019-05-17 16:50:51 -0400 | [diff] [blame] | 1843 | sources += [ "gm/video_decoder.cpp" ] |
| 1844 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1845 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1846 | |
Mike Klein | 7b7077c | 2019-06-03 17:10:59 -0500 | [diff] [blame] | 1847 | test_lib("skvm_builders") { |
| 1848 | sources = [ |
| 1849 | "tools/SkVMBuilders.cpp", |
| 1850 | "tools/SkVMBuilders.h", |
| 1851 | ] |
| 1852 | } |
| 1853 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1854 | import("gn/tests.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1855 | test_lib("tests") { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1856 | sources = tests_sources + pathops_tests_sources |
Chinmay Garde | 3ee25e9 | 2020-09-01 15:10:14 -0700 | [diff] [blame] | 1857 | frameworks = [] |
Robert Phillips | 0c6daf0 | 2019-05-16 12:43:11 -0400 | [diff] [blame] | 1858 | if (skia_use_metal) { |
| 1859 | sources += metal_tests_sources |
Jim Van Verth | 36b86af | 2020-08-24 17:16:46 +0000 | [diff] [blame] | 1860 | cflags_objcc = [ "-fobjc-arc" ] |
Chinmay Garde | 3ee25e9 | 2020-09-01 15:10:14 -0700 | [diff] [blame] | 1861 | frameworks += [ "MetalKit.framework" ] |
Robert Phillips | 0c6daf0 | 2019-05-16 12:43:11 -0400 | [diff] [blame] | 1862 | } |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 1863 | if (skia_use_gl) { |
| 1864 | sources += gl_tests_sources |
| 1865 | } |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 1866 | if (!skia_enable_fontmgr_android) { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1867 | sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 1868 | } |
Ben Wagner | 75626e4 | 2020-06-03 13:20:37 -0400 | [diff] [blame] | 1869 | if (!skia_enable_fontmgr_fontconfig) { |
Ben Wagner | 37a06c0 | 2018-06-22 21:11:00 +0000 | [diff] [blame] | 1870 | sources -= [ "//tests/FontMgrFontConfigTest.cpp" ] |
| 1871 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1872 | deps = [ |
| 1873 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1874 | ":skia", |
Mike Klein | 7b7077c | 2019-06-03 17:10:59 -0500 | [diff] [blame] | 1875 | ":skvm_builders", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1876 | ":tool_utils", |
Florin Malita | 26ae40f | 2020-06-08 12:03:48 -0400 | [diff] [blame] | 1877 | "experimental/skrive:tests", |
Florin Malita | 94d4d3e | 2018-06-18 13:10:51 -0400 | [diff] [blame] | 1878 | "modules/skottie:tests", |
Julia Lavrova | a3552c5 | 2019-05-30 16:12:56 -0400 | [diff] [blame] | 1879 | "modules/skparagraph:tests", |
Brian Osman | ccb8752 | 2018-06-01 19:20:00 +0000 | [diff] [blame] | 1880 | "modules/sksg:tests", |
Brian Osman | c725e8f | 2019-04-10 14:08:44 -0400 | [diff] [blame] | 1881 | "modules/skshaper", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 1882 | "modules/svg", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1883 | "//third_party/libpng", |
Leon Scroggins III | 194580d | 2019-02-22 12:32:16 -0500 | [diff] [blame] | 1884 | "//third_party/libwebp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1885 | "//third_party/zlib", |
| 1886 | ] |
Mike Klein | d63442d | 2017-03-27 14:16:04 -0400 | [diff] [blame] | 1887 | public_deps = [ |
| 1888 | ":gpu_tool_utils", # Test.h #includes headers from this target. |
| 1889 | ] |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1890 | } |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 1891 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1892 | import("gn/bench.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1893 | test_lib("bench") { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1894 | sources = bench_sources |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1895 | deps = [ |
| 1896 | ":flags", |
| 1897 | ":gm", |
| 1898 | ":gpu_tool_utils", |
| 1899 | ":skia", |
Mike Klein | 7b7077c | 2019-06-03 17:10:59 -0500 | [diff] [blame] | 1900 | ":skvm_builders", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1901 | ":tool_utils", |
Julia Lavrova | a3552c5 | 2019-05-30 16:12:56 -0400 | [diff] [blame] | 1902 | "modules/skparagraph:bench", |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 1903 | "modules/skshaper", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1904 | ] |
| 1905 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1906 | |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 1907 | test_lib("experimental_xform") { |
| 1908 | sources = [ |
| 1909 | "experimental/xform/SkShape.cpp", |
| 1910 | "experimental/xform/SkXform.cpp", |
| 1911 | "experimental/xform/XContext.cpp", |
| 1912 | ] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1913 | deps = [ ":skia" ] |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 1914 | } |
| 1915 | |
Florin Malita | bfe876a | 2018-09-02 12:33:59 -0400 | [diff] [blame] | 1916 | if (is_linux || is_mac) { |
Florin Malita | 79725d3 | 2018-06-05 16:16:57 -0400 | [diff] [blame] | 1917 | test_app("skottie_tool") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1918 | deps = [ "modules/skottie:tool" ] |
Florin Malita | 79725d3 | 2018-06-05 16:16:57 -0400 | [diff] [blame] | 1919 | } |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 1920 | test_app("svg_tool") { |
| 1921 | deps = [ "modules/svg:tool" ] |
| 1922 | } |
Florin Malita | 79725d3 | 2018-06-05 16:16:57 -0400 | [diff] [blame] | 1923 | } |
| 1924 | |
Hal Canary | 5b39dc8 | 2019-04-17 13:29:46 -0400 | [diff] [blame] | 1925 | test_app("make_skqp_model") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1926 | sources = [ "tools/skqp/make_skqp_model.cpp" ] |
| 1927 | deps = [ ":skia" ] |
Hal Canary | 5b39dc8 | 2019-04-17 13:29:46 -0400 | [diff] [blame] | 1928 | } |
| 1929 | |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1930 | import("gn/samples.gni") |
| 1931 | test_lib("samples") { |
| 1932 | sources = samples_sources |
| 1933 | if (skia_enable_ccpr) { |
| 1934 | sources += samples_sources_ccpr |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1935 | } |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1936 | public_deps = [ ":tool_utils" ] |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1937 | deps = [ |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1938 | ":flags", |
| 1939 | ":gpu_tool_utils", |
| 1940 | ":xml", |
Jorge Betancourt | b862131 | 2020-09-10 15:16:35 -0400 | [diff] [blame] | 1941 | "modules/audioplayer", |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1942 | "modules/skparagraph:samples", |
| 1943 | "modules/skshaper", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 1944 | "modules/svg", |
Tyler Denniston | 189ecd4 | 2020-10-22 15:40:49 -0400 | [diff] [blame] | 1945 | "//third_party/imgui", |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1946 | ] |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1947 | } |
Kevin Lubick | 0039874 | 2020-10-08 10:05:07 -0400 | [diff] [blame] | 1948 | test_lib("hash_and_encode") { |
| 1949 | sources = [ |
| 1950 | "tools/HashAndEncode.cpp", |
| 1951 | "tools/HashAndEncode.h", |
| 1952 | ] |
| 1953 | deps = [ |
| 1954 | ":flags", |
| 1955 | ":skia", |
| 1956 | "//third_party/libpng", |
| 1957 | ] |
| 1958 | } |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 1959 | if (target_cpu != "wasm") { |
Nigel Tao | 3ab9b1f | 2020-05-28 13:29:13 +1000 | [diff] [blame] | 1960 | test_app("convert-to-nia") { |
| 1961 | sources = [ "tools/convert-to-nia.cpp" ] |
| 1962 | deps = [ ":skia" ] |
| 1963 | } |
Mike Klein | 7af351a | 2018-07-27 09:54:43 -0400 | [diff] [blame] | 1964 | test_app("imgcvt") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 1965 | sources = [ "tools/imgcvt.cpp" ] |
Mike Klein | 7af351a | 2018-07-27 09:54:43 -0400 | [diff] [blame] | 1966 | deps = [ |
| 1967 | ":skcms", |
| 1968 | ":skia", |
| 1969 | ] |
| 1970 | } |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1971 | test_app("fm") { |
| 1972 | sources = [ |
Mike Klein | fee0079 | 2019-11-21 16:18:47 -0600 | [diff] [blame] | 1973 | "dm/DMGpuTestProcs.cpp", # blech |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1974 | "tools/fm/fm.cpp", |
| 1975 | ] |
| 1976 | deps = [ |
| 1977 | ":common_flags_aa", |
| 1978 | ":common_flags_gpu", |
| 1979 | ":flags", |
| 1980 | ":gm", |
| 1981 | ":gpu_tool_utils", |
| 1982 | ":hash_and_encode", |
| 1983 | ":skia", |
Mike Klein | fee0079 | 2019-11-21 16:18:47 -0600 | [diff] [blame] | 1984 | ":tests", |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1985 | ":tool_utils", |
| 1986 | ":trace", |
Mike Klein | 2292426 | 2019-04-02 14:14:56 -0400 | [diff] [blame] | 1987 | "modules/skottie", |
| 1988 | "modules/skottie:utils", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 1989 | "modules/svg", |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 1990 | ] |
| 1991 | } |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1992 | test_app("dm") { |
| 1993 | sources = [ |
| 1994 | "dm/DM.cpp", |
Hal Canary | b6c5e5b | 2017-10-09 16:13:02 -0400 | [diff] [blame] | 1995 | "dm/DMGpuTestProcs.cpp", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1996 | "dm/DMJsonWriter.cpp", |
| 1997 | "dm/DMSrcSink.cpp", |
| 1998 | ] |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1999 | deps = [ |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 2000 | ":common_flags_aa", |
| 2001 | ":common_flags_config", |
| 2002 | ":common_flags_gpu", |
| 2003 | ":common_flags_images", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 2004 | ":flags", |
| 2005 | ":gm", |
| 2006 | ":gpu_tool_utils", |
Mike Klein | 735c7ba | 2019-03-25 12:57:58 -0500 | [diff] [blame] | 2007 | ":hash_and_encode", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 2008 | ":skia", |
| 2009 | ":tests", |
| 2010 | ":tool_utils", |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 2011 | ":trace", |
Florin Malita | 02616ea | 2020-06-25 13:33:17 -0400 | [diff] [blame] | 2012 | "experimental/skrive", |
Florin Malita | 3d856bd | 2018-05-26 09:49:28 -0400 | [diff] [blame] | 2013 | "modules/skottie", |
Florin Malita | a831655 | 2018-11-09 16:19:44 -0500 | [diff] [blame] | 2014 | "modules/skottie:utils", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2015 | "modules/svg", |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 2016 | ] |
| 2017 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2018 | } |
| 2019 | |
Mike Klein | a8a51ce | 2018-01-09 12:34:11 -0500 | [diff] [blame] | 2020 | if (!is_win) { |
| 2021 | test_app("remote_demo") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2022 | sources = [ "tools/remote_demo.cpp" ] |
| 2023 | deps = [ ":skia" ] |
Mike Klein | a8a51ce | 2018-01-09 12:34:11 -0500 | [diff] [blame] | 2024 | } |
| 2025 | } |
| 2026 | |
Hal Canary | e107faa | 2019-10-23 12:52:33 -0400 | [diff] [blame] | 2027 | if (!is_win) { |
| 2028 | test_app("blob_cache_sim") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2029 | sources = [ "tools/blob_cache_sim.cpp" ] |
| 2030 | deps = [ ":skia" ] |
Hal Canary | e107faa | 2019-10-23 12:52:33 -0400 | [diff] [blame] | 2031 | } |
| 2032 | } |
| 2033 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2034 | test_app("nanobench") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2035 | sources = [ "bench/nanobench.cpp" ] |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 2036 | deps = [ |
| 2037 | ":bench", |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 2038 | ":common_flags_aa", |
| 2039 | ":common_flags_config", |
| 2040 | ":common_flags_gpu", |
| 2041 | ":common_flags_images", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 2042 | ":flags", |
| 2043 | ":gm", |
| 2044 | ":gpu_tool_utils", |
| 2045 | ":skia", |
| 2046 | ":tool_utils", |
Mike Klein | 499f0ac | 2019-03-25 13:00:12 -0500 | [diff] [blame] | 2047 | ":trace", |
Mike Reed | 63559a5 | 2020-06-02 11:34:24 -0400 | [diff] [blame] | 2048 | "modules/skparagraph", |
Julia Lavrova | a3552c5 | 2019-05-30 16:12:56 -0400 | [diff] [blame] | 2049 | "modules/skshaper", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2050 | "modules/svg", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 2051 | ] |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 2052 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 2053 | |
Ravi Mistry | 10d36c5 | 2017-01-31 09:49:18 -0500 | [diff] [blame] | 2054 | test_app("skpinfo") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2055 | sources = [ "tools/skpinfo.cpp" ] |
Ravi Mistry | 10d36c5 | 2017-01-31 09:49:18 -0500 | [diff] [blame] | 2056 | deps = [ |
| 2057 | ":flags", |
| 2058 | ":skia", |
| 2059 | ] |
| 2060 | } |
| 2061 | |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 2062 | if (skia_use_ffmpeg) { |
| 2063 | test_app("skottie2movie") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2064 | sources = [ "tools/skottie2movie.cpp" ] |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 2065 | deps = [ |
| 2066 | ":flags", |
Mike Reed | 5f12eaa | 2019-09-24 12:01:58 -0400 | [diff] [blame] | 2067 | ":gpu_tool_utils", |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 2068 | ":skia", |
Florin Malita | ec40360 | 2020-04-24 12:14:03 -0400 | [diff] [blame] | 2069 | "experimental/ffmpeg:video_encoder", |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 2070 | "modules/skottie", |
Mike Reed | 5093e23 | 2019-05-30 10:10:50 -0400 | [diff] [blame] | 2071 | "modules/skottie:utils", |
Mike Reed | c0ee21f | 2019-05-28 16:11:03 -0400 | [diff] [blame] | 2072 | ] |
| 2073 | } |
| 2074 | } |
| 2075 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2076 | test_app("skpbench") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2077 | sources = [ "tools/skpbench/skpbench.cpp" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2078 | deps = [ |
Mike Klein | c6142d8 | 2019-03-25 10:54:59 -0500 | [diff] [blame] | 2079 | ":common_flags_config", |
| 2080 | ":common_flags_gpu", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2081 | ":flags", |
| 2082 | ":gpu_tool_utils", |
| 2083 | ":skia", |
| 2084 | ":tool_utils", |
| 2085 | ] |
csmartdalton | 4b5179b | 2016-09-19 11:03:58 -0700 | [diff] [blame] | 2086 | } |
| 2087 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2088 | test_app("sktexttopdf") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2089 | sources = [ "tools/using_skia_and_harfbuzz.cpp" ] |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 2090 | deps = [ |
| 2091 | ":skia", |
Herb Derby | 264182c | 2018-05-29 15:53:40 -0400 | [diff] [blame] | 2092 | "modules/skshaper", |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 2093 | ] |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 2094 | } |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 2095 | |
Ben Wagner | 219f362 | 2017-07-17 15:32:25 -0400 | [diff] [blame] | 2096 | test_app("create_test_font") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2097 | sources = [ "tools/fonts/create_test_font.cpp" ] |
| 2098 | deps = [ ":skia" ] |
Ben Wagner | 219f362 | 2017-07-17 15:32:25 -0400 | [diff] [blame] | 2099 | assert_no_deps = [ |
| 2100 | # tool_utils requires the output of this app. |
| 2101 | ":tool_utils", |
| 2102 | ] |
| 2103 | } |
| 2104 | |
Florin Malita | 5d3ff43 | 2018-07-31 16:38:43 -0400 | [diff] [blame] | 2105 | if (skia_use_expat) { |
| 2106 | test_app("create_test_font_color") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2107 | sources = [ "tools/fonts/create_test_font_color.cpp" ] |
Florin Malita | 5d3ff43 | 2018-07-31 16:38:43 -0400 | [diff] [blame] | 2108 | deps = [ |
| 2109 | ":flags", |
| 2110 | ":skia", |
| 2111 | ":tool_utils", |
| 2112 | ] |
| 2113 | } |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 2114 | } |
| 2115 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2116 | test_app("get_images_from_skps") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2117 | sources = [ "tools/get_images_from_skps.cpp" ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 2118 | deps = [ |
| 2119 | ":flags", |
| 2120 | ":skia", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 2121 | ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 2122 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 2123 | |
Brian Osman | 6788a54 | 2018-12-10 11:56:01 -0500 | [diff] [blame] | 2124 | if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2125 | test_app("skiaserve") { |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 2126 | sources = [ |
| 2127 | "tools/skiaserve/Request.cpp", |
| 2128 | "tools/skiaserve/Response.cpp", |
| 2129 | "tools/skiaserve/skiaserve.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 2130 | "tools/skiaserve/urlhandlers/BreakHandler.cpp", |
| 2131 | "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp", |
| 2132 | "tools/skiaserve/urlhandlers/CmdHandler.cpp", |
| 2133 | "tools/skiaserve/urlhandlers/ColorModeHandler.cpp", |
| 2134 | "tools/skiaserve/urlhandlers/DataHandler.cpp", |
| 2135 | "tools/skiaserve/urlhandlers/DownloadHandler.cpp", |
| 2136 | "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp", |
| 2137 | "tools/skiaserve/urlhandlers/ImgHandler.cpp", |
| 2138 | "tools/skiaserve/urlhandlers/InfoHandler.cpp", |
Brian Salomon | 144a5c5 | 2016-12-20 16:48:59 -0500 | [diff] [blame] | 2139 | "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp", |
| 2140 | "tools/skiaserve/urlhandlers/OpsHandler.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 2141 | "tools/skiaserve/urlhandlers/OverdrawHandler.cpp", |
| 2142 | "tools/skiaserve/urlhandlers/PostHandler.cpp", |
| 2143 | "tools/skiaserve/urlhandlers/QuitHandler.cpp", |
| 2144 | "tools/skiaserve/urlhandlers/RootHandler.cpp", |
| 2145 | ] |
| 2146 | deps = [ |
| 2147 | ":flags", |
| 2148 | ":gpu_tool_utils", |
| 2149 | ":skia", |
| 2150 | ":tool_utils", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 2151 | "//third_party/libmicrohttpd", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 2152 | ] |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 2153 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 2154 | } |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2155 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2156 | test_app("fuzz") { |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2157 | sources = [ |
Kevin Lubick | bc9a1a8 | 2018-09-17 14:46:57 -0400 | [diff] [blame] | 2158 | "fuzz/Fuzz.cpp", |
John Stiles | 6d3996c | 2020-07-31 12:33:31 -0400 | [diff] [blame] | 2159 | "fuzz/Fuzz.h", |
Hal Canary | 24ac42b | 2017-02-14 13:35:14 -0500 | [diff] [blame] | 2160 | "fuzz/FuzzCanvas.cpp", |
Cary Clark | 91390c8 | 2018-03-09 14:02:46 -0500 | [diff] [blame] | 2161 | "fuzz/FuzzCommon.cpp", |
John Stiles | 6d3996c | 2020-07-31 12:33:31 -0400 | [diff] [blame] | 2162 | "fuzz/FuzzCommon.h", |
Zepeng Hu | 9400701 | 2020-07-22 14:37:46 +0000 | [diff] [blame] | 2163 | "fuzz/FuzzCreateDDL.cpp", |
Kevin Lubick | fec1dea | 2016-11-22 13:57:18 -0500 | [diff] [blame] | 2164 | "fuzz/FuzzDrawFunctions.cpp", |
Kevin Lubick | e4be55d | 2018-03-30 15:05:13 -0400 | [diff] [blame] | 2165 | "fuzz/FuzzEncoders.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2166 | "fuzz/FuzzGradients.cpp", |
Kevin Lubick | bc9a1a8 | 2018-09-17 14:46:57 -0400 | [diff] [blame] | 2167 | "fuzz/FuzzMain.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2168 | "fuzz/FuzzParsePath.cpp", |
Cary Clark | 91390c8 | 2018-03-09 14:02:46 -0500 | [diff] [blame] | 2169 | "fuzz/FuzzPathMeasure.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2170 | "fuzz/FuzzPathop.cpp", |
Jim Van Verth | 061cc21 | 2018-07-11 14:09:09 -0400 | [diff] [blame] | 2171 | "fuzz/FuzzPolyUtils.cpp", |
Hal Canary | 13872dd | 2018-04-06 10:25:12 -0400 | [diff] [blame] | 2172 | "fuzz/FuzzRegionOp.cpp", |
Leon Scroggins III | 0b8fcbc | 2018-10-16 15:52:17 -0400 | [diff] [blame] | 2173 | "fuzz/oss_fuzz/FuzzAndroidCodec.cpp", |
Kevin Lubick | 2416f96 | 2018-02-12 08:26:39 -0500 | [diff] [blame] | 2174 | "fuzz/oss_fuzz/FuzzAnimatedImage.cpp", |
| 2175 | "fuzz/oss_fuzz/FuzzImage.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 2176 | "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp", |
Leon Scroggins III | 0b8fcbc | 2018-10-16 15:52:17 -0400 | [diff] [blame] | 2177 | "fuzz/oss_fuzz/FuzzIncrementalImage.cpp", |
Florin Malita | 80452be | 2018-06-19 11:27:20 -0400 | [diff] [blame] | 2178 | "fuzz/oss_fuzz/FuzzJSON.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 2179 | "fuzz/oss_fuzz/FuzzPathDeserialize.cpp", |
Kevin Lubick | 2541edf | 2018-01-11 10:27:14 -0500 | [diff] [blame] | 2180 | "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp", |
| 2181 | "fuzz/oss_fuzz/FuzzRegionSetPath.cpp", |
Zepeng Hu | fcb7ba0 | 2020-07-31 17:21:29 +0000 | [diff] [blame] | 2182 | "fuzz/oss_fuzz/FuzzSKP.cpp", |
Kevin Lubick | e9c1ce8 | 2019-03-11 11:09:40 -0400 | [diff] [blame] | 2183 | "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp", |
| 2184 | "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp", |
Kevin Lubick | 0f0a710 | 2019-03-18 16:20:55 -0400 | [diff] [blame] | 2185 | "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp", |
Kevin Lubick | e9c1ce8 | 2019-03-11 11:09:40 -0400 | [diff] [blame] | 2186 | "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp", |
Zepeng Hu | edaf302 | 2020-06-12 12:20:59 +0000 | [diff] [blame] | 2187 | "fuzz/oss_fuzz/FuzzSVG.cpp", |
Kevin Lubick | 2be14d3 | 2019-10-21 13:44:48 -0400 | [diff] [blame] | 2188 | "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp", |
Zepeng Hu | a5783f3 | 2020-07-10 13:36:20 +0000 | [diff] [blame] | 2189 | "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 2190 | "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp", |
Kevin Lubick | 9ff5dc9 | 2018-01-09 12:47:33 -0500 | [diff] [blame] | 2191 | "tools/UrlDataManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 2192 | "tools/debugger/DebugCanvas.cpp", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 2193 | "tools/debugger/DebugLayerManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 2194 | "tools/debugger/DrawCommand.cpp", |
| 2195 | "tools/debugger/JsonWriteBuffer.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2196 | ] |
| 2197 | deps = [ |
| 2198 | ":flags", |
Hal Canary | 44801ca | 2017-03-15 11:39:06 -0400 | [diff] [blame] | 2199 | ":gpu_tool_utils", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2200 | ":skia", |
Florin Malita | 3d856bd | 2018-05-26 09:49:28 -0400 | [diff] [blame] | 2201 | "modules/skottie:fuzz", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2202 | ] |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2203 | } |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2204 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2205 | test_app("pathops_unittest") { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 2206 | sources = pathops_tests_sources + [ |
Mike Klein | 6e55fef | 2016-10-26 11:41:47 -0400 | [diff] [blame] | 2207 | rebase_path("tests/skia_test.cpp"), |
| 2208 | rebase_path("tests/Test.cpp"), |
| 2209 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 2210 | deps = [ |
| 2211 | ":flags", |
| 2212 | ":gpu_tool_utils", |
| 2213 | ":skia", |
| 2214 | ":tool_utils", |
| 2215 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 2216 | } |
| 2217 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2218 | test_app("dump_record") { |
Mike Klein | 4a56f4c | 2020-08-18 16:02:52 -0500 | [diff] [blame] | 2219 | sources = [ "tools/dump_record.cpp" ] |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2220 | deps = [ |
| 2221 | ":flags", |
| 2222 | ":skia", |
| 2223 | ] |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2224 | } |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2225 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2226 | test_app("skdiff") { |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2227 | sources = [ |
| 2228 | "tools/skdiff/skdiff.cpp", |
| 2229 | "tools/skdiff/skdiff_html.cpp", |
| 2230 | "tools/skdiff/skdiff_main.cpp", |
| 2231 | "tools/skdiff/skdiff_utils.cpp", |
| 2232 | ] |
| 2233 | deps = [ |
| 2234 | ":skia", |
| 2235 | ":tool_utils", |
| 2236 | ] |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2237 | } |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2238 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2239 | test_app("skp_parser") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2240 | sources = [ "tools/skp_parser.cpp" ] |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2241 | deps = [ |
| 2242 | ":skia", |
| 2243 | ":tool_utils", |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2244 | ] |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2245 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2246 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2247 | if (!is_win) { |
Colin Cross | 654eb2a | 2019-11-08 13:08:36 -0800 | [diff] [blame] | 2248 | source_set("skqp_lib") { |
| 2249 | check_includes = false |
| 2250 | testonly = true |
| 2251 | if (!is_official_build) { |
| 2252 | configs -= [ "//gn:warnings" ] |
| 2253 | } |
| 2254 | public_configs = [ ":skia_private" ] |
Hal Canary | 0e07ad7 | 2018-02-08 13:06:56 -0500 | [diff] [blame] | 2255 | defines = |
| 2256 | [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ] |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2257 | sources = [ |
| 2258 | "dm/DMGpuTestProcs.cpp", |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2259 | "tools/skqp/src/skqp.cpp", |
| 2260 | "tools/skqp/src/skqp_model.cpp", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2261 | ] |
| 2262 | deps = [ |
| 2263 | ":gm", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2264 | ":skia", |
| 2265 | ":tests", |
Hal Canary | d7b3845 | 2017-12-11 17:46:26 -0500 | [diff] [blame] | 2266 | ":tool_utils", |
| 2267 | ] |
| 2268 | } |
| 2269 | test_app("skqp") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2270 | sources = [ "tools/skqp/src/skqp_main.cpp" ] |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 2271 | include_dirs = [ "//" ] |
| 2272 | lib_dirs = [] |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2273 | deps = [ ":skqp_lib" ] |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2274 | } |
| 2275 | test_app("jitter_gms") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2276 | sources = [ "tools/skqp/jitter_gms.cpp" ] |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2277 | deps = [ |
| 2278 | ":gm", |
| 2279 | ":skia", |
| 2280 | ":skqp_lib", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2281 | ] |
| 2282 | } |
| 2283 | } |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 2284 | if (is_fuchsia) { |
| 2285 | # Build a package repository for skqp on Fuchsia. |
| 2286 | group("skqp_repo") { |
| 2287 | testonly = true |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2288 | deps = [ "//build/fuchsia/skqp:skqp_repo" ] |
John Rosasco | 24cbdab | 2019-09-25 14:14:35 -0700 | [diff] [blame] | 2289 | } |
| 2290 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2291 | if (is_android) { |
Colin Cross | 654eb2a | 2019-11-08 13:08:36 -0800 | [diff] [blame] | 2292 | shared_library("libskqp_app") { |
| 2293 | configs += [ ":skia_private" ] |
| 2294 | if (!is_official_build) { |
| 2295 | configs -= [ "//gn:warnings" ] |
| 2296 | } |
| 2297 | testonly = true |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2298 | sources = [ "tools/skqp/src/jni_skqp.cpp" ] |
Hal Canary | 28f8938 | 2017-12-12 09:42:14 -0500 | [diff] [blame] | 2299 | deps = [ |
| 2300 | ":skia", |
| 2301 | ":skqp_lib", |
Hal Canary | b4d01a9 | 2018-01-29 13:10:08 -0500 | [diff] [blame] | 2302 | ":tool_utils", |
Hal Canary | 28f8938 | 2017-12-12 09:42:14 -0500 | [diff] [blame] | 2303 | ] |
| 2304 | libs = [ "android" ] |
| 2305 | } |
| 2306 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2307 | if (is_android && skia_use_gl) { |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2308 | test_app("skottie_android") { |
| 2309 | is_shared_library = true |
| 2310 | |
Jorge Betancourt | 1fcdcaa | 2020-06-22 14:14:32 +0000 | [diff] [blame] | 2311 | sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ] |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2312 | libs = [] |
| 2313 | |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2314 | deps = [ |
| 2315 | ":skia", |
| 2316 | "modules/skottie", |
Stan Iliev | a7a52b9 | 2018-10-01 15:36:32 -0400 | [diff] [blame] | 2317 | "modules/sksg:samples", |
Jorge Betancourt | 646d6c5 | 2020-08-31 16:07:25 -0400 | [diff] [blame] | 2318 | "//third_party/oboe", |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2319 | ] |
| 2320 | } |
| 2321 | } |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2322 | |
Hal Canary | a9de760 | 2018-01-19 13:08:23 -0500 | [diff] [blame] | 2323 | test_app("list_gms") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2324 | sources = [ "tools/list_gms.cpp" ] |
Hal Canary | a9de760 | 2018-01-19 13:08:23 -0500 | [diff] [blame] | 2325 | deps = [ |
| 2326 | ":gm", |
| 2327 | ":skia", |
| 2328 | ] |
| 2329 | } |
| 2330 | test_app("list_gpu_unit_tests") { |
| 2331 | sources = [ |
| 2332 | "dm/DMGpuTestProcs.cpp", |
| 2333 | "tools/list_gpu_unit_tests.cpp", |
| 2334 | ] |
| 2335 | deps = [ |
| 2336 | ":skia", |
| 2337 | ":tests", |
| 2338 | ] |
| 2339 | } |
| 2340 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2341 | test_lib("sk_app") { |
Hal Canary | 378be8d | 2019-04-26 08:20:14 -0400 | [diff] [blame] | 2342 | public_deps = [ |
Hal Canary | 378be8d | 2019-04-26 08:20:14 -0400 | [diff] [blame] | 2343 | ":gpu_tool_utils", |
Hal Canary | 0569447 | 2019-05-03 17:14:21 -0400 | [diff] [blame] | 2344 | ":skia", |
Hal Canary | 378be8d | 2019-04-26 08:20:14 -0400 | [diff] [blame] | 2345 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2346 | sources = [ |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2347 | "tools/sk_app/Application.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2348 | "tools/sk_app/CommandSet.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2349 | "tools/sk_app/CommandSet.h", |
| 2350 | "tools/sk_app/DisplayParams.h", |
| 2351 | "tools/sk_app/RasterWindowContext.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2352 | "tools/sk_app/Window.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2353 | "tools/sk_app/Window.h", |
Robert Phillips | ed65339 | 2020-07-10 13:55:21 -0400 | [diff] [blame] | 2354 | "tools/sk_app/WindowContext.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2355 | "tools/sk_app/WindowContext.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2356 | ] |
| 2357 | libs = [] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 2358 | frameworks = [] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2359 | |
| 2360 | if (is_android) { |
| 2361 | sources += [ |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2362 | "tools/sk_app/android/RasterWindowContext_android.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2363 | "tools/sk_app/android/WindowContextFactory_android.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2364 | "tools/sk_app/android/Window_android.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2365 | "tools/sk_app/android/Window_android.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2366 | "tools/sk_app/android/main_android.cpp", |
| 2367 | "tools/sk_app/android/surface_glue_android.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2368 | "tools/sk_app/android/surface_glue_android.h", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2369 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2370 | libs += [ "android" ] |
| 2371 | } else if (is_linux) { |
| 2372 | sources += [ |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2373 | "tools/sk_app/unix/RasterWindowContext_unix.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2374 | "tools/sk_app/unix/WindowContextFactory_unix.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2375 | "tools/sk_app/unix/Window_unix.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2376 | "tools/sk_app/unix/Window_unix.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2377 | "tools/sk_app/unix/keysym2ucs.c", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2378 | "tools/sk_app/unix/keysym2ucs.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2379 | "tools/sk_app/unix/main_unix.cpp", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2380 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2381 | libs += [ |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2382 | "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] | 2383 | "X11", |
| 2384 | ] |
| 2385 | } else if (is_win) { |
| 2386 | sources += [ |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2387 | "tools/sk_app/win/RasterWindowContext_win.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2388 | "tools/sk_app/win/WindowContextFactory_win.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2389 | "tools/sk_app/win/Window_win.cpp", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2390 | "tools/sk_app/win/Window_win.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2391 | "tools/sk_app/win/main_win.cpp", |
| 2392 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2393 | } else if (is_mac) { |
| 2394 | sources += [ |
Jim Van Verth | 1f086ca | 2019-01-28 14:46:04 -0500 | [diff] [blame] | 2395 | "tools/sk_app/mac/RasterWindowContext_mac.mm", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2396 | "tools/sk_app/mac/WindowContextFactory_mac.h", |
| 2397 | "tools/sk_app/mac/Window_mac.h", |
Jim Van Verth | 1f086ca | 2019-01-28 14:46:04 -0500 | [diff] [blame] | 2398 | "tools/sk_app/mac/Window_mac.mm", |
| 2399 | "tools/sk_app/mac/main_mac.mm", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2400 | ] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 2401 | frameworks += [ |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2402 | "QuartzCore.framework", |
| 2403 | "Cocoa.framework", |
| 2404 | "Foundation.framework", |
| 2405 | ] |
| 2406 | } else if (is_ios) { |
| 2407 | sources += [ |
Jim Van Verth | 68cb8b0 | 2019-08-29 14:59:17 -0400 | [diff] [blame] | 2408 | "tools/sk_app/ios/RasterWindowContext_ios.mm", |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2409 | "tools/sk_app/ios/WindowContextFactory_ios.h", |
| 2410 | "tools/sk_app/ios/Window_ios.h", |
Jim Van Verth | 68cb8b0 | 2019-08-29 14:59:17 -0400 | [diff] [blame] | 2411 | "tools/sk_app/ios/Window_ios.mm", |
| 2412 | "tools/sk_app/ios/main_ios.mm", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2413 | ] |
Jim Van Verth | ef820be | 2020-08-12 10:45:00 -0400 | [diff] [blame] | 2414 | frameworks += [ "QuartzCore.framework" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2415 | } |
| 2416 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2417 | if (skia_use_gl) { |
| 2418 | sources += [ "tools/sk_app/GLWindowContext.cpp" ] |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2419 | sources += [ "tools/sk_app/GLWindowContext.h" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2420 | if (is_android) { |
| 2421 | sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ] |
| 2422 | } else if (is_linux) { |
| 2423 | sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ] |
| 2424 | } else if (is_win) { |
| 2425 | sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ] |
| 2426 | if (skia_use_angle) { |
| 2427 | sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ] |
| 2428 | } |
| 2429 | } else if (is_mac) { |
| 2430 | sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ] |
| 2431 | } else if (is_ios) { |
| 2432 | sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ] |
| 2433 | } |
| 2434 | } |
| 2435 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2436 | if (skia_use_vulkan) { |
| 2437 | sources += [ "tools/sk_app/VulkanWindowContext.cpp" ] |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2438 | sources += [ "tools/sk_app/VulkanWindowContext.h" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2439 | if (is_android) { |
| 2440 | sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ] |
| 2441 | } else if (is_linux) { |
| 2442 | sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ] |
| 2443 | libs += [ "X11-xcb" ] |
| 2444 | } else if (is_win) { |
| 2445 | sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ] |
| 2446 | } |
| 2447 | } |
| 2448 | |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2449 | if (skia_use_metal) { |
| 2450 | sources += [ "tools/sk_app/MetalWindowContext.mm" ] |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2451 | sources += [ "tools/sk_app/MetalWindowContext.h" ] |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2452 | if (is_mac) { |
| 2453 | sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ] |
Jim Van Verth | 68cb8b0 | 2019-08-29 14:59:17 -0400 | [diff] [blame] | 2454 | } else if (is_ios) { |
Jim Van Verth | e58d532 | 2019-09-03 09:42:57 -0400 | [diff] [blame] | 2455 | sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ] |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2456 | } |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2457 | } |
| 2458 | |
Jim Van Verth | 682a2f4 | 2020-05-13 16:54:09 -0400 | [diff] [blame] | 2459 | if (skia_use_direct3d) { |
| 2460 | sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ] |
| 2461 | } |
| 2462 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2463 | if (skia_use_dawn) { |
| 2464 | sources += [ "tools/sk_app/DawnWindowContext.cpp" ] |
John Stiles | ab9578e | 2020-06-30 17:36:55 -0400 | [diff] [blame] | 2465 | sources += [ "tools/sk_app/DawnWindowContext.h" ] |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2466 | if (is_linux) { |
| 2467 | if (dawn_enable_vulkan) { |
| 2468 | sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ] |
| 2469 | defines = [ "VK_USE_PLATFORM_XCB_KHR" ] |
| 2470 | libs += [ "X11-xcb" ] |
| 2471 | } |
| 2472 | } else if (is_win) { |
| 2473 | if (dawn_enable_d3d12) { |
| 2474 | sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ] |
| 2475 | } |
| 2476 | } else if (is_mac) { |
| 2477 | if (dawn_enable_metal) { |
| 2478 | sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ] |
| 2479 | } |
| 2480 | } |
| 2481 | } |
| 2482 | |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2483 | deps = [ ":tool_utils" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2484 | if (is_android) { |
| 2485 | deps += [ "//third_party/native_app_glue" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2486 | } |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2487 | if (skia_use_gl && skia_use_angle) { |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2488 | deps += [ "//third_party/angle2" ] |
Mike Klein | a92c383 | 2016-12-08 09:49:39 -0500 | [diff] [blame] | 2489 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2490 | } |
Ethan Nicholas | 4f3985c | 2016-11-14 11:16:37 -0500 | [diff] [blame] | 2491 | |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2492 | if (!skia_use_vulkan && (is_mac || is_linux || is_win)) { |
| 2493 | test_app("fiddle_examples") { |
| 2494 | sources = [ |
Brian Osman | c725e8f | 2019-04-10 14:08:44 -0400 | [diff] [blame] | 2495 | "tools/fiddle/all_examples.cpp", |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2496 | "tools/fiddle/examples.cpp", |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2497 | "tools/fiddle/examples.h", |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2498 | ] |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2499 | if (is_win) { |
Hal Canary | 6c8422c | 2020-01-10 15:22:09 -0500 | [diff] [blame] | 2500 | cflags = [ |
| 2501 | "/wd4756", # Overflow in constant arithmetic |
| 2502 | "/wd4305", # truncation from 'double' to 'float' |
| 2503 | ] |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2504 | } |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2505 | deps = [ |
| 2506 | ":skia", |
| 2507 | ":skia.h", |
| 2508 | "modules/skottie", |
Florin Malita | a1dcaae | 2019-03-25 17:38:43 -0400 | [diff] [blame] | 2509 | "modules/skshaper", |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2510 | ] |
| 2511 | } |
| 2512 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2513 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2514 | # sk_app can work without GL but viewer always runs raster through a GL window context. |
| 2515 | if (skia_use_gl) { |
| 2516 | test_app("viewer") { |
| 2517 | is_shared_library = is_android |
| 2518 | sources = [ |
| 2519 | "tools/viewer/AnimTimer.h", |
| 2520 | "tools/viewer/BisectSlide.cpp", |
| 2521 | "tools/viewer/GMSlide.cpp", |
| 2522 | "tools/viewer/ImGuiLayer.cpp", |
| 2523 | "tools/viewer/ImageSlide.cpp", |
| 2524 | "tools/viewer/ParticlesSlide.cpp", |
| 2525 | "tools/viewer/SKPSlide.cpp", |
| 2526 | "tools/viewer/SampleSlide.cpp", |
Florin Malita | 45cd200 | 2020-06-09 14:00:54 -0400 | [diff] [blame] | 2527 | "tools/viewer/SkRiveSlide.cpp", |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2528 | "tools/viewer/SkSLSlide.cpp", |
| 2529 | "tools/viewer/SkottieSlide.cpp", |
| 2530 | "tools/viewer/SlideDir.cpp", |
| 2531 | "tools/viewer/StatsLayer.cpp", |
| 2532 | "tools/viewer/SvgSlide.cpp", |
| 2533 | "tools/viewer/TouchGesture.cpp", |
| 2534 | "tools/viewer/TouchGesture.h", |
| 2535 | "tools/viewer/Viewer.cpp", |
John Stiles | 6d3996c | 2020-07-31 12:33:31 -0400 | [diff] [blame] | 2536 | "tools/viewer/Viewer.h", |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2537 | ] |
| 2538 | libs = [] |
| 2539 | |
| 2540 | deps = [ |
| 2541 | ":common_flags_gpu", |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2542 | ":flags", |
| 2543 | ":gm", |
| 2544 | ":gpu_tool_utils", |
| 2545 | ":samples", |
| 2546 | ":sk_app", |
| 2547 | ":skia", |
| 2548 | ":tool_utils", |
| 2549 | ":trace", |
Florin Malita | 45cd200 | 2020-06-09 14:00:54 -0400 | [diff] [blame] | 2550 | "experimental/skrive", |
Florin Malita | c9c4e2e | 2020-08-13 12:03:37 -0400 | [diff] [blame] | 2551 | "modules/audioplayer", |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2552 | "modules/particles", |
| 2553 | "modules/skottie", |
| 2554 | "modules/skottie:utils", |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2555 | "modules/sksg:samples", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2556 | "modules/svg", |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2557 | "//third_party/imgui", |
| 2558 | ] |
| 2559 | if (skia_use_experimental_xform) { |
| 2560 | deps += [ ":experimental_xform" ] |
| 2561 | sources += [ "gm/xform.cpp" ] |
| 2562 | } |
Brian Osman | c85f1fa | 2020-06-16 15:11:34 -0400 | [diff] [blame] | 2563 | if (skia_use_vulkan) { |
Brian Salomon | 3207fbe | 2020-06-30 11:09:25 -0400 | [diff] [blame] | 2564 | deps += [ |
| 2565 | "//third_party/spirv-tools:spvtools", |
| 2566 | |
| 2567 | #spvtools depends on this but doesn't deps it in. Looks like upstream bug |
| 2568 | #that we replicated in our third_party/spirv-tools/BUILD.gn |
| 2569 | "//third_party/spirv-tools:spvtools_val", |
| 2570 | ] |
Brian Osman | c85f1fa | 2020-06-16 15:11:34 -0400 | [diff] [blame] | 2571 | } |
Mike Reed | d62d406 | 2019-06-12 10:20:44 -0400 | [diff] [blame] | 2572 | } |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2573 | } |
| 2574 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2575 | 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] | 2576 | test_app("HelloWorld") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2577 | sources = [ "example/HelloWorld.cpp" ] |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2578 | libs = [] |
| 2579 | |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2580 | deps = [ |
| 2581 | ":flags", |
| 2582 | ":gpu_tool_utils", |
| 2583 | ":sk_app", |
| 2584 | ":skia", |
| 2585 | ":tool_utils", |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2586 | ] |
| 2587 | } |
| 2588 | } |
| 2589 | |
Mike Klein | 9f6468f | 2020-05-19 13:14:40 -0500 | [diff] [blame] | 2590 | if (skia_use_gl && (is_linux || is_mac || is_ios)) { |
Jim Van Verth | 4c70c75 | 2017-07-11 12:03:01 -0400 | [diff] [blame] | 2591 | test_app("SkiaSDLExample") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2592 | sources = [ "example/SkiaSDLExample.cpp" ] |
Jim Van Verth | 4c70c75 | 2017-07-11 12:03:01 -0400 | [diff] [blame] | 2593 | libs = [] |
Jim Van Verth | 4c70c75 | 2017-07-11 12:03:01 -0400 | [diff] [blame] | 2594 | deps = [ |
| 2595 | ":gpu_tool_utils", |
| 2596 | ":skia", |
| 2597 | "//third_party/libsdl", |
| 2598 | ] |
| 2599 | } |
| 2600 | } |
| 2601 | |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2602 | if (skia_qt_path != "" && (is_win || is_linux || is_mac)) { |
| 2603 | action_foreach("generate_mocs") { |
| 2604 | script = "gn/call.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2605 | sources = [ "tools/mdbviz/MainWindow.h" ] |
| 2606 | outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ] |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2607 | args = [ |
| 2608 | "$skia_qt_path" + "/bin/moc", |
| 2609 | "{{source}}", |
| 2610 | "-o", |
| 2611 | "gen/mdbviz/{{source_name_part}}_moc.cpp", |
| 2612 | ] |
| 2613 | } |
| 2614 | action_foreach("generate_resources") { |
| 2615 | script = "gn/call.py" |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2616 | sources = [ "tools/mdbviz/resources.qrc" ] |
| 2617 | outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ] |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2618 | args = [ |
| 2619 | "$skia_qt_path" + "/bin/rcc", |
| 2620 | "{{source}}", |
| 2621 | "-o", |
| 2622 | "gen/mdbviz/{{source_name_part}}_res.cpp", |
| 2623 | ] |
| 2624 | } |
| 2625 | test_app("mdbviz") { |
| 2626 | if (is_win) { |
| 2627 | # on Windows we need to disable some exception handling warnings due to the Qt headers |
| 2628 | cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017 |
| 2629 | } |
| 2630 | sources = [ |
Robert Phillips | 5fccf9d | 2017-09-05 15:10:12 -0400 | [diff] [blame] | 2631 | "tools/UrlDataManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 2632 | "tools/debugger/DebugCanvas.cpp", |
Nathaniel Nifong | 20b177a | 2019-12-12 11:05:10 -0500 | [diff] [blame] | 2633 | "tools/debugger/DebugLayerManager.cpp", |
Mike Klein | 8f4e224 | 2019-03-20 11:59:00 -0500 | [diff] [blame] | 2634 | "tools/debugger/DrawCommand.cpp", |
| 2635 | "tools/debugger/JsonWriteBuffer.cpp", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2636 | "tools/mdbviz/MainWindow.cpp", |
Robert Phillips | deaf568 | 2017-09-06 13:07:21 -0400 | [diff] [blame] | 2637 | "tools/mdbviz/Model.cpp", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2638 | "tools/mdbviz/main.cpp", |
| 2639 | |
| 2640 | # generated files |
| 2641 | "$target_gen_dir/mdbviz/MainWindow_moc.cpp", |
| 2642 | "$target_gen_dir/mdbviz/resources_res.cpp", |
| 2643 | ] |
| 2644 | lib_dirs = [ "$skia_qt_path/lib" ] |
| 2645 | libs = [ |
| 2646 | "Qt5Core.lib", |
| 2647 | "Qt5Gui.lib", |
| 2648 | "Qt5Widgets.lib", |
| 2649 | ] |
| 2650 | include_dirs = [ |
| 2651 | "$skia_qt_path/include", |
Robert Phillips | 276066b | 2017-09-06 17:17:44 -0400 | [diff] [blame] | 2652 | "$skia_qt_path/include/QtCore", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2653 | "$skia_qt_path/include/QtWidgets", |
| 2654 | ] |
| 2655 | deps = [ |
| 2656 | ":generate_mocs", |
| 2657 | ":generate_resources", |
| 2658 | ":skia", |
| 2659 | ] |
| 2660 | } |
| 2661 | } |
| 2662 | |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 2663 | if (is_android && defined(ndk) && ndk != "") { |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2664 | copy("gdbserver") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2665 | sources = [ "$ndk/$ndk_gdbserver" ] |
| 2666 | outputs = [ "$root_out_dir/gdbserver" ] |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2667 | } |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2668 | } |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 2669 | |
| 2670 | if (skia_use_opencl) { |
| 2671 | test_app("hello-opencl") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2672 | sources = [ "tools/hello-opencl.cpp" ] |
| 2673 | deps = [ "//third_party/opencl" ] |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 2674 | } |
| 2675 | } |
Hal Canary | b8f81af | 2019-04-24 13:56:16 -0400 | [diff] [blame] | 2676 | |
Brian Osman | f564f15 | 2019-07-23 15:14:30 -0400 | [diff] [blame] | 2677 | executable("cpu_modules") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2678 | sources = [ "tools/cpu_modules.cpp" ] |
Brian Osman | f564f15 | 2019-07-23 15:14:30 -0400 | [diff] [blame] | 2679 | deps = [ |
| 2680 | ":skia", |
| 2681 | "modules/particles", |
| 2682 | ] |
| 2683 | } |
| 2684 | |
Brian Salomon | f4ba4ec | 2020-03-19 15:54:28 -0400 | [diff] [blame] | 2685 | if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) { |
Hal Canary | 1f94d39 | 2019-07-30 09:27:56 -0400 | [diff] [blame] | 2686 | test_app("editor") { |
| 2687 | is_shared_library = is_android |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2688 | deps = [ "modules/skplaintexteditor:editor_app" ] |
Hal Canary | 1f94d39 | 2019-07-30 09:27:56 -0400 | [diff] [blame] | 2689 | } |
Hal Canary | b8f81af | 2019-04-24 13:56:16 -0400 | [diff] [blame] | 2690 | } |
Hal Canary | e5b65d2 | 2019-09-19 11:33:31 -0400 | [diff] [blame] | 2691 | |
| 2692 | executable("image_diff_metric") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 2693 | sources = [ "tools/image_diff_metric.cpp" ] |
| 2694 | deps = [ ":skia" ] |
Hal Canary | e5b65d2 | 2019-09-19 11:33:31 -0400 | [diff] [blame] | 2695 | } |
Chris Dalton | 2b59890 | 2020-03-25 10:50:35 -0600 | [diff] [blame] | 2696 | |
| 2697 | group("modules_testonly") { |
| 2698 | testonly = true |
| 2699 | deps = [] |
| 2700 | if (target_cpu == "wasm") { |
| 2701 | deps += [ "modules/canvaskit:viewer_wasm" ] |
| 2702 | } |
| 2703 | } |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2704 | |
| 2705 | if (skia_build_fuzzers) { |
| 2706 | template("libfuzzer_app") { |
| 2707 | output_dir = root_build_dir |
| 2708 | executable(target_name) { |
| 2709 | check_includes = false |
| 2710 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 2711 | configs += [ ":skia_private" ] |
| 2712 | sources += [ |
| 2713 | "fuzz/Fuzz.cpp", |
| 2714 | "fuzz/FuzzCommon.cpp", |
| 2715 | ] |
| 2716 | deps += [ |
| 2717 | ":flags", |
| 2718 | ":gpu_tool_utils", |
| 2719 | ":skia", |
| 2720 | ] |
| 2721 | defines = [ "SK_BUILD_FOR_LIBFUZZER" ] |
| 2722 | if (skia_use_libfuzzer_defaults) { |
| 2723 | cflags = [ "-fsanitize=fuzzer" ] |
| 2724 | ldflags = [ "-fsanitize=fuzzer" ] |
| 2725 | } |
| 2726 | testonly = true |
| 2727 | } |
| 2728 | } |
| 2729 | |
| 2730 | libfuzzer_app("region_deserialize") { |
| 2731 | sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ] |
| 2732 | deps = [] |
| 2733 | } |
| 2734 | |
| 2735 | libfuzzer_app("image_filter_deserialize") { |
| 2736 | include_dirs = [ |
| 2737 | "tools", |
| 2738 | "tools/fonts", |
| 2739 | ] |
| 2740 | sources = [ |
| 2741 | "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp", |
| 2742 | "tools/Resources.cpp", |
| 2743 | "tools/fonts/TestFontMgr.cpp", |
| 2744 | "tools/fonts/TestSVGTypeface.cpp", |
| 2745 | "tools/fonts/TestTypeface.cpp", |
| 2746 | ] |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2747 | deps = [ "modules/svg" ] |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2748 | } |
| 2749 | |
| 2750 | libfuzzer_app("region_set_path") { |
| 2751 | sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ] |
| 2752 | deps = [] |
| 2753 | } |
| 2754 | |
| 2755 | libfuzzer_app("textblob_deserialize") { |
| 2756 | include_dirs = [ |
| 2757 | "tools", |
| 2758 | "tools/fonts", |
| 2759 | ] |
| 2760 | sources = [ |
| 2761 | "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp", |
| 2762 | "tools/Resources.cpp", |
| 2763 | "tools/fonts/TestFontMgr.cpp", |
| 2764 | "tools/fonts/TestSVGTypeface.cpp", |
| 2765 | "tools/fonts/TestTypeface.cpp", |
| 2766 | ] |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2767 | deps = [ "modules/svg" ] |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2768 | } |
| 2769 | |
| 2770 | libfuzzer_app("path_deserialize") { |
| 2771 | sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ] |
| 2772 | deps = [] |
| 2773 | } |
| 2774 | |
| 2775 | libfuzzer_app("image_decode") { |
| 2776 | sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ] |
| 2777 | deps = [] |
| 2778 | } |
| 2779 | |
| 2780 | libfuzzer_app("animated_image_decode") { |
| 2781 | sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ] |
| 2782 | deps = [] |
| 2783 | } |
| 2784 | |
| 2785 | libfuzzer_app("api_create_ddl") { |
| 2786 | include_dirs = [ |
| 2787 | "include", |
| 2788 | "include/gpu", |
| 2789 | ] |
| 2790 | sources = [ |
| 2791 | "fuzz/FuzzCreateDDL.cpp", |
| 2792 | "fuzz/oss_fuzz/FuzzAPICreateDDL.cpp", |
| 2793 | "tools/Resources.cpp", |
| 2794 | "tools/UrlDataManager.cpp", |
| 2795 | "tools/debugger/DebugCanvas.cpp", |
| 2796 | "tools/debugger/DebugLayerManager.cpp", |
| 2797 | "tools/debugger/DrawCommand.cpp", |
| 2798 | "tools/debugger/JsonWriteBuffer.cpp", |
| 2799 | "tools/fonts/TestFontMgr.cpp", |
| 2800 | "tools/fonts/TestSVGTypeface.cpp", |
| 2801 | "tools/fonts/TestTypeface.cpp", |
| 2802 | ] |
| 2803 | deps = [ |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2804 | "modules/svg", |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2805 | "//third_party/libpng", |
| 2806 | ] |
| 2807 | } |
| 2808 | |
| 2809 | libfuzzer_app("api_draw_functions") { |
| 2810 | sources = [ |
| 2811 | "fuzz/FuzzDrawFunctions.cpp", |
| 2812 | "fuzz/oss_fuzz/FuzzDrawFunctions.cpp", |
| 2813 | ] |
| 2814 | deps = [] |
| 2815 | } |
| 2816 | |
| 2817 | libfuzzer_app("api_gradients") { |
| 2818 | sources = [ |
| 2819 | "fuzz/FuzzGradients.cpp", |
| 2820 | "fuzz/oss_fuzz/FuzzGradients.cpp", |
| 2821 | ] |
| 2822 | deps = [] |
| 2823 | } |
| 2824 | |
| 2825 | libfuzzer_app("api_image_filter") { |
| 2826 | include_dirs = [ |
| 2827 | "tools", |
| 2828 | "tools/debugger", |
| 2829 | ] |
| 2830 | sources = [ |
| 2831 | "fuzz/FuzzCanvas.cpp", |
| 2832 | "fuzz/oss_fuzz/FuzzAPIImageFilter.cpp", |
| 2833 | "tools/UrlDataManager.cpp", |
| 2834 | "tools/debugger/DebugCanvas.cpp", |
| 2835 | "tools/debugger/DebugLayerManager.cpp", |
| 2836 | "tools/debugger/DrawCommand.cpp", |
| 2837 | "tools/debugger/JsonWriteBuffer.cpp", |
| 2838 | ] |
| 2839 | deps = [ "//third_party/libpng" ] |
| 2840 | } |
| 2841 | |
| 2842 | libfuzzer_app("api_path_measure") { |
| 2843 | sources = [ |
| 2844 | "fuzz/FuzzPathMeasure.cpp", |
| 2845 | "fuzz/oss_fuzz/FuzzPathMeasure.cpp", |
| 2846 | ] |
| 2847 | deps = [] |
| 2848 | } |
| 2849 | |
| 2850 | libfuzzer_app("api_pathop") { |
| 2851 | sources = [ |
| 2852 | "fuzz/FuzzPathop.cpp", |
| 2853 | "fuzz/oss_fuzz/FuzzPathop.cpp", |
| 2854 | ] |
| 2855 | deps = [] |
| 2856 | } |
| 2857 | |
| 2858 | libfuzzer_app("api_raster_n32_canvas") { |
| 2859 | include_dirs = [ |
| 2860 | "tools", |
| 2861 | "tools/debugger", |
| 2862 | "tools/fonts", |
| 2863 | ] |
| 2864 | sources = [ |
| 2865 | "fuzz/FuzzCanvas.cpp", |
| 2866 | "fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp", |
| 2867 | "tools/Resources.cpp", |
| 2868 | "tools/UrlDataManager.cpp", |
| 2869 | "tools/debugger/DebugCanvas.cpp", |
| 2870 | "tools/debugger/DebugLayerManager.cpp", |
| 2871 | "tools/debugger/DrawCommand.cpp", |
| 2872 | "tools/debugger/JsonWriteBuffer.cpp", |
| 2873 | "tools/fonts/TestFontMgr.cpp", |
| 2874 | "tools/fonts/TestSVGTypeface.cpp", |
| 2875 | "tools/fonts/TestTypeface.cpp", |
| 2876 | ] |
| 2877 | deps = [ |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2878 | "modules/svg", |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2879 | "//third_party/libpng", |
| 2880 | ] |
| 2881 | } |
| 2882 | |
| 2883 | if (skia_use_gl) { |
| 2884 | libfuzzer_app("api_mock_gpu_canvas") { |
| 2885 | include_dirs = [ |
| 2886 | "tools", |
| 2887 | "tools/debugger", |
| 2888 | "tools/fonts", |
| 2889 | ] |
| 2890 | sources = [ |
| 2891 | "fuzz/FuzzCanvas.cpp", |
| 2892 | "fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp", |
| 2893 | "tools/LsanSuppressions.cpp", |
| 2894 | "tools/Resources.cpp", |
| 2895 | "tools/UrlDataManager.cpp", |
| 2896 | "tools/debugger/DebugCanvas.cpp", |
| 2897 | "tools/debugger/DebugLayerManager.cpp", |
| 2898 | "tools/debugger/DrawCommand.cpp", |
| 2899 | "tools/debugger/JsonWriteBuffer.cpp", |
| 2900 | "tools/fonts/TestFontMgr.cpp", |
| 2901 | "tools/fonts/TestSVGTypeface.cpp", |
| 2902 | "tools/fonts/TestTypeface.cpp", |
| 2903 | ] |
| 2904 | deps = [ |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2905 | "modules/svg", |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2906 | "//third_party/libpng", |
| 2907 | ] |
| 2908 | } |
| 2909 | } |
| 2910 | |
| 2911 | libfuzzer_app("api_null_canvas") { |
| 2912 | include_dirs = [ |
| 2913 | "tools", |
| 2914 | "tools/debugger", |
| 2915 | "tools/fonts", |
| 2916 | ] |
| 2917 | sources = [ |
| 2918 | "fuzz/FuzzCanvas.cpp", |
| 2919 | "fuzz/oss_fuzz/FuzzNullCanvas.cpp", |
| 2920 | "tools/Resources.cpp", |
| 2921 | "tools/UrlDataManager.cpp", |
| 2922 | "tools/debugger/DebugCanvas.cpp", |
| 2923 | "tools/debugger/DebugLayerManager.cpp", |
| 2924 | "tools/debugger/DrawCommand.cpp", |
| 2925 | "tools/debugger/JsonWriteBuffer.cpp", |
| 2926 | "tools/fonts/TestFontMgr.cpp", |
| 2927 | "tools/fonts/TestSVGTypeface.cpp", |
| 2928 | "tools/fonts/TestTypeface.cpp", |
| 2929 | ] |
| 2930 | deps = [ |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2931 | "modules/svg", |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2932 | "//third_party/libpng", |
| 2933 | ] |
| 2934 | } |
| 2935 | |
| 2936 | libfuzzer_app("api_svg_canvas") { |
| 2937 | include_dirs = [ |
| 2938 | "include", |
| 2939 | "include/svg", |
| 2940 | ] |
| 2941 | sources = [ |
| 2942 | "fuzz/FuzzCanvas.cpp", |
| 2943 | "fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp", |
| 2944 | "tools/Resources.cpp", |
| 2945 | "tools/UrlDataManager.cpp", |
| 2946 | "tools/debugger/DebugCanvas.cpp", |
| 2947 | "tools/debugger/DebugLayerManager.cpp", |
| 2948 | "tools/debugger/DrawCommand.cpp", |
| 2949 | "tools/debugger/JsonWriteBuffer.cpp", |
| 2950 | "tools/fonts/TestFontMgr.cpp", |
| 2951 | "tools/fonts/TestSVGTypeface.cpp", |
| 2952 | "tools/fonts/TestTypeface.cpp", |
| 2953 | ] |
| 2954 | deps = [ |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2955 | "modules/svg", |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2956 | "//third_party/libpng", |
| 2957 | ] |
| 2958 | } |
| 2959 | |
| 2960 | libfuzzer_app("png_encoder") { |
| 2961 | sources = [ |
| 2962 | "fuzz/FuzzEncoders.cpp", |
| 2963 | "fuzz/oss_fuzz/FuzzPNGEncoder.cpp", |
| 2964 | ] |
| 2965 | deps = [] |
| 2966 | } |
| 2967 | |
| 2968 | libfuzzer_app("jpeg_encoder") { |
| 2969 | sources = [ |
| 2970 | "fuzz/FuzzEncoders.cpp", |
| 2971 | "fuzz/oss_fuzz/FuzzJPEGEncoder.cpp", |
| 2972 | ] |
| 2973 | deps = [] |
| 2974 | } |
| 2975 | |
| 2976 | libfuzzer_app("webp_encoder") { |
| 2977 | sources = [ |
| 2978 | "fuzz/FuzzEncoders.cpp", |
| 2979 | "fuzz/oss_fuzz/FuzzWEBPEncoder.cpp", |
| 2980 | ] |
| 2981 | deps = [] |
| 2982 | } |
| 2983 | |
| 2984 | libfuzzer_app("skottie_json") { |
| 2985 | sources = [ |
| 2986 | "modules/skottie/fuzz/FuzzSkottieJSON.cpp", |
| 2987 | "tools/Resources.cpp", |
| 2988 | "tools/fonts/TestFontMgr.cpp", |
| 2989 | "tools/fonts/TestSVGTypeface.cpp", |
| 2990 | "tools/fonts/TestTypeface.cpp", |
| 2991 | ] |
| 2992 | deps = [ |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2993 | "modules/skottie:skottie", |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 2994 | "modules/svg", |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 2995 | ] |
| 2996 | } |
| 2997 | |
| 2998 | libfuzzer_app("skjson") { |
| 2999 | sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ] |
| 3000 | deps = [] |
| 3001 | } |
| 3002 | |
| 3003 | libfuzzer_app("api_polyutils") { |
| 3004 | sources = [ |
| 3005 | "fuzz/FuzzPolyUtils.cpp", |
| 3006 | "fuzz/oss_fuzz/FuzzPolyUtils.cpp", |
| 3007 | ] |
| 3008 | deps = [ ":skia" ] |
| 3009 | } |
| 3010 | |
| 3011 | libfuzzer_app("android_codec") { |
| 3012 | sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ] |
| 3013 | deps = [] |
| 3014 | } |
| 3015 | |
| 3016 | libfuzzer_app("image_decode_incremental") { |
| 3017 | sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ] |
| 3018 | deps = [] |
| 3019 | } |
| 3020 | |
| 3021 | libfuzzer_app("sksl2glsl") { |
| 3022 | sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ] |
| 3023 | deps = [] |
| 3024 | } |
| 3025 | |
| 3026 | libfuzzer_app("sksl2spirv") { |
| 3027 | sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ] |
| 3028 | deps = [] |
| 3029 | } |
| 3030 | |
| 3031 | libfuzzer_app("sksl2metal") { |
| 3032 | sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ] |
| 3033 | deps = [] |
| 3034 | } |
| 3035 | |
| 3036 | libfuzzer_app("sksl2pipeline") { |
| 3037 | sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ] |
| 3038 | deps = [] |
| 3039 | } |
| 3040 | |
| 3041 | libfuzzer_app("skdescriptor_deserialize") { |
| 3042 | sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ] |
| 3043 | deps = [] |
| 3044 | } |
| 3045 | |
| 3046 | libfuzzer_app("svg_dom") { |
| 3047 | sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ] |
Florin Malita | b341810 | 2020-10-15 18:10:29 -0400 | [diff] [blame] | 3048 | deps = [ "modules/svg" ] |
Kevin Lubick | 272e8bc | 2020-09-15 10:05:41 -0400 | [diff] [blame] | 3049 | } |
| 3050 | |
| 3051 | libfuzzer_app("skruntimeeffect") { |
| 3052 | sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ] |
| 3053 | deps = [] |
| 3054 | } |
| 3055 | |
| 3056 | libfuzzer_app("skp") { |
| 3057 | sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ] |
| 3058 | deps = [] |
| 3059 | } |
| 3060 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 3061 | } |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 3062 | |
Chinmay Garde | a1ea0a9 | 2019-10-01 16:37:10 -0700 | [diff] [blame] | 3063 | if (is_ios && skia_use_metal && !skia_enable_flutter_defines) { |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 3064 | group("minimal_ios_mtl_skia_app") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 3065 | deps = [ "experimental/minimal_ios_mtl_skia_app" ] |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 3066 | } |
Hal Canary | 2748306 | 2019-12-06 15:01:08 -0500 | [diff] [blame] | 3067 | } |
| 3068 | |
Hal Canary | 60ff651 | 2020-01-21 12:39:20 -0500 | [diff] [blame] | 3069 | if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) { |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 3070 | group("skottie_ios") { |
Mike Klein | a01c6b0 | 2020-04-01 13:47:34 -0500 | [diff] [blame] | 3071 | deps = [ "tools/skottie_ios_app" ] |
Hal Canary | 932a2c0 | 2019-09-17 10:43:18 -0400 | [diff] [blame] | 3072 | } |
| 3073 | } |