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