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