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