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