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 |
Mike Klein | 69f6ed4 | 2016-10-13 15:45:07 -0400 | [diff] [blame] | 17 | skia_use_gdi = false |
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 |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 22 | skia_use_sfntly = !is_fuchsia && !is_win # TODO: icu on Windows, re-enable this. |
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 |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 30 | skia_vulkan_sdk = "" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 33 | skia_use_vulkan = skia_use_vulkan || skia_vulkan_sdk != "" |
| 34 | |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 35 | # Our tools require static linking (they use non-exported symbols). |
| 36 | skia_enable_tools = skia_enable_tools && !is_component_build |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 37 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 38 | fontmgr_android_enabled = skia_use_expat && skia_use_freetype |
| 39 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 40 | skia_public_includes = [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 41 | "include/android", |
mtklein | fa84d94 | 2016-07-28 09:45:14 -0700 | [diff] [blame] | 42 | "include/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 43 | "include/codec", |
| 44 | "include/config", |
| 45 | "include/core", |
| 46 | "include/effects", |
| 47 | "include/gpu", |
| 48 | "include/gpu/gl", |
| 49 | "include/images", |
| 50 | "include/pathops", |
| 51 | "include/ports", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 52 | "include/svg", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 53 | "include/utils", |
| 54 | "include/utils/mac", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 55 | "include/xml", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 56 | ] |
| 57 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 58 | # Skia public API, generally provided by :skia. |
| 59 | config("skia_public") { |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 60 | include_dirs = skia_public_includes |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 61 | defines = [] |
| 62 | if (is_component_build) { |
| 63 | defines += [ "SKIA_DLL" ] |
| 64 | } |
Mike Klein | c4cbd74 | 2016-09-26 21:37:09 -0400 | [diff] [blame] | 65 | if (is_fuchsia || is_linux) { |
jcgregorio | 5561e3d | 2016-08-25 09:25:11 -0700 | [diff] [blame] | 66 | defines += [ "SK_SAMPLES_FOR_X" ] |
| 67 | } |
mtklein | cae1be5 | 2016-09-20 08:24:34 -0700 | [diff] [blame] | 68 | if (skia_enable_android_framework_defines) { |
| 69 | defines += skia_android_framework_defines |
| 70 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 71 | if (!skia_enable_gpu) { |
| 72 | defines += [ "SK_SUPPORT_GPU=0" ] |
| 73 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | # Skia internal APIs, used by Skia itself and a few test tools. |
| 77 | config("skia_private") { |
| 78 | visibility = [ ":*" ] |
| 79 | |
| 80 | include_dirs = [ |
| 81 | "include/private", |
| 82 | "src/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 83 | "src/codec", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 84 | "src/config", |
| 85 | "src/core", |
| 86 | "src/effects", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 87 | "src/effects/gradients", |
| 88 | "src/fonts", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 89 | "src/gpu", |
| 90 | "src/image", |
| 91 | "src/images", |
| 92 | "src/lazy", |
| 93 | "src/opts", |
| 94 | "src/pathops", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 95 | "src/pdf", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 96 | "src/ports", |
| 97 | "src/sfnt", |
mtklein | 9e0d9dd | 2016-08-30 10:37:19 -0700 | [diff] [blame] | 98 | "src/sksl", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 99 | "src/utils", |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 100 | "src/utils/win", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 101 | "third_party/etc1", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 102 | "third_party/gif", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 103 | "third_party/ktx", |
| 104 | ] |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 105 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 106 | defines = [ "SK_GAMMA_APPLY_TO_A8" ] |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 107 | if (is_android) { |
| 108 | defines += [ |
| 109 | "SK_GAMMA_EXPONENT=1.4", |
| 110 | "SK_GAMMA_CONTRAST=0.0", |
| 111 | ] |
| 112 | } |
mtklein | 88a7ac0 | 2016-09-14 11:16:49 -0700 | [diff] [blame] | 113 | if (is_official_build || is_android) { |
| 114 | # TODO(bsalomon): it'd be nice to make Android normal. |
| 115 | defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ] |
| 116 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 117 | libs = [] |
| 118 | lib_dirs = [] |
| 119 | if (skia_use_vulkan) { |
| 120 | if (skia_vulkan_sdk != "") { |
Mike Klein | 487bfc2 | 2016-10-14 14:04:56 -0400 | [diff] [blame] | 121 | if (is_win) { |
| 122 | include_dirs += [ "$skia_vulkan_sdk/Include/" ] |
| 123 | lib_dirs += [ "$skia_vulkan_sdk/Bin" ] |
| 124 | } else { |
| 125 | include_dirs += [ "$skia_vulkan_sdk/x86_64/include/" ] |
| 126 | lib_dirs += [ "$skia_vulkan_sdk/x86_64/lib/" ] |
| 127 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 128 | } |
Mike Klein | 487bfc2 | 2016-10-14 14:04:56 -0400 | [diff] [blame] | 129 | if (is_win) { |
| 130 | libs += [ "vulkan-1.lib" ] |
| 131 | } else { |
| 132 | libs += [ "vulkan" ] |
| 133 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 134 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 138 | config("skia_library") { |
| 139 | visibility = [ ":*" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 140 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
| 141 | } |
| 142 | |
| 143 | skia_library_configs = [ |
| 144 | ":skia_public", |
| 145 | ":skia_private", |
| 146 | ":skia_library", |
| 147 | ] |
| 148 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 149 | # Use for CPU-specific Skia code that needs particular compiler flags. |
| 150 | template("opts") { |
| 151 | if (invoker.enabled) { |
| 152 | source_set(target_name) { |
| 153 | forward_variables_from(invoker, "*") |
| 154 | configs += skia_library_configs |
| 155 | } |
| 156 | } else { |
| 157 | # If not enabled, a phony empty target that swallows all otherwise unused variables. |
| 158 | source_set(target_name) { |
| 159 | forward_variables_from(invoker, |
| 160 | "*", |
| 161 | [ |
| 162 | "sources", |
| 163 | "cflags", |
| 164 | ]) |
| 165 | } |
| 166 | } |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 167 | } |
| 168 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 169 | is_x86 = current_cpu == "x64" || current_cpu == "x86" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 170 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 171 | opts("none") { |
| 172 | enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 173 | sources = skia_opts.none_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 174 | cflags = [] |
| 175 | } |
| 176 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 177 | opts("armv7") { |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 178 | enabled = current_cpu == "arm" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 179 | sources = skia_opts.armv7_sources + skia_opts.neon_sources |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 180 | cflags = [] |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | opts("arm64") { |
| 184 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 185 | sources = skia_opts.arm64_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 186 | cflags = [] |
| 187 | } |
| 188 | |
| 189 | opts("crc32") { |
| 190 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 191 | sources = skia_opts.crc32_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 192 | cflags = [ "-march=armv8-a+crc" ] |
| 193 | } |
| 194 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 195 | opts("sse2") { |
| 196 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 197 | sources = skia_opts.sse2_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 198 | if (is_win) { |
| 199 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ] |
| 200 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 201 | cflags = [ "-msse2" ] |
| 202 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 203 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 204 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 205 | opts("ssse3") { |
| 206 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 207 | sources = skia_opts.ssse3_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 208 | if (is_win) { |
| 209 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ] |
| 210 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 211 | cflags = [ "-mssse3" ] |
| 212 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 213 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 214 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 215 | opts("sse41") { |
| 216 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 217 | sources = skia_opts.sse41_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 218 | if (is_win) { |
| 219 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ] |
| 220 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 221 | cflags = [ "-msse4.1" ] |
| 222 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 223 | } |
mtklein | 4e97607 | 2016-08-08 09:06:27 -0700 | [diff] [blame] | 224 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 225 | opts("sse42") { |
| 226 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 227 | sources = skia_opts.sse42_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 228 | if (is_win) { |
| 229 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ] |
| 230 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 231 | cflags = [ "-msse4.2" ] |
| 232 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 233 | } |
| 234 | |
| 235 | opts("avx") { |
| 236 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 237 | sources = skia_opts.avx_sources |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 238 | if (is_win) { |
| 239 | cflags = [ "/arch:AVX" ] |
| 240 | } else { |
| 241 | cflags = [ "-mavx" ] |
| 242 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 243 | } |
| 244 | |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 245 | opts("hsw") { |
| 246 | enabled = is_x86 |
| 247 | sources = skia_opts.hsw_sources |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 248 | if (is_win) { |
| 249 | cflags = [ "/arch:AVX2" ] |
| 250 | } else { |
| 251 | cflags = [ |
| 252 | "-mavx2", |
| 253 | "-mbmi", |
| 254 | "-mbmi2", |
| 255 | "-mf16c", |
| 256 | "-mfma", |
| 257 | ] |
| 258 | } |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 259 | } |
| 260 | |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 261 | opts("dsp") { |
| 262 | enabled = current_cpu == "mipsel" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 263 | sources = skia_opts.mips_dsp_sources |
mtklein | b6064ef | 2016-08-30 11:49:24 -0700 | [diff] [blame] | 264 | cflags = [] |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 265 | } |
| 266 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 267 | # 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] | 268 | template("optional") { |
| 269 | if (invoker.enabled) { |
| 270 | config(target_name + "_public") { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 271 | if (defined(invoker.public_defines)) { |
| 272 | defines = invoker.public_defines |
| 273 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 274 | } |
| 275 | source_set(target_name) { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 276 | forward_variables_from(invoker, |
| 277 | "*", |
| 278 | [ |
| 279 | "public_defines", |
| 280 | "sources_when_disabled", |
| 281 | ]) |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 282 | all_dependent_configs = [ ":" + target_name + "_public" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 283 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 284 | } |
| 285 | } else { |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 286 | source_set(target_name) { |
| 287 | forward_variables_from(invoker, |
| 288 | "*", |
| 289 | [ |
| 290 | "public_defines", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 291 | "deps", |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 292 | "libs", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 293 | "sources", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 294 | "sources_when_disabled", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 295 | ]) |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 296 | if (defined(invoker.sources_when_disabled)) { |
| 297 | sources = invoker.sources_when_disabled |
| 298 | } |
| 299 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 300 | } |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 301 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 302 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 303 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 304 | optional("fontmgr_android") { |
| 305 | enabled = fontmgr_android_enabled |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 306 | |
| 307 | deps = [ |
| 308 | "//third_party/expat", |
| 309 | "//third_party/freetype2", |
| 310 | ] |
| 311 | sources = [ |
| 312 | "src/ports/SkFontMgr_android.cpp", |
| 313 | "src/ports/SkFontMgr_android_factory.cpp", |
| 314 | "src/ports/SkFontMgr_android_parser.cpp", |
| 315 | ] |
| 316 | } |
| 317 | |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 318 | optional("fontmgr_custom") { |
| 319 | enabled = is_linux && skia_use_freetype && !skia_use_fontconfig |
| 320 | |
| 321 | deps = [ |
| 322 | "//third_party/freetype2", |
| 323 | ] |
| 324 | sources = [ |
| 325 | "src/ports/SkFontMgr_custom.cpp", |
| 326 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
| 327 | ] |
| 328 | } |
| 329 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 330 | optional("fontmgr_fontconfig") { |
| 331 | enabled = skia_use_freetype && skia_use_fontconfig |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 332 | |
| 333 | deps = [ |
| 334 | "//third_party:fontconfig", |
| 335 | "//third_party/freetype2", |
| 336 | ] |
| 337 | sources = [ |
bungeman | 1ae0e01 | 2016-09-19 12:13:16 -0700 | [diff] [blame] | 338 | "src/ports/SkFontConfigInterface.cpp", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 339 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 340 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 341 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
| 342 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 343 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
| 344 | ] |
| 345 | } |
| 346 | |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 347 | optional("fontmgr_fuchsia") { |
| 348 | enabled = is_fuchsia && skia_use_freetype |
| 349 | |
| 350 | deps = [ |
| 351 | "//third_party/freetype2", |
| 352 | ] |
| 353 | sources = [ |
| 354 | "src/ports/SkFontMgr_custom.cpp", |
| 355 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
| 356 | ] |
| 357 | } |
| 358 | |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 359 | optional("gpu") { |
| 360 | enabled = skia_enable_gpu |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 361 | public_defines = [] |
| 362 | |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 363 | sources = skia_gpu_sources + [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] |
| 364 | |
| 365 | # These paths need to be absolute to match the ones produced by shared_sources.gni. |
| 366 | sources -= get_path_info([ |
| 367 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 368 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
| 369 | ], |
| 370 | "abspath") |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 371 | libs = [] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 372 | if (is_android) { |
| 373 | sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ] |
| 374 | } else if (is_linux) { |
| 375 | sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ] |
| 376 | } else if (is_mac) { |
| 377 | sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ] |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 378 | } else if (is_win) { |
| 379 | sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ] |
| 380 | libs += [ "OpenGL32.lib" ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 381 | } else { |
| 382 | sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ] |
| 383 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 384 | |
| 385 | if (skia_use_vulkan) { |
| 386 | public_defines += [ "SK_VULKAN" ] |
| 387 | sources += skia_vk_sources |
egdaniel | e4a9bd7 | 2016-09-21 07:36:14 -0700 | [diff] [blame] | 388 | if (skia_enable_vulkan_debug_layers) { |
| 389 | public_defines += [ "SK_ENABLE_VK_LAYERS" ] |
| 390 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 391 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 392 | } |
| 393 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 394 | optional("jpeg") { |
| 395 | enabled = skia_use_libjpeg_turbo |
| 396 | public_defines = [ "SK_HAS_JPEG_LIBRARY" ] |
| 397 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 398 | deps = [ |
| 399 | "//third_party/libjpeg-turbo:libjpeg", |
| 400 | ] |
| 401 | sources = [ |
| 402 | "src/codec/SkJpegCodec.cpp", |
| 403 | "src/codec/SkJpegDecoderMgr.cpp", |
| 404 | "src/codec/SkJpegUtility.cpp", |
| 405 | "src/images/SkJPEGImageEncoder.cpp", |
| 406 | "src/images/SkJPEGWriteUtility.cpp", |
| 407 | ] |
| 408 | } |
| 409 | |
| 410 | optional("pdf") { |
| 411 | enabled = skia_use_zlib |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 412 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 413 | deps = [ |
| 414 | "//third_party/zlib", |
| 415 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 416 | sources = skia_pdf_sources |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 417 | sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 418 | |
| 419 | if (skia_use_sfntly) { |
| 420 | deps += [ "//third_party/sfntly" ] |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 421 | public_defines = [ "SK_PDF_USE_SFNTLY" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 422 | } |
| 423 | } |
| 424 | |
| 425 | optional("png") { |
| 426 | enabled = skia_use_libpng |
| 427 | public_defines = [ "SK_HAS_PNG_LIBRARY" ] |
| 428 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 429 | deps = [ |
| 430 | "//third_party/libpng", |
| 431 | ] |
| 432 | sources = [ |
| 433 | "src/codec/SkIcoCodec.cpp", |
| 434 | "src/codec/SkPngCodec.cpp", |
| 435 | "src/images/SkPNGImageEncoder.cpp", |
| 436 | ] |
| 437 | } |
| 438 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 439 | optional("typeface_freetype") { |
| 440 | enabled = skia_use_freetype |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 441 | |
| 442 | deps = [ |
| 443 | "//third_party/freetype2", |
| 444 | ] |
| 445 | sources = [ |
| 446 | "src/ports/SkFontHost_FreeType.cpp", |
| 447 | "src/ports/SkFontHost_FreeType_common.cpp", |
| 448 | ] |
| 449 | } |
| 450 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 451 | optional("webp") { |
| 452 | enabled = skia_use_libwebp |
| 453 | public_defines = [ "SK_HAS_WEBP_LIBRARY" ] |
| 454 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 455 | deps = [ |
| 456 | "//third_party/libwebp", |
| 457 | ] |
| 458 | sources = [ |
| 459 | "src/codec/SkWebpAdapterCodec.cpp", |
| 460 | "src/codec/SkWebpCodec.cpp", |
| 461 | "src/images/SkWEBPImageEncoder.cpp", |
| 462 | ] |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 463 | } |
| 464 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 465 | optional("xml") { |
| 466 | enabled = skia_use_expat |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 467 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 468 | deps = [ |
| 469 | "//third_party/expat", |
| 470 | ] |
| 471 | sources = [ |
| 472 | "src/xml/SkDOM.cpp", |
| 473 | "src/xml/SkXMLParser.cpp", |
| 474 | "src/xml/SkXMLWriter.cpp", |
| 475 | ] |
| 476 | } |
| 477 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 478 | component("skia") { |
| 479 | public_configs = [ ":skia_public" ] |
| 480 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 481 | |
| 482 | deps = [ |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 483 | ":arm64", |
| 484 | ":armv7", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 485 | ":avx", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 486 | ":crc32", |
mtklein | 349cece | 2016-08-26 08:13:04 -0700 | [diff] [blame] | 487 | ":dsp", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 488 | ":fontmgr_android", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 489 | ":fontmgr_custom", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 490 | ":fontmgr_fontconfig", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 491 | ":fontmgr_fuchsia", |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 492 | ":gpu", |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 493 | ":hsw", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 494 | ":jpeg", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 495 | ":none", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 496 | ":pdf", |
| 497 | ":png", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 498 | ":sse2", |
| 499 | ":sse41", |
| 500 | ":sse42", |
| 501 | ":ssse3", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 502 | ":typeface_freetype", |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 503 | ":webp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 504 | ":xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 505 | ] |
| 506 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 507 | sources = [] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 508 | sources += skia_core_sources |
| 509 | sources += skia_effects_sources |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 510 | sources += skia_sksl_sources |
| 511 | sources += skia_utils_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 512 | sources += [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 513 | "src/android/SkBitmapRegionCodec.cpp", |
| 514 | "src/android/SkBitmapRegionDecoder.cpp", |
| 515 | "src/codec/SkAndroidCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 516 | "src/codec/SkBmpCodec.cpp", |
| 517 | "src/codec/SkBmpMaskCodec.cpp", |
| 518 | "src/codec/SkBmpRLECodec.cpp", |
| 519 | "src/codec/SkBmpStandardCodec.cpp", |
| 520 | "src/codec/SkCodec.cpp", |
| 521 | "src/codec/SkCodecImageGenerator.cpp", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 522 | "src/codec/SkGifCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 523 | "src/codec/SkMaskSwizzler.cpp", |
| 524 | "src/codec/SkMasks.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 525 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 526 | "src/codec/SkSampler.cpp", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 527 | "src/codec/SkStreamBuffer.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 528 | "src/codec/SkSwizzler.cpp", |
| 529 | "src/codec/SkWbmpCodec.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 530 | "src/images/SkImageEncoder.cpp", |
| 531 | "src/images/SkImageEncoder_Factory.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 532 | "src/images/SkKTXImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 533 | "src/ports/SkDiscardableMemory_none.cpp", |
| 534 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 535 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 536 | "src/ports/SkMemory_malloc.cpp", |
| 537 | "src/ports/SkOSFile_stdio.cpp", |
| 538 | "src/sfnt/SkOTTable_name.cpp", |
| 539 | "src/sfnt/SkOTUtils.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 540 | "src/svg/SkSVGCanvas.cpp", |
| 541 | "src/svg/SkSVGDevice.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 542 | "src/utils/mac/SkStream_mac.cpp", |
| 543 | "third_party/etc1/etc1.cpp", |
scroggo | 3d3a65c | 2016-10-24 12:28:30 -0700 | [diff] [blame] | 544 | "third_party/gif/SkGifImageReader.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 545 | "third_party/ktx/ktx.cpp", |
| 546 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 547 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 548 | libs = [] |
| 549 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 550 | if (is_win) { |
| 551 | sources += [ |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 552 | "src/fonts/SkFontMgr_indirect.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 553 | "src/ports/SkDebug_win.cpp", |
| 554 | "src/ports/SkFontHost_win.cpp", |
| 555 | "src/ports/SkFontMgr_win_dw.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 556 | "src/ports/SkImageEncoder_WIC.cpp", |
| 557 | "src/ports/SkImageGeneratorWIC.cpp", |
| 558 | "src/ports/SkOSFile_win.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 559 | "src/ports/SkOSLibrary_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 560 | "src/ports/SkScalerContext_win_dw.cpp", |
| 561 | "src/ports/SkTLS_win.cpp", |
| 562 | "src/ports/SkTypeface_win_dw.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 563 | "src/xps/SkDocument_XPS.cpp", |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 564 | "src/xps/SkXPSDevice.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 565 | ] |
Mike Klein | 69f6ed4 | 2016-10-13 15:45:07 -0400 | [diff] [blame] | 566 | if (skia_use_gdi) { |
| 567 | sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ] |
| 568 | libs += [ |
| 569 | "Gdi32.lib", |
| 570 | "Usp10.lib", |
| 571 | ] |
| 572 | } else { |
| 573 | sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ] |
| 574 | } |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 575 | sources -= |
| 576 | [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ] |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 577 | libs += [ |
| 578 | "FontSub.lib", |
| 579 | "Ole32.lib", |
| 580 | "OleAut32.lib", |
| 581 | "User32.lib", |
| 582 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 583 | } else { |
| 584 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 585 | "src/ports/SkOSFile_posix.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 586 | "src/ports/SkOSLibrary_posix.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 587 | "src/ports/SkTLS_pthread.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 588 | "src/xps/SkDocument_XPS_None.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 589 | ] |
| 590 | } |
| 591 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 592 | if (is_android) { |
| 593 | deps += [ |
| 594 | "//third_party/cpu-features", |
| 595 | "//third_party/expat", |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 596 | ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 597 | sources += [ "src/ports/SkDebug_android.cpp" ] |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 598 | libs += [ |
| 599 | "EGL", |
| 600 | "GLESv2", |
| 601 | "log", |
| 602 | ] |
| 603 | } |
| 604 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 605 | if (is_linux) { |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 606 | libs += [ |
| 607 | "GL", |
| 608 | "GLU", |
| 609 | "X11", |
| 610 | ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 611 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 612 | } |
| 613 | |
| 614 | if (is_mac) { |
| 615 | sources += [ |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 616 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 617 | "src/ports/SkFontHost_mac.cpp", |
| 618 | "src/ports/SkImageEncoder_CG.cpp", |
| 619 | "src/ports/SkImageGeneratorCG.cpp", |
| 620 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 621 | libs += [ |
| 622 | "ApplicationServices.framework", |
| 623 | "OpenGL.framework", |
| 624 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 625 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 626 | |
| 627 | if (is_fuchsia) { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 628 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 629 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 630 | } |
| 631 | |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 632 | skia_h_headers = exec_script("gyp/find.py", |
| 633 | [ "*.h" ] + rebase_path(skia_public_includes), |
| 634 | "list lines", |
| 635 | []) - |
| 636 | [ |
| 637 | rebase_path("include/gpu/gl/GrGLConfig_chrome.h"), |
| 638 | rebase_path("include/gpu/vk/GrVkBackendContext.h"), |
| 639 | rebase_path("include/gpu/vk/GrVkDefines.h"), |
| 640 | rebase_path("include/gpu/vk/GrVkInterface.h"), |
| 641 | rebase_path("include/gpu/vk/GrVkTypes.h"), |
| 642 | rebase_path("include/ports/SkFontMgr_fontconfig.h"), |
| 643 | ] |
| 644 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 645 | action("skia.h") { |
| 646 | script = "gn/echo_headers.py" |
| 647 | args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 648 | rebase_path(skia_h_headers, target_gen_dir) |
Ben Wagner | bc34404 | 2016-09-29 15:41:53 -0400 | [diff] [blame] | 649 | inputs = skia_h_headers |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 650 | outputs = [ |
| 651 | "$target_gen_dir/skia.h", |
| 652 | ] |
| 653 | } |
| 654 | |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 655 | if (skia_enable_gpu && target_cpu == "x64") { |
mtklein | 1fbdf98 | 2016-09-15 12:07:48 -0700 | [diff] [blame] | 656 | # Our bots only have 64-bit libOSMesa installed. |
| 657 | # TODO: worth fixing? |
| 658 | executable("fiddle") { |
| 659 | include_dirs = [ "$target_gen_dir" ] |
| 660 | libs = [] |
| 661 | if (is_linux) { |
| 662 | libs += [ "OSMesa" ] |
| 663 | } |
mtklein | 56d5669 | 2016-09-15 11:18:55 -0700 | [diff] [blame] | 664 | |
mtklein | 1fbdf98 | 2016-09-15 12:07:48 -0700 | [diff] [blame] | 665 | sources = [ |
| 666 | "src/images/SkForceLinking.cpp", |
| 667 | "tools/fiddle/draw.cpp", |
| 668 | "tools/fiddle/fiddle_main.cpp", |
| 669 | ] |
| 670 | deps = [ |
| 671 | ":skia", |
| 672 | ":skia.h", |
| 673 | ] |
| 674 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 675 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 676 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 677 | # Targets guarded by skia_enable_tools may use //third_party freely. |
| 678 | if (skia_enable_tools) { |
| 679 | template("test_lib") { |
| 680 | config(target_name + "_config") { |
| 681 | include_dirs = invoker.public_include_dirs |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 682 | if (defined(invoker.public_defines)) { |
| 683 | defines = invoker.public_defines |
| 684 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 685 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 686 | source_set(target_name) { |
| 687 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 688 | public_configs = [ |
| 689 | ":" + target_name + "_config", |
| 690 | ":skia_private", |
| 691 | ] |
| 692 | |
| 693 | if (!defined(deps)) { |
| 694 | deps = [] |
| 695 | } |
| 696 | deps += [ ":skia" ] |
| 697 | testonly = true |
| 698 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 699 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 700 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 701 | test_lib("gpu_tool_utils") { |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 702 | public_include_dirs = [] |
| 703 | if (skia_enable_gpu) { |
| 704 | public_defines = [] |
| 705 | public_include_dirs += [ "tools/gpu" ] |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 706 | |
| 707 | deps = [] |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 708 | sources = [ |
| 709 | "tools/gpu/GrContextFactory.cpp", |
| 710 | "tools/gpu/GrTest.cpp", |
| 711 | "tools/gpu/TestContext.cpp", |
| 712 | "tools/gpu/gl/GLTestContext.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 713 | "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp", |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 714 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", |
| 715 | "tools/gpu/gl/debug/GrBufferObj.cpp", |
| 716 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", |
| 717 | "tools/gpu/gl/debug/GrProgramObj.cpp", |
| 718 | "tools/gpu/gl/debug/GrShaderObj.cpp", |
| 719 | "tools/gpu/gl/debug/GrTextureObj.cpp", |
| 720 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", |
| 721 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 722 | ] |
| 723 | libs = [] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 724 | |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 725 | if (is_android) { |
| 726 | sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] |
| 727 | } else if (is_linux) { |
| 728 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
| 729 | } else if (is_mac) { |
| 730 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 731 | } else if (is_win) { |
| 732 | sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ] |
| 733 | libs += [ |
| 734 | "Gdi32.lib", |
| 735 | "OpenGL32.lib", |
| 736 | ] |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 737 | } |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 738 | |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 739 | if (skia_use_angle) { |
| 740 | public_defines += [ "SK_ANGLE" ] |
| 741 | deps += [ "//third_party/angle2" ] |
| 742 | sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ] |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 743 | } |
| 744 | if (skia_use_mesa) { |
| 745 | public_defines += [ "SK_MESA" ] |
| 746 | sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ] |
| 747 | libs += [ "OSMesa" ] |
| 748 | } |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 749 | if (skia_use_vulkan) { |
| 750 | sources += [ "tools/gpu/vk/VkTestContext.cpp" ] |
| 751 | } |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 752 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 753 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 754 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 755 | test_lib("flags") { |
| 756 | public_include_dirs = [ "tools/flags" ] |
| 757 | sources = [ |
| 758 | "tools/flags/SkCommandLineFlags.cpp", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 759 | ] |
| 760 | } |
| 761 | test_lib("common_flags") { |
| 762 | public_include_dirs = [ "tools/flags" ] |
| 763 | sources = [ |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 764 | "tools/flags/SkCommonFlags.cpp", |
| 765 | "tools/flags/SkCommonFlagsConfig.cpp", |
| 766 | ] |
| 767 | deps = [ |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 768 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 769 | ":gpu_tool_utils", |
| 770 | ] |
| 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("tool_utils") { |
| 774 | public_include_dirs = [ |
| 775 | "tools", |
| 776 | "tools/debugger", |
| 777 | "tools/timer", |
| 778 | ] |
| 779 | sources = [ |
| 780 | "src/images/SkForceLinking.cpp", |
| 781 | "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools? |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 782 | "tools/AndroidSkDebugToStdOut.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 783 | "tools/CrashHandler.cpp", |
mtklein | 0590fa5 | 2016-09-01 07:06:54 -0700 | [diff] [blame] | 784 | "tools/LsanSuppressions.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 785 | "tools/ProcStats.cpp", |
| 786 | "tools/Resources.cpp", |
| 787 | "tools/ThermalManager.cpp", |
| 788 | "tools/UrlDataManager.cpp", |
| 789 | "tools/debugger/SkDebugCanvas.cpp", |
| 790 | "tools/debugger/SkDrawCommand.cpp", |
| 791 | "tools/debugger/SkJsonWriteBuffer.cpp", |
| 792 | "tools/debugger/SkObjectParser.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 793 | "tools/picture_utils.cpp", |
| 794 | "tools/random_parse_path.cpp", |
| 795 | "tools/sk_tool_utils.cpp", |
| 796 | "tools/sk_tool_utils_font.cpp", |
| 797 | "tools/timer/Timer.cpp", |
| 798 | ] |
| 799 | deps = [ |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 800 | ":common_flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 801 | ":flags", |
| 802 | "//third_party/libpng", |
| 803 | ] |
| 804 | public_deps = [ |
| 805 | "//third_party/jsoncpp", |
| 806 | ] |
| 807 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 808 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 809 | gm_sources = exec_script("gyp/find.py", |
| 810 | [ |
| 811 | "*.c*", |
| 812 | rebase_path("gm"), |
| 813 | ], |
| 814 | "list lines", |
| 815 | []) |
| 816 | test_lib("gm") { |
| 817 | public_include_dirs = [ "gm" ] |
| 818 | sources = gm_sources |
| 819 | deps = [ |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 820 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 821 | ":gpu_tool_utils", |
| 822 | ":skia", |
| 823 | ":tool_utils", |
| 824 | ] |
| 825 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 826 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 827 | tests_sources = exec_script("gyp/find.py", |
| 828 | [ |
| 829 | "*.c*", |
| 830 | rebase_path("tests"), |
| 831 | ], |
| 832 | "list lines", |
| 833 | []) |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 834 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 835 | test_lib("tests") { |
| 836 | public_include_dirs = [ "tests" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 837 | sources = tests_sources - [ |
| 838 | rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 839 | rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile |
| 840 | rebase_path("tests/skia_test.cpp"), # alternate main |
| 841 | ] |
| 842 | if (!fontmgr_android_enabled) { |
| 843 | sources -= [ rebase_path("tests/FontMgrAndroidParserTest.cpp") ] |
| 844 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 845 | deps = [ |
fmalita | 6cf896d | 2016-08-25 08:44:35 -0700 | [diff] [blame] | 846 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 847 | ":flags", |
| 848 | ":gpu_tool_utils", |
| 849 | ":skia", |
| 850 | ":tool_utils", |
| 851 | "//third_party/libpng", |
| 852 | "//third_party/zlib", |
| 853 | ] |
| 854 | } |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 855 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 856 | bench_sources = exec_script("gyp/find.py", |
| 857 | [ |
| 858 | "*.c*", |
| 859 | rebase_path("bench"), |
| 860 | ], |
| 861 | "list lines", |
| 862 | []) |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 863 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 864 | test_lib("bench") { |
| 865 | public_include_dirs = [ "bench" ] |
| 866 | sources = bench_sources |
| 867 | sources -= [ |
| 868 | rebase_path("bench/nanobench.cpp"), |
| 869 | rebase_path("bench/nanobenchAndroid.cpp"), |
| 870 | ] |
| 871 | deps = [ |
| 872 | ":flags", |
| 873 | ":gm", |
| 874 | ":gpu_tool_utils", |
| 875 | ":skia", |
| 876 | ":tool_utils", |
| 877 | ] |
| 878 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 879 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 880 | test_lib("experimental_svg_model") { |
| 881 | public_include_dirs = [ "experimental/svg/model" ] |
| 882 | sources = [ |
| 883 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 884 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
| 885 | "experimental/svg/model/SkSVGCircle.cpp", |
| 886 | "experimental/svg/model/SkSVGContainer.cpp", |
| 887 | "experimental/svg/model/SkSVGDOM.cpp", |
| 888 | "experimental/svg/model/SkSVGEllipse.cpp", |
| 889 | "experimental/svg/model/SkSVGLine.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 890 | "experimental/svg/model/SkSVGLinearGradient.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 891 | "experimental/svg/model/SkSVGNode.cpp", |
| 892 | "experimental/svg/model/SkSVGPath.cpp", |
| 893 | "experimental/svg/model/SkSVGPoly.cpp", |
| 894 | "experimental/svg/model/SkSVGRect.cpp", |
| 895 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 896 | "experimental/svg/model/SkSVGSVG.cpp", |
| 897 | "experimental/svg/model/SkSVGShape.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 898 | "experimental/svg/model/SkSVGStop.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 899 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 900 | "experimental/svg/model/SkSVGValue.cpp", |
| 901 | ] |
| 902 | deps = [ |
| 903 | ":skia", |
| 904 | ] |
| 905 | } |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 906 | |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 907 | test_lib("views") { |
| 908 | public_include_dirs = [ "include/views" ] |
| 909 | sources = [ |
| 910 | "src/views/SkEvent.cpp", |
| 911 | "src/views/SkEventSink.cpp", |
| 912 | "src/views/SkOSMenu.cpp", |
| 913 | "src/views/SkTagList.cpp", |
| 914 | "src/views/SkTouchGesture.cpp", |
| 915 | "src/views/SkView.cpp", |
| 916 | "src/views/SkViewPriv.cpp", |
| 917 | ] |
| 918 | libs = [] |
| 919 | if (!is_android) { |
| 920 | sources += [ "src/views/SkWindow.cpp" ] |
| 921 | } |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 922 | if (is_linux) { |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 923 | public_include_dirs += [ "src/views/unix" ] |
| 924 | sources += [ |
| 925 | "src/views/unix/SkOSWindow_Unix.cpp", |
| 926 | "src/views/unix/keysym2ucs.c", |
| 927 | ] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 928 | } else if (is_mac) { |
| 929 | sources += [ |
| 930 | "src/views/mac/SkEventNotifier.mm", |
| 931 | "src/views/mac/SkNSView.mm", |
| 932 | "src/views/mac/SkOSWindow_Mac.mm", |
| 933 | "src/views/mac/SkTextFieldCell.m", |
| 934 | ] |
| 935 | libs += [ |
| 936 | "QuartzCore.framework", |
| 937 | "Cocoa.framework", |
| 938 | "Foundation.framework", |
| 939 | ] |
| 940 | } else if (is_win) { |
| 941 | sources += [ "src/views/win/SkOSWindow_win.cpp" ] |
| 942 | } |
| 943 | } |
| 944 | |
| 945 | sample_sources = exec_script("gyp/find.py", |
| 946 | [ |
| 947 | "*.c*", |
| 948 | rebase_path("samplecode"), |
| 949 | ], |
| 950 | "list lines", |
| 951 | []) |
| 952 | |
| 953 | test_lib("samples") { |
| 954 | include_dirs = [ "experimental" ] |
| 955 | public_include_dirs = [ "samplecode" ] |
| 956 | sources = sample_sources |
| 957 | sources -= [ |
| 958 | rebase_path("samplecode/SampleAnimator.cpp"), # relies on animator |
| 959 | rebase_path("samplecode/SampleApp.cpp"), # part of SampleApp exe, not samples lib |
| 960 | rebase_path("samplecode/SampleClamp.cpp"), |
| 961 | rebase_path("samplecode/SampleDash.cpp"), |
| 962 | rebase_path("samplecode/SampleLua.cpp"), # no Lua yet in GN |
| 963 | rebase_path("samplecode/SamplePathFill.cpp"), |
| 964 | rebase_path("samplecode/SamplePictFile.cpp"), # relies on SK_SUPPORT_LEGACY_DRAWFILTER |
| 965 | rebase_path("samplecode/SampleSkLayer.cpp"), # relies on SkMatrix44 which doesn't compile? |
| 966 | rebase_path("samplecode/SampleFontCache.cpp"), # relies on pthread.h |
| 967 | ] |
| 968 | sources += [ |
| 969 | "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp", |
| 970 | "experimental/SkSetPoly3To3.cpp", |
| 971 | "experimental/SkSetPoly3To3_A.cpp", |
| 972 | "experimental/SkSetPoly3To3_D.cpp", |
| 973 | ] |
| 974 | deps = [ |
| 975 | ":experimental_svg_model", |
| 976 | ":gm", # Why does SampleFilterQuality.cpp include gm.h ??? |
| 977 | ":tool_utils", |
| 978 | ":views", |
| 979 | ":xml", |
| 980 | ] |
| 981 | } |
| 982 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 983 | executable("dm") { |
| 984 | sources = [ |
| 985 | "dm/DM.cpp", |
| 986 | "dm/DMJsonWriter.cpp", |
| 987 | "dm/DMSrcSink.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 988 | ] |
| 989 | include_dirs = [ "tests" ] |
| 990 | deps = [ |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 991 | ":common_flags", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 992 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 993 | ":flags", |
| 994 | ":gm", |
| 995 | ":gpu_tool_utils", |
| 996 | ":skia", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 997 | ":tests", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 998 | ":tool_utils", |
| 999 | "//third_party/jsoncpp", |
| 1000 | "//third_party/libpng", |
| 1001 | ] |
| 1002 | testonly = true |
| 1003 | } |
| 1004 | |
Mike Klein | a343017 | 2016-09-27 16:46:29 -0400 | [diff] [blame] | 1005 | if (!is_debug) { # I've benchmarked debug code once too many times... |
| 1006 | executable("monobench") { |
| 1007 | sources = [ |
| 1008 | "tools/monobench.cpp", |
| 1009 | ] |
| 1010 | deps = [ |
| 1011 | ":bench", |
| 1012 | ":skia", |
| 1013 | ] |
| 1014 | testonly = true |
| 1015 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1016 | } |
| 1017 | |
| 1018 | executable("nanobench") { |
| 1019 | sources = [ |
| 1020 | "bench/nanobench.cpp", |
| 1021 | ] |
| 1022 | deps = [ |
| 1023 | ":bench", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1024 | ":common_flags", |
fmalita | 6519c21 | 2016-09-14 08:05:17 -0700 | [diff] [blame] | 1025 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1026 | ":flags", |
| 1027 | ":gm", |
| 1028 | ":gpu_tool_utils", |
| 1029 | ":skia", |
| 1030 | ":tool_utils", |
| 1031 | "//third_party/jsoncpp", |
| 1032 | ] |
| 1033 | testonly = true |
| 1034 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 1035 | |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1036 | if (skia_enable_gpu) { |
| 1037 | executable("skpbench") { |
| 1038 | sources = [ |
| 1039 | "tools/skpbench/skpbench.cpp", |
| 1040 | ] |
| 1041 | deps = [ |
| 1042 | ":flags", |
| 1043 | ":gpu_tool_utils", |
| 1044 | ":skia", |
| 1045 | ":tool_utils", |
| 1046 | ] |
| 1047 | testonly = true |
| 1048 | } |
csmartdalton | 4b5179b | 2016-09-19 11:03:58 -0700 | [diff] [blame] | 1049 | } |
| 1050 | |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 1051 | # We can't yet build ICU on Windows. |
Mike Klein | 768bdfc | 2016-10-11 19:59:22 -0400 | [diff] [blame] | 1052 | if (!is_win) { |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1053 | executable("sktexttopdf-hb") { |
mtklein | 6f5df6a | 2016-08-29 16:01:10 -0700 | [diff] [blame] | 1054 | sources = [ |
| 1055 | "tools/SkShaper_harfbuzz.cpp", |
| 1056 | "tools/using_skia_and_harfbuzz.cpp", |
| 1057 | ] |
| 1058 | deps = [ |
| 1059 | ":skia", |
| 1060 | "//third_party/harfbuzz", |
| 1061 | ] |
| 1062 | testonly = true |
| 1063 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 1064 | } |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1065 | executable("sktexttopdf") { |
| 1066 | sources = [ |
| 1067 | "tools/SkShaper_primitive.cpp", |
| 1068 | "tools/using_skia_and_harfbuzz.cpp", |
| 1069 | ] |
| 1070 | deps = [ |
| 1071 | ":skia", |
| 1072 | ] |
| 1073 | testonly = true |
| 1074 | } |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1075 | |
| 1076 | executable("get_images_from_skps") { |
| 1077 | sources = [ |
| 1078 | "tools/get_images_from_skps.cpp", |
| 1079 | ] |
| 1080 | deps = [ |
| 1081 | ":flags", |
| 1082 | ":skia", |
| 1083 | "//third_party/jsoncpp", |
| 1084 | ] |
| 1085 | testonly = true |
| 1086 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1087 | |
| 1088 | executable("skiaserve") { |
| 1089 | sources = [ |
| 1090 | "tools/skiaserve/Request.cpp", |
| 1091 | "tools/skiaserve/Response.cpp", |
| 1092 | "tools/skiaserve/skiaserve.cpp", |
| 1093 | "tools/skiaserve/urlhandlers/BatchBoundsHandler.cpp", |
| 1094 | "tools/skiaserve/urlhandlers/BatchesHandler.cpp", |
| 1095 | "tools/skiaserve/urlhandlers/BreakHandler.cpp", |
| 1096 | "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp", |
| 1097 | "tools/skiaserve/urlhandlers/CmdHandler.cpp", |
| 1098 | "tools/skiaserve/urlhandlers/ColorModeHandler.cpp", |
| 1099 | "tools/skiaserve/urlhandlers/DataHandler.cpp", |
| 1100 | "tools/skiaserve/urlhandlers/DownloadHandler.cpp", |
| 1101 | "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp", |
| 1102 | "tools/skiaserve/urlhandlers/ImgHandler.cpp", |
| 1103 | "tools/skiaserve/urlhandlers/InfoHandler.cpp", |
Ben Wagner | c03e1c5 | 2016-10-17 15:20:02 -0400 | [diff] [blame] | 1104 | "tools/skiaserve/urlhandlers/OverdrawHandler.cpp", |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1105 | "tools/skiaserve/urlhandlers/PostHandler.cpp", |
| 1106 | "tools/skiaserve/urlhandlers/QuitHandler.cpp", |
| 1107 | "tools/skiaserve/urlhandlers/RootHandler.cpp", |
| 1108 | ] |
| 1109 | deps = [ |
| 1110 | ":flags", |
| 1111 | ":gpu_tool_utils", |
| 1112 | ":skia", |
| 1113 | ":tool_utils", |
| 1114 | "//third_party/jsoncpp", |
| 1115 | "//third_party/libmicrohttpd", |
| 1116 | "//third_party/libpng", |
| 1117 | ] |
| 1118 | testonly = true |
| 1119 | } |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1120 | |
| 1121 | executable("fuzz") { |
Mike Klein | 6e55fef | 2016-10-26 11:41:47 -0400 | [diff] [blame] | 1122 | if (is_skia_standalone) { |
| 1123 | configs -= [ "//gn:no_exceptions" ] |
| 1124 | } |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1125 | sources = [ |
| 1126 | "fuzz/FilterFuzz.cpp", |
| 1127 | "fuzz/FuzzGradients.cpp", |
| 1128 | "fuzz/FuzzParsePath.cpp", |
| 1129 | "fuzz/FuzzPathop.cpp", |
| 1130 | "fuzz/FuzzScaleToSides.cpp", |
| 1131 | "fuzz/fuzz.cpp", |
| 1132 | ] |
| 1133 | deps = [ |
| 1134 | ":flags", |
| 1135 | ":skia", |
| 1136 | ] |
| 1137 | testonly = true |
| 1138 | } |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 1139 | |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 1140 | pathops_tests_sources = exec_script("gyp/find.py", |
| 1141 | [ |
| 1142 | "PathOps*.cpp", |
| 1143 | rebase_path("tests"), |
| 1144 | ], |
| 1145 | "list lines", |
| 1146 | []) |
| 1147 | |
| 1148 | executable("pathops_unittest") { |
Mike Klein | 6e55fef | 2016-10-26 11:41:47 -0400 | [diff] [blame] | 1149 | sources = pathops_tests_sources - |
| 1150 | [ rebase_path("tests/PathOpsSkpClipTest.cpp") ] + |
| 1151 | [ |
| 1152 | rebase_path("tests/skia_test.cpp"), |
| 1153 | rebase_path("tests/Test.cpp"), |
| 1154 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 1155 | deps = [ |
| 1156 | ":flags", |
| 1157 | ":gpu_tool_utils", |
| 1158 | ":skia", |
| 1159 | ":tool_utils", |
| 1160 | ] |
| 1161 | testonly = true |
| 1162 | } |
| 1163 | |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 1164 | executable("dump_record") { |
| 1165 | sources = [ |
| 1166 | "tools/DumpRecord.cpp", |
| 1167 | "tools/dump_record.cpp", |
| 1168 | ] |
| 1169 | deps = [ |
| 1170 | ":flags", |
| 1171 | ":skia", |
| 1172 | ] |
| 1173 | testonly = true |
| 1174 | } |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 1175 | |
| 1176 | executable("skdiff") { |
| 1177 | sources = [ |
| 1178 | "tools/skdiff/skdiff.cpp", |
| 1179 | "tools/skdiff/skdiff_html.cpp", |
| 1180 | "tools/skdiff/skdiff_main.cpp", |
| 1181 | "tools/skdiff/skdiff_utils.cpp", |
| 1182 | ] |
| 1183 | deps = [ |
| 1184 | ":skia", |
| 1185 | ":tool_utils", |
| 1186 | ] |
| 1187 | testonly = true |
| 1188 | } |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 1189 | |
| 1190 | executable("skp_parser") { |
| 1191 | sources = [ |
| 1192 | "tools/skp_parser.cpp", |
| 1193 | ] |
| 1194 | deps = [ |
| 1195 | ":skia", |
| 1196 | ":tool_utils", |
| 1197 | "//third_party/jsoncpp", |
| 1198 | ] |
| 1199 | testonly = true |
| 1200 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1201 | |
Mike Klein | 43c2526 | 2016-10-20 10:17:47 -0400 | [diff] [blame] | 1202 | if (skia_enable_gpu && (is_linux || is_win || is_mac)) { |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1203 | executable("viewer") { |
| 1204 | sources = [ |
| 1205 | "tools/viewer/GMSlide.cpp", |
| 1206 | "tools/viewer/ImageSlide.cpp", |
| 1207 | "tools/viewer/SKPSlide.cpp", |
| 1208 | "tools/viewer/SampleSlide.cpp", |
| 1209 | "tools/viewer/Viewer.cpp", |
| 1210 | "tools/viewer/sk_app/CommandSet.cpp", |
| 1211 | "tools/viewer/sk_app/GLWindowContext.cpp", |
| 1212 | "tools/viewer/sk_app/Window.cpp", |
| 1213 | "tools/viewer/sk_app/WindowContext.cpp", |
| 1214 | ] |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 1215 | libs = [] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1216 | |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1217 | if (is_android) { |
| 1218 | sources += [ |
| 1219 | "tools/viewer/sk_app/android/GLWindowContext_android.cpp", |
| 1220 | "tools/viewer/sk_app/android/RasterWindowContext_android.cpp", |
| 1221 | "tools/viewer/sk_app/android/Window_android.cpp", |
| 1222 | "tools/viewer/sk_app/android/main_android.cpp", |
| 1223 | "tools/viewer/sk_app/android/surface_glue_android.cpp", |
| 1224 | ] |
| 1225 | } else if (is_linux) { |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 1226 | sources += [ |
| 1227 | "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp", |
| 1228 | "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp", |
| 1229 | "tools/viewer/sk_app/unix/Window_unix.cpp", |
| 1230 | "tools/viewer/sk_app/unix/main_unix.cpp", |
| 1231 | ] |
| 1232 | } else if (is_win) { |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1233 | sources += [ |
| 1234 | "tools/viewer/sk_app/win/GLWindowContext_win.cpp", |
| 1235 | "tools/viewer/sk_app/win/RasterWindowContext_win.cpp", |
| 1236 | "tools/viewer/sk_app/win/Window_win.cpp", |
| 1237 | "tools/viewer/sk_app/win/main_win.cpp", |
| 1238 | ] |
Mike Klein | 43c2526 | 2016-10-20 10:17:47 -0400 | [diff] [blame] | 1239 | } else if (is_mac) { |
| 1240 | sources += [ |
| 1241 | "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp", |
| 1242 | "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp", |
| 1243 | "tools/viewer/sk_app/mac/Window_mac.cpp", |
| 1244 | "tools/viewer/sk_app/mac/main_mac.cpp", |
| 1245 | ] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1246 | } |
| 1247 | |
| 1248 | if (skia_use_vulkan) { |
| 1249 | sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ] |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1250 | if (is_android) { |
| 1251 | sources += |
| 1252 | [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ] |
| 1253 | libs += [ "android" ] |
| 1254 | } else if (is_linux) { |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 1255 | sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ] |
| 1256 | libs += [ "X11-xcb" ] |
| 1257 | } else if (is_win) { |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1258 | sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ] |
| 1259 | } |
| 1260 | } |
| 1261 | |
| 1262 | include_dirs = [] |
| 1263 | deps = [ |
| 1264 | ":flags", |
| 1265 | ":gm", |
| 1266 | ":gpu_tool_utils", |
| 1267 | ":samples", |
| 1268 | ":skia", |
| 1269 | ":tool_utils", |
| 1270 | ":views", |
| 1271 | "//third_party/jsoncpp", |
| 1272 | ] |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1273 | if (is_android) { |
| 1274 | deps += [ "//third_party/native_app_glue" ] |
| 1275 | } else if (is_mac) { |
Mike Klein | 43c2526 | 2016-10-20 10:17:47 -0400 | [diff] [blame] | 1276 | deps += [ "//third_party/libsdl" ] |
| 1277 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1278 | testonly = true |
| 1279 | } |
| 1280 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1281 | } |