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