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