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