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