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