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