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