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 |
| 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 | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 261 | optional("fontmgr_fuchsia") { |
| 262 | enabled = is_fuchsia && skia_use_freetype |
| 263 | |
| 264 | deps = [ |
| 265 | "//third_party/freetype2", |
| 266 | ] |
| 267 | sources = [ |
| 268 | "src/ports/SkFontMgr_custom.cpp", |
| 269 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
| 270 | ] |
| 271 | } |
| 272 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 273 | optional("gif") { |
| 274 | enabled = skia_use_giflib |
| 275 | public_defines = [ "SK_HAS_GIF_LIBRARY" ] |
| 276 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 277 | deps = [ |
| 278 | "//third_party/giflib", |
| 279 | ] |
| 280 | sources = [ |
| 281 | "src/codec/SkGifCodec.cpp", |
| 282 | ] |
| 283 | } |
| 284 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 285 | optional("jpeg") { |
| 286 | enabled = skia_use_libjpeg_turbo |
| 287 | public_defines = [ "SK_HAS_JPEG_LIBRARY" ] |
| 288 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 289 | deps = [ |
| 290 | "//third_party/libjpeg-turbo:libjpeg", |
| 291 | ] |
| 292 | sources = [ |
| 293 | "src/codec/SkJpegCodec.cpp", |
| 294 | "src/codec/SkJpegDecoderMgr.cpp", |
| 295 | "src/codec/SkJpegUtility.cpp", |
| 296 | "src/images/SkJPEGImageEncoder.cpp", |
| 297 | "src/images/SkJPEGWriteUtility.cpp", |
| 298 | ] |
| 299 | } |
| 300 | |
| 301 | optional("pdf") { |
| 302 | enabled = skia_use_zlib |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 303 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 304 | deps = [ |
| 305 | "//third_party/zlib", |
| 306 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 307 | sources = skia_pdf_sources |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 308 | sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 309 | |
| 310 | if (skia_use_sfntly) { |
| 311 | deps += [ "//third_party/sfntly" ] |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 312 | public_defines = [ "SK_PDF_USE_SFNTLY" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 313 | } |
| 314 | } |
| 315 | |
| 316 | optional("png") { |
| 317 | enabled = skia_use_libpng |
| 318 | public_defines = [ "SK_HAS_PNG_LIBRARY" ] |
| 319 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 320 | deps = [ |
| 321 | "//third_party/libpng", |
| 322 | ] |
| 323 | sources = [ |
| 324 | "src/codec/SkIcoCodec.cpp", |
| 325 | "src/codec/SkPngCodec.cpp", |
| 326 | "src/images/SkPNGImageEncoder.cpp", |
| 327 | ] |
| 328 | } |
| 329 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 330 | optional("typeface_freetype") { |
| 331 | enabled = skia_use_freetype |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 332 | |
| 333 | deps = [ |
| 334 | "//third_party/freetype2", |
| 335 | ] |
| 336 | sources = [ |
| 337 | "src/ports/SkFontHost_FreeType.cpp", |
| 338 | "src/ports/SkFontHost_FreeType_common.cpp", |
| 339 | ] |
| 340 | } |
| 341 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 342 | optional("webp") { |
| 343 | enabled = skia_use_libwebp |
| 344 | public_defines = [ "SK_HAS_WEBP_LIBRARY" ] |
| 345 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 346 | deps = [ |
| 347 | "//third_party/libwebp", |
| 348 | ] |
| 349 | sources = [ |
| 350 | "src/codec/SkWebpAdapterCodec.cpp", |
| 351 | "src/codec/SkWebpCodec.cpp", |
| 352 | "src/images/SkWEBPImageEncoder.cpp", |
| 353 | ] |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 354 | } |
| 355 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 356 | optional("xml") { |
| 357 | enabled = skia_use_expat |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 358 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 359 | deps = [ |
| 360 | "//third_party/expat", |
| 361 | ] |
| 362 | sources = [ |
| 363 | "src/xml/SkDOM.cpp", |
| 364 | "src/xml/SkXMLParser.cpp", |
| 365 | "src/xml/SkXMLWriter.cpp", |
| 366 | ] |
| 367 | } |
| 368 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 369 | component("skia") { |
| 370 | public_configs = [ ":skia_public" ] |
| 371 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 372 | |
| 373 | deps = [ |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 374 | ":arm64", |
| 375 | ":armv7", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 376 | ":avx", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 377 | ":crc32", |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 378 | ":dsp", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 379 | ":fontmgr_android", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 380 | ":fontmgr_custom", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 381 | ":fontmgr_fontconfig", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 382 | ":fontmgr_fuchsia", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 383 | ":gif", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 384 | ":jpeg", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 385 | ":none", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 386 | ":pdf", |
| 387 | ":png", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 388 | ":sse2", |
| 389 | ":sse41", |
| 390 | ":sse42", |
| 391 | ":ssse3", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 392 | ":typeface_freetype", |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 393 | ":webp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 394 | ":xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 395 | ] |
| 396 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 397 | sources = [] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 398 | sources += skia_core_sources |
| 399 | sources += skia_effects_sources |
| 400 | sources += skia_gpu_sources |
| 401 | sources += skia_sksl_sources |
| 402 | sources += skia_utils_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 403 | sources += [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 404 | "src/android/SkBitmapRegionCodec.cpp", |
| 405 | "src/android/SkBitmapRegionDecoder.cpp", |
| 406 | "src/codec/SkAndroidCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 407 | "src/codec/SkBmpCodec.cpp", |
| 408 | "src/codec/SkBmpMaskCodec.cpp", |
| 409 | "src/codec/SkBmpRLECodec.cpp", |
| 410 | "src/codec/SkBmpStandardCodec.cpp", |
| 411 | "src/codec/SkCodec.cpp", |
| 412 | "src/codec/SkCodecImageGenerator.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 413 | "src/codec/SkMaskSwizzler.cpp", |
| 414 | "src/codec/SkMasks.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 415 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 416 | "src/codec/SkSampler.cpp", |
| 417 | "src/codec/SkSwizzler.cpp", |
| 418 | "src/codec/SkWbmpCodec.cpp", |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 419 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 420 | "src/images/SkImageEncoder.cpp", |
| 421 | "src/images/SkImageEncoder_Factory.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 422 | "src/images/SkKTXImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 423 | "src/ports/SkDiscardableMemory_none.cpp", |
| 424 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 425 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 426 | "src/ports/SkMemory_malloc.cpp", |
| 427 | "src/ports/SkOSFile_stdio.cpp", |
| 428 | "src/sfnt/SkOTTable_name.cpp", |
| 429 | "src/sfnt/SkOTUtils.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 430 | "src/svg/SkSVGCanvas.cpp", |
| 431 | "src/svg/SkSVGDevice.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 432 | "src/utils/mac/SkStream_mac.cpp", |
| 433 | "third_party/etc1/etc1.cpp", |
| 434 | "third_party/ktx/ktx.cpp", |
| 435 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 436 | |
| 437 | # These paths need to be absolute to match the ones produced by |
| 438 | # shared_sources.gni, but this file may be used from different directory |
| 439 | # locations. |
| 440 | sources -= get_path_info([ |
| 441 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 442 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
| 443 | ], |
| 444 | "abspath") |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 445 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 446 | libs = [] |
| 447 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 448 | if (is_win) { |
| 449 | sources += [ |
| 450 | "src/ports/SkDebug_win.cpp", |
| 451 | "src/ports/SkFontHost_win.cpp", |
| 452 | "src/ports/SkFontMgr_win_dw.cpp", |
| 453 | "src/ports/SkFontMgr_win_dw_factory.cpp", |
| 454 | "src/ports/SkImageEncoder_WIC.cpp", |
| 455 | "src/ports/SkImageGeneratorWIC.cpp", |
| 456 | "src/ports/SkOSFile_win.cpp", |
| 457 | "src/ports/SkScalerContext_win_dw.cpp", |
| 458 | "src/ports/SkTLS_win.cpp", |
| 459 | "src/ports/SkTypeface_win_dw.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 460 | "src/xps/SkDocument_XPS.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 461 | ] |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 462 | sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 463 | } else { |
| 464 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 465 | "src/ports/SkOSFile_posix.cpp", |
| 466 | "src/ports/SkTLS_pthread.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 467 | "src/xps/SkDocument_XPS_None.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 468 | ] |
| 469 | } |
| 470 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 471 | if (is_android) { |
| 472 | deps += [ |
| 473 | "//third_party/cpu-features", |
| 474 | "//third_party/expat", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 475 | ] |
| 476 | sources += [ |
| 477 | "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp", |
| 478 | "src/ports/SkDebug_android.cpp", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 479 | ] |
| 480 | libs += [ |
| 481 | "EGL", |
| 482 | "GLESv2", |
| 483 | "log", |
| 484 | ] |
| 485 | } |
| 486 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 487 | if (is_linux) { |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 488 | libs += [ |
| 489 | "GL", |
| 490 | "GLU", |
| 491 | "X11", |
| 492 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 493 | sources += [ |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 494 | "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 495 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 496 | ] |
| 497 | } |
| 498 | |
| 499 | if (is_mac) { |
| 500 | sources += [ |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 501 | "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 502 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 503 | "src/ports/SkFontHost_mac.cpp", |
| 504 | "src/ports/SkImageEncoder_CG.cpp", |
| 505 | "src/ports/SkImageGeneratorCG.cpp", |
| 506 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 507 | libs += [ |
| 508 | "ApplicationServices.framework", |
| 509 | "OpenGL.framework", |
| 510 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 511 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 512 | |
| 513 | if (is_fuchsia) { |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 514 | sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 515 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 516 | } |
| 517 | |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 518 | skia_h_headers = exec_script("gyp/find.py", |
| 519 | [ "*.h" ] + rebase_path(skia_public_includes), |
| 520 | "list lines", |
| 521 | []) - |
| 522 | [ |
| 523 | rebase_path("include/gpu/gl/GrGLConfig_chrome.h"), |
| 524 | rebase_path("include/gpu/vk/GrVkBackendContext.h"), |
| 525 | rebase_path("include/gpu/vk/GrVkDefines.h"), |
| 526 | rebase_path("include/gpu/vk/GrVkInterface.h"), |
| 527 | rebase_path("include/gpu/vk/GrVkTypes.h"), |
| 528 | rebase_path("include/ports/SkFontMgr_fontconfig.h"), |
| 529 | ] |
| 530 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 531 | action("skia.h") { |
| 532 | script = "gn/echo_headers.py" |
| 533 | args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 534 | rebase_path(skia_h_headers, target_gen_dir) |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 535 | outputs = [ |
| 536 | "$target_gen_dir/skia.h", |
| 537 | ] |
| 538 | } |
| 539 | |
| 540 | executable("fiddle") { |
| 541 | include_dirs = [ "$target_gen_dir" ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 542 | libs = [] |
| 543 | if (is_linux) { |
| 544 | libs += [ "OSMesa" ] |
| 545 | } |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 546 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 547 | sources = [ |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 548 | "src/images/SkForceLinking.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 549 | "tools/fiddle/draw.cpp", |
| 550 | "tools/fiddle/fiddle_main.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 551 | ] |
| 552 | deps = [ |
| 553 | ":skia", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 554 | ":skia.h", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 555 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 556 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 557 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 558 | # Targets guarded by skia_enable_tools may use //third_party freely. |
| 559 | if (skia_enable_tools) { |
| 560 | template("test_lib") { |
| 561 | config(target_name + "_config") { |
| 562 | include_dirs = invoker.public_include_dirs |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 563 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 564 | source_set(target_name) { |
| 565 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 566 | public_configs = [ |
| 567 | ":" + target_name + "_config", |
| 568 | ":skia_private", |
| 569 | ] |
| 570 | |
| 571 | if (!defined(deps)) { |
| 572 | deps = [] |
| 573 | } |
| 574 | deps += [ ":skia" ] |
| 575 | testonly = true |
| 576 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 577 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 578 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 579 | test_lib("gpu_tool_utils") { |
| 580 | public_include_dirs = [ "tools/gpu" ] |
| 581 | sources = [ |
| 582 | "tools/gpu/GrContextFactory.cpp", |
| 583 | "tools/gpu/GrTest.cpp", |
| 584 | "tools/gpu/TestContext.cpp", |
| 585 | "tools/gpu/gl/GLTestContext.cpp", |
| 586 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", |
| 587 | "tools/gpu/gl/debug/GrBufferObj.cpp", |
| 588 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", |
| 589 | "tools/gpu/gl/debug/GrProgramObj.cpp", |
| 590 | "tools/gpu/gl/debug/GrShaderObj.cpp", |
| 591 | "tools/gpu/gl/debug/GrTextureObj.cpp", |
| 592 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", |
| 593 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 594 | ] |
| 595 | libs = [] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 596 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 597 | if (is_android) { |
| 598 | sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] |
| 599 | } else if (is_linux) { |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 600 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
| 601 | } else if (is_mac) { |
| 602 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
| 603 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 604 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 605 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 606 | test_lib("flags") { |
| 607 | public_include_dirs = [ "tools/flags" ] |
| 608 | sources = [ |
| 609 | "tools/flags/SkCommandLineFlags.cpp", |
| 610 | "tools/flags/SkCommonFlags.cpp", |
| 611 | "tools/flags/SkCommonFlagsConfig.cpp", |
| 612 | ] |
| 613 | deps = [ |
| 614 | ":gpu_tool_utils", |
| 615 | ] |
| 616 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 617 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 618 | test_lib("tool_utils") { |
| 619 | public_include_dirs = [ |
| 620 | "tools", |
| 621 | "tools/debugger", |
| 622 | "tools/timer", |
| 623 | ] |
| 624 | sources = [ |
| 625 | "src/images/SkForceLinking.cpp", |
| 626 | "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools? |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 627 | "tools/AndroidSkDebugToStdOut.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 628 | "tools/CrashHandler.cpp", |
mtklein | 0590fa5 | 2016-09-01 07:06:54 -0700 | [diff] [blame] | 629 | "tools/LsanSuppressions.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 630 | "tools/ProcStats.cpp", |
| 631 | "tools/Resources.cpp", |
| 632 | "tools/ThermalManager.cpp", |
| 633 | "tools/UrlDataManager.cpp", |
| 634 | "tools/debugger/SkDebugCanvas.cpp", |
| 635 | "tools/debugger/SkDrawCommand.cpp", |
| 636 | "tools/debugger/SkJsonWriteBuffer.cpp", |
| 637 | "tools/debugger/SkObjectParser.cpp", |
| 638 | "tools/debugger/SkOverdrawMode.cpp", |
| 639 | "tools/picture_utils.cpp", |
| 640 | "tools/random_parse_path.cpp", |
| 641 | "tools/sk_tool_utils.cpp", |
| 642 | "tools/sk_tool_utils_font.cpp", |
| 643 | "tools/timer/Timer.cpp", |
| 644 | ] |
| 645 | deps = [ |
| 646 | ":flags", |
| 647 | "//third_party/libpng", |
| 648 | ] |
| 649 | public_deps = [ |
| 650 | "//third_party/jsoncpp", |
| 651 | ] |
| 652 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 653 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 654 | gm_sources = exec_script("gyp/find.py", |
| 655 | [ |
| 656 | "*.c*", |
| 657 | rebase_path("gm"), |
| 658 | ], |
| 659 | "list lines", |
| 660 | []) |
| 661 | test_lib("gm") { |
| 662 | public_include_dirs = [ "gm" ] |
| 663 | sources = gm_sources |
| 664 | deps = [ |
| 665 | ":gpu_tool_utils", |
| 666 | ":skia", |
| 667 | ":tool_utils", |
| 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 | tests_sources = exec_script("gyp/find.py", |
| 672 | [ |
| 673 | "*.c*", |
| 674 | rebase_path("tests"), |
| 675 | ], |
| 676 | "list lines", |
| 677 | []) |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 678 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 679 | test_lib("tests") { |
| 680 | public_include_dirs = [ "tests" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 681 | sources = tests_sources - [ |
| 682 | rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 683 | rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile |
| 684 | rebase_path("tests/skia_test.cpp"), # alternate main |
| 685 | ] |
| 686 | if (!fontmgr_android_enabled) { |
| 687 | sources -= [ rebase_path("tests/FontMgrAndroidParserTest.cpp") ] |
| 688 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 689 | deps = [ |
fmalita | 6cf896d | 2016-08-25 08:44:35 -0700 | [diff] [blame] | 690 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 691 | ":flags", |
| 692 | ":gpu_tool_utils", |
| 693 | ":skia", |
| 694 | ":tool_utils", |
| 695 | "//third_party/libpng", |
| 696 | "//third_party/zlib", |
| 697 | ] |
| 698 | } |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 699 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 700 | bench_sources = exec_script("gyp/find.py", |
| 701 | [ |
| 702 | "*.c*", |
| 703 | rebase_path("bench"), |
| 704 | ], |
| 705 | "list lines", |
| 706 | []) |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 707 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 708 | test_lib("bench") { |
| 709 | public_include_dirs = [ "bench" ] |
| 710 | sources = bench_sources |
| 711 | sources -= [ |
| 712 | rebase_path("bench/nanobench.cpp"), |
| 713 | rebase_path("bench/nanobenchAndroid.cpp"), |
| 714 | ] |
| 715 | deps = [ |
| 716 | ":flags", |
| 717 | ":gm", |
| 718 | ":gpu_tool_utils", |
| 719 | ":skia", |
| 720 | ":tool_utils", |
| 721 | ] |
| 722 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 723 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 724 | test_lib("experimental_svg_model") { |
| 725 | public_include_dirs = [ "experimental/svg/model" ] |
| 726 | sources = [ |
| 727 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 728 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
| 729 | "experimental/svg/model/SkSVGCircle.cpp", |
| 730 | "experimental/svg/model/SkSVGContainer.cpp", |
| 731 | "experimental/svg/model/SkSVGDOM.cpp", |
| 732 | "experimental/svg/model/SkSVGEllipse.cpp", |
| 733 | "experimental/svg/model/SkSVGLine.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 734 | "experimental/svg/model/SkSVGLinearGradient.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 735 | "experimental/svg/model/SkSVGNode.cpp", |
| 736 | "experimental/svg/model/SkSVGPath.cpp", |
| 737 | "experimental/svg/model/SkSVGPoly.cpp", |
| 738 | "experimental/svg/model/SkSVGRect.cpp", |
| 739 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 740 | "experimental/svg/model/SkSVGSVG.cpp", |
| 741 | "experimental/svg/model/SkSVGShape.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 742 | "experimental/svg/model/SkSVGStop.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 743 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 744 | "experimental/svg/model/SkSVGValue.cpp", |
| 745 | ] |
| 746 | deps = [ |
| 747 | ":skia", |
| 748 | ] |
| 749 | } |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 750 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 751 | executable("dm") { |
| 752 | sources = [ |
| 753 | "dm/DM.cpp", |
| 754 | "dm/DMJsonWriter.cpp", |
| 755 | "dm/DMSrcSink.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 756 | ] |
| 757 | include_dirs = [ "tests" ] |
| 758 | deps = [ |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 759 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 760 | ":flags", |
| 761 | ":gm", |
| 762 | ":gpu_tool_utils", |
| 763 | ":skia", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 764 | ":tests", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 765 | ":tool_utils", |
| 766 | "//third_party/jsoncpp", |
| 767 | "//third_party/libpng", |
| 768 | ] |
| 769 | testonly = true |
| 770 | } |
| 771 | |
| 772 | executable("monobench") { |
| 773 | sources = [ |
| 774 | "tools/monobench.cpp", |
| 775 | ] |
| 776 | deps = [ |
| 777 | ":bench", |
| 778 | ":skia", |
| 779 | ] |
| 780 | testonly = true |
| 781 | } |
| 782 | |
| 783 | executable("nanobench") { |
| 784 | sources = [ |
| 785 | "bench/nanobench.cpp", |
| 786 | ] |
| 787 | deps = [ |
| 788 | ":bench", |
| 789 | ":flags", |
| 790 | ":gm", |
| 791 | ":gpu_tool_utils", |
| 792 | ":skia", |
| 793 | ":tool_utils", |
| 794 | "//third_party/jsoncpp", |
| 795 | ] |
| 796 | testonly = true |
| 797 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 798 | |
mtklein | 6f5df6a | 2016-08-29 16:01:10 -0700 | [diff] [blame] | 799 | 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] | 800 | executable("sktexttopdf-hb") { |
mtklein | 6f5df6a | 2016-08-29 16:01:10 -0700 | [diff] [blame] | 801 | sources = [ |
| 802 | "tools/SkShaper_harfbuzz.cpp", |
| 803 | "tools/using_skia_and_harfbuzz.cpp", |
| 804 | ] |
| 805 | deps = [ |
| 806 | ":skia", |
| 807 | "//third_party/harfbuzz", |
| 808 | ] |
| 809 | testonly = true |
| 810 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 811 | } |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 812 | executable("sktexttopdf") { |
| 813 | sources = [ |
| 814 | "tools/SkShaper_primitive.cpp", |
| 815 | "tools/using_skia_and_harfbuzz.cpp", |
| 816 | ] |
| 817 | deps = [ |
| 818 | ":skia", |
| 819 | ] |
| 820 | testonly = true |
| 821 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 822 | } |