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