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