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