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