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