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