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