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 | |
mikejurka | 8c24f4f | 2016-09-12 16:51:58 -0700 | [diff] [blame] | 6 | import("gn/shared_sources.gni") |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 7 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 8 | declare_args() { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 9 | skia_enable_tools = !is_fuchsia && !is_component_build |
| 10 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 11 | skia_use_expat = true |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 12 | skia_use_fontconfig = is_linux |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 13 | skia_use_freetype = is_android || is_fuchsia || is_linux |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 14 | skia_use_giflib = !is_fuchsia |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 15 | skia_use_libjpeg_turbo = true |
| 16 | skia_use_libpng = true |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 17 | skia_use_libwebp = !is_fuchsia |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 18 | skia_use_sfntly = !is_fuchsia |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 19 | skia_use_vulkan = false |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 20 | skia_use_zlib = true |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 21 | } |
| 22 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 23 | fontmgr_android_enabled = skia_use_expat && skia_use_freetype |
| 24 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 25 | skia_public_includes = [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 26 | "include/android", |
mtklein | fa84d94 | 2016-07-28 09:45:14 -0700 | [diff] [blame] | 27 | "include/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 28 | "include/codec", |
| 29 | "include/config", |
| 30 | "include/core", |
| 31 | "include/effects", |
| 32 | "include/gpu", |
| 33 | "include/gpu/gl", |
| 34 | "include/images", |
| 35 | "include/pathops", |
| 36 | "include/ports", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 37 | "include/svg", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 38 | "include/utils", |
| 39 | "include/utils/mac", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 40 | "include/xml", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 41 | ] |
| 42 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 43 | # Skia public API, generally provided by :skia. |
| 44 | config("skia_public") { |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 45 | include_dirs = skia_public_includes |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 46 | defines = [ "SKIA_DLL" ] |
jcgregorio | 5561e3d | 2016-08-25 09:25:11 -0700 | [diff] [blame] | 47 | if (is_linux) { |
| 48 | defines += [ "SK_SAMPLES_FOR_X" ] |
| 49 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | # Skia internal APIs, used by Skia itself and a few test tools. |
| 53 | config("skia_private") { |
| 54 | visibility = [ ":*" ] |
| 55 | |
| 56 | include_dirs = [ |
| 57 | "include/private", |
| 58 | "src/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 59 | "src/codec", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 60 | "src/config", |
| 61 | "src/core", |
| 62 | "src/effects", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 63 | "src/effects/gradients", |
| 64 | "src/fonts", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 65 | "src/gpu", |
| 66 | "src/image", |
| 67 | "src/images", |
| 68 | "src/lazy", |
| 69 | "src/opts", |
| 70 | "src/pathops", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 71 | "src/pdf", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 72 | "src/ports", |
| 73 | "src/sfnt", |
mtklein | 9e0d9dd | 2016-08-30 10:37:19 -0700 | [diff] [blame] | 74 | "src/sksl", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 75 | "src/utils", |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 76 | "src/utils/win", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 77 | "third_party/etc1", |
| 78 | "third_party/ktx", |
| 79 | ] |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 80 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 81 | defines = [ "SK_GAMMA_APPLY_TO_A8" ] |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 82 | if (is_android) { |
| 83 | defines += [ |
| 84 | "SK_GAMMA_EXPONENT=1.4", |
| 85 | "SK_GAMMA_CONTRAST=0.0", |
| 86 | ] |
| 87 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 88 | } |
| 89 | |
| 90 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 91 | config("skia_library") { |
| 92 | visibility = [ ":*" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 93 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
| 94 | } |
| 95 | |
| 96 | skia_library_configs = [ |
| 97 | ":skia_public", |
| 98 | ":skia_private", |
| 99 | ":skia_library", |
| 100 | ] |
| 101 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 102 | # Use for CPU-specific Skia code that needs particular compiler flags. |
| 103 | template("opts") { |
| 104 | if (invoker.enabled) { |
| 105 | source_set(target_name) { |
| 106 | forward_variables_from(invoker, "*") |
| 107 | configs += skia_library_configs |
| 108 | } |
| 109 | } else { |
| 110 | # If not enabled, a phony empty target that swallows all otherwise unused variables. |
| 111 | source_set(target_name) { |
| 112 | forward_variables_from(invoker, |
| 113 | "*", |
| 114 | [ |
| 115 | "sources", |
| 116 | "cflags", |
| 117 | ]) |
| 118 | } |
| 119 | } |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 120 | } |
| 121 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 122 | is_x86 = current_cpu == "x64" || current_cpu == "x86" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 123 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 124 | opts("none") { |
| 125 | enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 126 | sources = skia_opts.none_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 127 | cflags = [] |
| 128 | } |
| 129 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 130 | opts("armv7") { |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 131 | enabled = current_cpu == "arm" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 132 | sources = skia_opts.armv7_sources + skia_opts.neon_sources |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 133 | cflags = [] |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | opts("arm64") { |
| 137 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 138 | sources = skia_opts.arm64_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 139 | cflags = [] |
| 140 | } |
| 141 | |
| 142 | opts("crc32") { |
| 143 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 144 | sources = skia_opts.crc32_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 145 | cflags = [ "-march=armv8-a+crc" ] |
| 146 | } |
| 147 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 148 | opts("sse2") { |
| 149 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 150 | sources = skia_opts.sse2_sources |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 151 | cflags = [ "-msse2" ] |
| 152 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 153 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 154 | opts("ssse3") { |
| 155 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 156 | sources = skia_opts.ssse3_sources |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 157 | cflags = [ "-mssse3" ] |
| 158 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 159 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 160 | opts("sse41") { |
| 161 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 162 | sources = skia_opts.sse41_sources |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 163 | cflags = [ "-msse4.1" ] |
| 164 | } |
mtklein | 4e97607 | 2016-08-08 09:06:27 -0700 | [diff] [blame] | 165 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 166 | opts("sse42") { |
| 167 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 168 | sources = skia_opts.sse42_sources |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 169 | cflags = [ "-msse4.2" ] |
| 170 | } |
| 171 | |
| 172 | opts("avx") { |
| 173 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 174 | sources = skia_opts.avx_sources |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 175 | cflags = [ "-mavx" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 176 | } |
| 177 | |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 178 | opts("dsp") { |
| 179 | enabled = current_cpu == "mipsel" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 180 | sources = skia_opts.mips_dsp_sources |
mtklein | b6064ef | 2016-08-30 11:49:24 -0700 | [diff] [blame] | 181 | cflags = [] |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 182 | } |
| 183 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 184 | # 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] | 185 | template("optional") { |
| 186 | if (invoker.enabled) { |
| 187 | config(target_name + "_public") { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 188 | if (defined(invoker.public_defines)) { |
| 189 | defines = invoker.public_defines |
| 190 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 191 | } |
| 192 | source_set(target_name) { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 193 | forward_variables_from(invoker, |
| 194 | "*", |
| 195 | [ |
| 196 | "public_defines", |
| 197 | "sources_when_disabled", |
| 198 | ]) |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 199 | all_dependent_configs = [ ":" + target_name + "_public" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 200 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 201 | } |
| 202 | } else { |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 203 | source_set(target_name) { |
| 204 | forward_variables_from(invoker, |
| 205 | "*", |
| 206 | [ |
| 207 | "public_defines", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 208 | "deps", |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 209 | "libs", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 210 | "sources", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 211 | "sources_when_disabled", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 212 | ]) |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 213 | if (defined(invoker.sources_when_disabled)) { |
| 214 | sources = invoker.sources_when_disabled |
| 215 | } |
| 216 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 217 | } |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 218 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 219 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 220 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 221 | optional("fontmgr_android") { |
| 222 | enabled = fontmgr_android_enabled |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 223 | |
| 224 | deps = [ |
| 225 | "//third_party/expat", |
| 226 | "//third_party/freetype2", |
| 227 | ] |
| 228 | sources = [ |
| 229 | "src/ports/SkFontMgr_android.cpp", |
| 230 | "src/ports/SkFontMgr_android_factory.cpp", |
| 231 | "src/ports/SkFontMgr_android_parser.cpp", |
| 232 | ] |
| 233 | } |
| 234 | |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 235 | optional("fontmgr_custom") { |
| 236 | enabled = is_linux && skia_use_freetype && !skia_use_fontconfig |
| 237 | |
| 238 | deps = [ |
| 239 | "//third_party/freetype2", |
| 240 | ] |
| 241 | sources = [ |
| 242 | "src/ports/SkFontMgr_custom.cpp", |
| 243 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 244 | ] |
| 245 | } |
| 246 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 247 | optional("fontmgr_fontconfig") { |
| 248 | enabled = skia_use_freetype && skia_use_fontconfig |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 249 | |
| 250 | deps = [ |
| 251 | "//third_party:fontconfig", |
| 252 | "//third_party/freetype2", |
| 253 | ] |
| 254 | sources = [ |
| 255 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 256 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 257 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
| 258 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 259 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
| 260 | ] |
| 261 | } |
| 262 | |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 263 | optional("fontmgr_fuchsia") { |
| 264 | enabled = is_fuchsia && skia_use_freetype |
| 265 | |
| 266 | deps = [ |
| 267 | "//third_party/freetype2", |
| 268 | ] |
| 269 | sources = [ |
| 270 | "src/ports/SkFontMgr_custom.cpp", |
| 271 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
| 272 | ] |
| 273 | } |
| 274 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 275 | optional("gif") { |
| 276 | enabled = skia_use_giflib |
| 277 | public_defines = [ "SK_HAS_GIF_LIBRARY" ] |
| 278 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 279 | deps = [ |
| 280 | "//third_party/giflib", |
| 281 | ] |
| 282 | sources = [ |
| 283 | "src/codec/SkGifCodec.cpp", |
| 284 | ] |
| 285 | } |
| 286 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 287 | optional("jpeg") { |
| 288 | enabled = skia_use_libjpeg_turbo |
| 289 | public_defines = [ "SK_HAS_JPEG_LIBRARY" ] |
| 290 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 291 | deps = [ |
| 292 | "//third_party/libjpeg-turbo:libjpeg", |
| 293 | ] |
| 294 | sources = [ |
| 295 | "src/codec/SkJpegCodec.cpp", |
| 296 | "src/codec/SkJpegDecoderMgr.cpp", |
| 297 | "src/codec/SkJpegUtility.cpp", |
| 298 | "src/images/SkJPEGImageEncoder.cpp", |
| 299 | "src/images/SkJPEGWriteUtility.cpp", |
| 300 | ] |
| 301 | } |
| 302 | |
| 303 | optional("pdf") { |
| 304 | enabled = skia_use_zlib |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 305 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 306 | deps = [ |
| 307 | "//third_party/zlib", |
| 308 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 309 | sources = skia_pdf_sources |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 310 | sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 311 | |
| 312 | if (skia_use_sfntly) { |
| 313 | deps += [ "//third_party/sfntly" ] |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 314 | public_defines = [ "SK_PDF_USE_SFNTLY" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 315 | } |
| 316 | } |
| 317 | |
| 318 | optional("png") { |
| 319 | enabled = skia_use_libpng |
| 320 | public_defines = [ "SK_HAS_PNG_LIBRARY" ] |
| 321 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 322 | deps = [ |
| 323 | "//third_party/libpng", |
| 324 | ] |
| 325 | sources = [ |
| 326 | "src/codec/SkIcoCodec.cpp", |
| 327 | "src/codec/SkPngCodec.cpp", |
| 328 | "src/images/SkPNGImageEncoder.cpp", |
| 329 | ] |
| 330 | } |
| 331 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 332 | optional("typeface_freetype") { |
| 333 | enabled = skia_use_freetype |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 334 | |
| 335 | deps = [ |
| 336 | "//third_party/freetype2", |
| 337 | ] |
| 338 | sources = [ |
| 339 | "src/ports/SkFontHost_FreeType.cpp", |
| 340 | "src/ports/SkFontHost_FreeType_common.cpp", |
| 341 | ] |
| 342 | } |
| 343 | |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 344 | optional("vulkan") { |
| 345 | enabled = skia_use_vulkan |
| 346 | public_defines = [ "SK_VULKAN" ] |
| 347 | libs = [ "vulkan" ] |
| 348 | sources = skia_vk_sources |
| 349 | } |
| 350 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 351 | optional("webp") { |
| 352 | enabled = skia_use_libwebp |
| 353 | public_defines = [ "SK_HAS_WEBP_LIBRARY" ] |
| 354 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 355 | deps = [ |
| 356 | "//third_party/libwebp", |
| 357 | ] |
| 358 | sources = [ |
| 359 | "src/codec/SkWebpAdapterCodec.cpp", |
| 360 | "src/codec/SkWebpCodec.cpp", |
| 361 | "src/images/SkWEBPImageEncoder.cpp", |
| 362 | ] |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 363 | } |
| 364 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 365 | optional("xml") { |
| 366 | enabled = skia_use_expat |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 367 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 368 | deps = [ |
| 369 | "//third_party/expat", |
| 370 | ] |
| 371 | sources = [ |
| 372 | "src/xml/SkDOM.cpp", |
| 373 | "src/xml/SkXMLParser.cpp", |
| 374 | "src/xml/SkXMLWriter.cpp", |
| 375 | ] |
| 376 | } |
| 377 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 378 | component("skia") { |
| 379 | public_configs = [ ":skia_public" ] |
| 380 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 381 | |
| 382 | deps = [ |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 383 | ":arm64", |
| 384 | ":armv7", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 385 | ":avx", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 386 | ":crc32", |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 387 | ":dsp", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 388 | ":fontmgr_android", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 389 | ":fontmgr_custom", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 390 | ":fontmgr_fontconfig", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 391 | ":fontmgr_fuchsia", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 392 | ":gif", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 393 | ":jpeg", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 394 | ":none", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 395 | ":pdf", |
| 396 | ":png", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 397 | ":sse2", |
| 398 | ":sse41", |
| 399 | ":sse42", |
| 400 | ":ssse3", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 401 | ":typeface_freetype", |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 402 | ":vulkan", |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 403 | ":webp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 404 | ":xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 405 | ] |
| 406 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 407 | sources = [] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 408 | sources += skia_core_sources |
| 409 | sources += skia_effects_sources |
| 410 | sources += skia_gpu_sources |
| 411 | sources += skia_sksl_sources |
| 412 | sources += skia_utils_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 413 | sources += [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 414 | "src/android/SkBitmapRegionCodec.cpp", |
| 415 | "src/android/SkBitmapRegionDecoder.cpp", |
| 416 | "src/codec/SkAndroidCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 417 | "src/codec/SkBmpCodec.cpp", |
| 418 | "src/codec/SkBmpMaskCodec.cpp", |
| 419 | "src/codec/SkBmpRLECodec.cpp", |
| 420 | "src/codec/SkBmpStandardCodec.cpp", |
| 421 | "src/codec/SkCodec.cpp", |
| 422 | "src/codec/SkCodecImageGenerator.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 423 | "src/codec/SkMaskSwizzler.cpp", |
| 424 | "src/codec/SkMasks.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 425 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 426 | "src/codec/SkSampler.cpp", |
| 427 | "src/codec/SkSwizzler.cpp", |
| 428 | "src/codec/SkWbmpCodec.cpp", |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 429 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 430 | "src/images/SkImageEncoder.cpp", |
| 431 | "src/images/SkImageEncoder_Factory.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 432 | "src/images/SkKTXImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 433 | "src/ports/SkDiscardableMemory_none.cpp", |
| 434 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 435 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 436 | "src/ports/SkMemory_malloc.cpp", |
| 437 | "src/ports/SkOSFile_stdio.cpp", |
| 438 | "src/sfnt/SkOTTable_name.cpp", |
| 439 | "src/sfnt/SkOTUtils.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 440 | "src/svg/SkSVGCanvas.cpp", |
| 441 | "src/svg/SkSVGDevice.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 442 | "src/utils/mac/SkStream_mac.cpp", |
| 443 | "third_party/etc1/etc1.cpp", |
| 444 | "third_party/ktx/ktx.cpp", |
| 445 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 446 | |
| 447 | # These paths need to be absolute to match the ones produced by |
| 448 | # shared_sources.gni, but this file may be used from different directory |
| 449 | # locations. |
| 450 | sources -= get_path_info([ |
| 451 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 452 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
| 453 | ], |
| 454 | "abspath") |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 455 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 456 | libs = [] |
| 457 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 458 | if (is_win) { |
| 459 | sources += [ |
| 460 | "src/ports/SkDebug_win.cpp", |
| 461 | "src/ports/SkFontHost_win.cpp", |
| 462 | "src/ports/SkFontMgr_win_dw.cpp", |
| 463 | "src/ports/SkFontMgr_win_dw_factory.cpp", |
| 464 | "src/ports/SkImageEncoder_WIC.cpp", |
| 465 | "src/ports/SkImageGeneratorWIC.cpp", |
| 466 | "src/ports/SkOSFile_win.cpp", |
| 467 | "src/ports/SkScalerContext_win_dw.cpp", |
| 468 | "src/ports/SkTLS_win.cpp", |
| 469 | "src/ports/SkTypeface_win_dw.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 470 | "src/xps/SkDocument_XPS.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 471 | ] |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 472 | sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 473 | } else { |
| 474 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 475 | "src/ports/SkOSFile_posix.cpp", |
| 476 | "src/ports/SkTLS_pthread.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 477 | "src/xps/SkDocument_XPS_None.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 478 | ] |
| 479 | } |
| 480 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 481 | if (is_android) { |
| 482 | deps += [ |
| 483 | "//third_party/cpu-features", |
| 484 | "//third_party/expat", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 485 | ] |
| 486 | sources += [ |
| 487 | "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp", |
| 488 | "src/ports/SkDebug_android.cpp", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 489 | ] |
| 490 | libs += [ |
| 491 | "EGL", |
| 492 | "GLESv2", |
| 493 | "log", |
| 494 | ] |
| 495 | } |
| 496 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 497 | if (is_linux) { |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 498 | libs += [ |
| 499 | "GL", |
| 500 | "GLU", |
| 501 | "X11", |
| 502 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 503 | sources += [ |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 504 | "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 505 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 506 | ] |
| 507 | } |
| 508 | |
| 509 | if (is_mac) { |
| 510 | sources += [ |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 511 | "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 512 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 513 | "src/ports/SkFontHost_mac.cpp", |
| 514 | "src/ports/SkImageEncoder_CG.cpp", |
| 515 | "src/ports/SkImageGeneratorCG.cpp", |
| 516 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 517 | libs += [ |
| 518 | "ApplicationServices.framework", |
| 519 | "OpenGL.framework", |
| 520 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 521 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 522 | |
| 523 | if (is_fuchsia) { |
mikejurka | 21cc995 | 2016-09-13 16:15:03 -0700 | [diff] [blame] | 524 | sources += [ |
| 525 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 526 | "src/ports/SkDebug_stdio.cpp", |
| 527 | ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 528 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 529 | } |
| 530 | |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 531 | skia_h_headers = exec_script("gyp/find.py", |
| 532 | [ "*.h" ] + rebase_path(skia_public_includes), |
| 533 | "list lines", |
| 534 | []) - |
| 535 | [ |
| 536 | rebase_path("include/gpu/gl/GrGLConfig_chrome.h"), |
| 537 | rebase_path("include/gpu/vk/GrVkBackendContext.h"), |
| 538 | rebase_path("include/gpu/vk/GrVkDefines.h"), |
| 539 | rebase_path("include/gpu/vk/GrVkInterface.h"), |
| 540 | rebase_path("include/gpu/vk/GrVkTypes.h"), |
| 541 | rebase_path("include/ports/SkFontMgr_fontconfig.h"), |
| 542 | ] |
| 543 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 544 | action("skia.h") { |
| 545 | script = "gn/echo_headers.py" |
| 546 | args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 547 | rebase_path(skia_h_headers, target_gen_dir) |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 548 | outputs = [ |
| 549 | "$target_gen_dir/skia.h", |
| 550 | ] |
| 551 | } |
| 552 | |
| 553 | executable("fiddle") { |
| 554 | include_dirs = [ "$target_gen_dir" ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 555 | libs = [] |
| 556 | if (is_linux) { |
| 557 | libs += [ "OSMesa" ] |
| 558 | } |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 559 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 560 | sources = [ |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 561 | "src/images/SkForceLinking.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 562 | "tools/fiddle/draw.cpp", |
| 563 | "tools/fiddle/fiddle_main.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 564 | ] |
| 565 | deps = [ |
| 566 | ":skia", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 567 | ":skia.h", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 568 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 569 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 570 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 571 | # Targets guarded by skia_enable_tools may use //third_party freely. |
| 572 | if (skia_enable_tools) { |
| 573 | template("test_lib") { |
| 574 | config(target_name + "_config") { |
| 575 | include_dirs = invoker.public_include_dirs |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 576 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 577 | source_set(target_name) { |
| 578 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 579 | public_configs = [ |
| 580 | ":" + target_name + "_config", |
| 581 | ":skia_private", |
| 582 | ] |
| 583 | |
| 584 | if (!defined(deps)) { |
| 585 | deps = [] |
| 586 | } |
| 587 | deps += [ ":skia" ] |
| 588 | testonly = true |
| 589 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 590 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 591 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 592 | test_lib("gpu_tool_utils") { |
| 593 | public_include_dirs = [ "tools/gpu" ] |
| 594 | sources = [ |
| 595 | "tools/gpu/GrContextFactory.cpp", |
| 596 | "tools/gpu/GrTest.cpp", |
| 597 | "tools/gpu/TestContext.cpp", |
| 598 | "tools/gpu/gl/GLTestContext.cpp", |
| 599 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", |
| 600 | "tools/gpu/gl/debug/GrBufferObj.cpp", |
| 601 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", |
| 602 | "tools/gpu/gl/debug/GrProgramObj.cpp", |
| 603 | "tools/gpu/gl/debug/GrShaderObj.cpp", |
| 604 | "tools/gpu/gl/debug/GrTextureObj.cpp", |
| 605 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", |
| 606 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 607 | ] |
| 608 | libs = [] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 609 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 610 | if (is_android) { |
| 611 | sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] |
| 612 | } else if (is_linux) { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 613 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
| 614 | } else if (is_mac) { |
| 615 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
| 616 | } |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 617 | |
| 618 | if (skia_use_vulkan) { |
| 619 | sources += [ "tools/gpu/vk/VkTestContext.cpp" ] |
| 620 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 621 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 622 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 623 | test_lib("flags") { |
| 624 | public_include_dirs = [ "tools/flags" ] |
| 625 | sources = [ |
| 626 | "tools/flags/SkCommandLineFlags.cpp", |
| 627 | "tools/flags/SkCommonFlags.cpp", |
| 628 | "tools/flags/SkCommonFlagsConfig.cpp", |
| 629 | ] |
| 630 | deps = [ |
| 631 | ":gpu_tool_utils", |
| 632 | ] |
| 633 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 634 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 635 | test_lib("tool_utils") { |
| 636 | public_include_dirs = [ |
| 637 | "tools", |
| 638 | "tools/debugger", |
| 639 | "tools/timer", |
| 640 | ] |
| 641 | sources = [ |
| 642 | "src/images/SkForceLinking.cpp", |
| 643 | "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools? |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 644 | "tools/AndroidSkDebugToStdOut.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 645 | "tools/CrashHandler.cpp", |
mtklein | 0590fa5 | 2016-09-01 07:06:54 -0700 | [diff] [blame] | 646 | "tools/LsanSuppressions.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 647 | "tools/ProcStats.cpp", |
| 648 | "tools/Resources.cpp", |
| 649 | "tools/ThermalManager.cpp", |
| 650 | "tools/UrlDataManager.cpp", |
| 651 | "tools/debugger/SkDebugCanvas.cpp", |
| 652 | "tools/debugger/SkDrawCommand.cpp", |
| 653 | "tools/debugger/SkJsonWriteBuffer.cpp", |
| 654 | "tools/debugger/SkObjectParser.cpp", |
| 655 | "tools/debugger/SkOverdrawMode.cpp", |
| 656 | "tools/picture_utils.cpp", |
| 657 | "tools/random_parse_path.cpp", |
| 658 | "tools/sk_tool_utils.cpp", |
| 659 | "tools/sk_tool_utils_font.cpp", |
| 660 | "tools/timer/Timer.cpp", |
| 661 | ] |
| 662 | deps = [ |
| 663 | ":flags", |
| 664 | "//third_party/libpng", |
| 665 | ] |
| 666 | public_deps = [ |
| 667 | "//third_party/jsoncpp", |
| 668 | ] |
| 669 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 670 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 671 | gm_sources = exec_script("gyp/find.py", |
| 672 | [ |
| 673 | "*.c*", |
| 674 | rebase_path("gm"), |
| 675 | ], |
| 676 | "list lines", |
| 677 | []) |
| 678 | test_lib("gm") { |
| 679 | public_include_dirs = [ "gm" ] |
| 680 | sources = gm_sources |
| 681 | deps = [ |
| 682 | ":gpu_tool_utils", |
| 683 | ":skia", |
| 684 | ":tool_utils", |
| 685 | ] |
| 686 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 687 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 688 | tests_sources = exec_script("gyp/find.py", |
| 689 | [ |
| 690 | "*.c*", |
| 691 | rebase_path("tests"), |
| 692 | ], |
| 693 | "list lines", |
| 694 | []) |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 695 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 696 | test_lib("tests") { |
| 697 | public_include_dirs = [ "tests" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 698 | sources = tests_sources - [ |
| 699 | rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 700 | rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile |
| 701 | rebase_path("tests/skia_test.cpp"), # alternate main |
| 702 | ] |
| 703 | if (!fontmgr_android_enabled) { |
| 704 | sources -= [ rebase_path("tests/FontMgrAndroidParserTest.cpp") ] |
| 705 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 706 | deps = [ |
fmalita | 6cf896d | 2016-08-25 08:44:35 -0700 | [diff] [blame] | 707 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 708 | ":flags", |
| 709 | ":gpu_tool_utils", |
| 710 | ":skia", |
| 711 | ":tool_utils", |
| 712 | "//third_party/libpng", |
| 713 | "//third_party/zlib", |
| 714 | ] |
| 715 | } |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 716 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 717 | bench_sources = exec_script("gyp/find.py", |
| 718 | [ |
| 719 | "*.c*", |
| 720 | rebase_path("bench"), |
| 721 | ], |
| 722 | "list lines", |
| 723 | []) |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 724 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 725 | test_lib("bench") { |
| 726 | public_include_dirs = [ "bench" ] |
| 727 | sources = bench_sources |
| 728 | sources -= [ |
| 729 | rebase_path("bench/nanobench.cpp"), |
| 730 | rebase_path("bench/nanobenchAndroid.cpp"), |
| 731 | ] |
| 732 | deps = [ |
| 733 | ":flags", |
| 734 | ":gm", |
| 735 | ":gpu_tool_utils", |
| 736 | ":skia", |
| 737 | ":tool_utils", |
| 738 | ] |
| 739 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 740 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 741 | test_lib("experimental_svg_model") { |
| 742 | public_include_dirs = [ "experimental/svg/model" ] |
| 743 | sources = [ |
| 744 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 745 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
| 746 | "experimental/svg/model/SkSVGCircle.cpp", |
| 747 | "experimental/svg/model/SkSVGContainer.cpp", |
| 748 | "experimental/svg/model/SkSVGDOM.cpp", |
| 749 | "experimental/svg/model/SkSVGEllipse.cpp", |
| 750 | "experimental/svg/model/SkSVGLine.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 751 | "experimental/svg/model/SkSVGLinearGradient.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 752 | "experimental/svg/model/SkSVGNode.cpp", |
| 753 | "experimental/svg/model/SkSVGPath.cpp", |
| 754 | "experimental/svg/model/SkSVGPoly.cpp", |
| 755 | "experimental/svg/model/SkSVGRect.cpp", |
| 756 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 757 | "experimental/svg/model/SkSVGSVG.cpp", |
| 758 | "experimental/svg/model/SkSVGShape.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 759 | "experimental/svg/model/SkSVGStop.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 760 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 761 | "experimental/svg/model/SkSVGValue.cpp", |
| 762 | ] |
| 763 | deps = [ |
| 764 | ":skia", |
| 765 | ] |
| 766 | } |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 767 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 768 | executable("dm") { |
| 769 | sources = [ |
| 770 | "dm/DM.cpp", |
| 771 | "dm/DMJsonWriter.cpp", |
| 772 | "dm/DMSrcSink.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 773 | ] |
| 774 | include_dirs = [ "tests" ] |
| 775 | deps = [ |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 776 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 777 | ":flags", |
| 778 | ":gm", |
| 779 | ":gpu_tool_utils", |
| 780 | ":skia", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 781 | ":tests", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 782 | ":tool_utils", |
| 783 | "//third_party/jsoncpp", |
| 784 | "//third_party/libpng", |
| 785 | ] |
| 786 | testonly = true |
| 787 | } |
| 788 | |
| 789 | executable("monobench") { |
| 790 | sources = [ |
| 791 | "tools/monobench.cpp", |
| 792 | ] |
| 793 | deps = [ |
| 794 | ":bench", |
| 795 | ":skia", |
| 796 | ] |
| 797 | testonly = true |
| 798 | } |
| 799 | |
| 800 | executable("nanobench") { |
| 801 | sources = [ |
| 802 | "bench/nanobench.cpp", |
| 803 | ] |
| 804 | deps = [ |
| 805 | ":bench", |
fmalita | 6519c21 | 2016-09-14 08:05:17 -0700 | [diff] [blame^] | 806 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 807 | ":flags", |
| 808 | ":gm", |
| 809 | ":gpu_tool_utils", |
| 810 | ":skia", |
| 811 | ":tool_utils", |
| 812 | "//third_party/jsoncpp", |
| 813 | ] |
| 814 | testonly = true |
| 815 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 816 | |
mtklein | 6f5df6a | 2016-08-29 16:01:10 -0700 | [diff] [blame] | 817 | if (current_cpu != "mipsel") { # Clang 3.8 crashes while compiling hb-icu.cc for mipsel. |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 818 | executable("sktexttopdf-hb") { |
mtklein | 6f5df6a | 2016-08-29 16:01:10 -0700 | [diff] [blame] | 819 | sources = [ |
| 820 | "tools/SkShaper_harfbuzz.cpp", |
| 821 | "tools/using_skia_and_harfbuzz.cpp", |
| 822 | ] |
| 823 | deps = [ |
| 824 | ":skia", |
| 825 | "//third_party/harfbuzz", |
| 826 | ] |
| 827 | testonly = true |
| 828 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 829 | } |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 830 | executable("sktexttopdf") { |
| 831 | sources = [ |
| 832 | "tools/SkShaper_primitive.cpp", |
| 833 | "tools/using_skia_and_harfbuzz.cpp", |
| 834 | ] |
| 835 | deps = [ |
| 836 | ":skia", |
| 837 | ] |
| 838 | testonly = true |
| 839 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 840 | } |