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