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 | |
Brian Osman | f2c9014 | 2017-07-13 15:50:03 -0400 | [diff] [blame] | 6 | import("gn/flutter_defines.gni") |
Mike Reed | 025f783 | 2018-11-12 09:27:05 -0500 | [diff] [blame] | 7 | import("gn/fuchsia_defines.gni") |
mikejurka | 8c24f4f | 2016-09-12 16:51:58 -0700 | [diff] [blame] | 8 | import("gn/shared_sources.gni") |
Hal Canary | 32498f0 | 2019-02-04 15:36:31 -0500 | [diff] [blame] | 9 | import("gn/skia.gni") |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 10 | |
Forrest Reiling | 30229ac | 2017-04-17 13:36:39 -0700 | [diff] [blame] | 11 | if (is_fuchsia) { |
| 12 | import("//build/vulkan/config.gni") |
| 13 | } |
| 14 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 15 | declare_args() { |
Mike Klein | 26a6049 | 2018-10-15 10:38:25 -0400 | [diff] [blame] | 16 | skia_enable_flutter_defines = false |
| 17 | } |
| 18 | |
| 19 | declare_args() { |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 20 | skia_use_angle = false |
Kevin Lubick | 4a24e10 | 2017-03-29 11:19:01 -0400 | [diff] [blame] | 21 | skia_use_egl = false |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 22 | skia_use_expat = true |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 23 | skia_use_fontconfig = is_linux |
Leon Scroggins III | 85e22fc | 2018-11-28 08:58:47 -0500 | [diff] [blame] | 24 | skia_use_fonthost_mac = is_mac |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 25 | skia_use_freetype = is_android || is_fuchsia || is_linux |
Leon Scroggins III | c41a5f5 | 2018-11-15 15:54:59 -0500 | [diff] [blame] | 26 | skia_use_fixed_gamma_text = is_android |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 27 | skia_use_libjpeg_turbo = true |
| 28 | skia_use_libpng = true |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 29 | skia_use_libwebp = !is_fuchsia |
Mike Klein | fae86b7 | 2018-01-08 15:49:09 -0500 | [diff] [blame] | 30 | skia_use_lua = is_skia_dev_build && !is_ios |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 31 | skia_use_opencl = false |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 32 | skia_use_piex = !is_win |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 33 | skia_use_wuffs = false |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 34 | skia_use_zlib = true |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 35 | skia_use_metal = false |
Mike Klein | 36f182f | 2017-10-20 12:33:53 -0400 | [diff] [blame] | 36 | skia_use_libheif = is_skia_dev_build |
Chinmay Garde | d92d035 | 2018-09-17 10:23:28 -0700 | [diff] [blame] | 37 | skia_use_x11 = is_linux |
Leon Scroggins III | ee0e5d0 | 2019-02-27 10:59:11 -0500 | [diff] [blame] | 38 | skia_use_xps = true |
mtklein | 1bd72ba | 2016-09-16 07:45:52 -0700 | [diff] [blame] | 39 | |
Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame] | 40 | skia_android_serial = "" |
Kevin Lubick | 93faa67 | 2018-10-10 15:54:53 -0400 | [diff] [blame] | 41 | skia_enable_ccpr = true |
Kevin Lubick | ca7c297 | 2018-10-17 13:52:24 +0000 | [diff] [blame] | 42 | skia_enable_nvpr = !skia_enable_flutter_defines |
Brian Osman | 3f375d0 | 2016-12-28 11:19:22 -0500 | [diff] [blame] | 43 | skia_enable_discrete_gpu = true |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 44 | skia_enable_nima = false |
Hal Canary | 43fb7a0 | 2016-12-30 13:09:03 -0500 | [diff] [blame] | 45 | skia_enable_pdf = true |
Ethan Nicholas | a6ae1f7 | 2017-03-16 09:56:54 -0400 | [diff] [blame] | 46 | skia_enable_spirv_validation = is_skia_dev_build && is_debug |
Kevin Lubick | 32dfdbe | 2018-10-18 09:47:01 -0400 | [diff] [blame] | 47 | skia_enable_skpicture = true |
Mike Klein | 3669a82 | 2017-03-03 10:55:02 -0500 | [diff] [blame] | 48 | skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 49 | skia_qt_path = getenv("QT_PATH") |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 50 | skia_compile_processors = false |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 51 | skia_generate_workarounds = false |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 52 | skia_lex = false |
Mike Klein | c55a6cb | 2017-06-28 13:21:47 -0400 | [diff] [blame] | 53 | |
Hal Canary | 2331c82 | 2018-02-01 14:06:13 -0500 | [diff] [blame] | 54 | skia_skqp_global_error_tolerance = 0 |
Ethan Nicholas | 26a9aad | 2018-03-27 14:10:52 -0400 | [diff] [blame] | 55 | |
| 56 | skia_llvm_path = "" |
| 57 | skia_llvm_lib = "LLVM" |
Hal Canary | fd9bcab | 2018-04-24 11:47:23 -0400 | [diff] [blame] | 58 | |
| 59 | skia_tools_require_resources = false |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 60 | } |
Brian Salomon | 23d73ea | 2016-10-27 13:31:37 -0400 | [diff] [blame] | 61 | declare_args() { |
Matt Sarett | 189491c | 2017-03-20 18:09:30 -0400 | [diff] [blame] | 62 | skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 63 | skia_use_sfntly = skia_use_icu |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 64 | skia_enable_atlas_text = is_skia_dev_build && skia_enable_gpu |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 65 | skia_enable_fontmgr_empty = false |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 66 | skia_enable_fontmgr_custom = |
| 67 | is_linux && skia_use_freetype && !skia_use_fontconfig |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 68 | skia_enable_fontmgr_custom_empty = is_fuchsia && skia_use_freetype |
| 69 | skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 70 | skia_enable_fontmgr_fuchsia = is_fuchsia |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 71 | skia_enable_fontmgr_win = is_win |
| 72 | skia_enable_fontmgr_win_gdi = is_win |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 73 | |
Mike Klein | 4d598a3 | 2016-10-31 13:44:49 -0400 | [diff] [blame] | 74 | if (is_android) { |
| 75 | skia_use_vulkan = defined(ndk_api) && ndk_api >= 24 |
Forrest Reiling | 30229ac | 2017-04-17 13:36:39 -0700 | [diff] [blame] | 76 | } else if (is_fuchsia) { |
| 77 | skia_use_vulkan = fuchsia_use_vulkan |
Mike Klein | 4d598a3 | 2016-10-31 13:44:49 -0400 | [diff] [blame] | 78 | } else { |
Mike Klein | 98dea7b | 2019-01-15 11:26:43 -0500 | [diff] [blame] | 79 | skia_use_vulkan = defined(skia_moltenvk_path) && skia_moltenvk_path != "" |
Mike Klein | 4d598a3 | 2016-10-31 13:44:49 -0400 | [diff] [blame] | 80 | } |
Jim Van Verth | 4e50297 | 2017-12-07 15:16:10 -0500 | [diff] [blame] | 81 | |
| 82 | if (is_ios) { |
| 83 | skia_ios_identity = ".*Google.*" |
| 84 | skia_ios_profile = "Google Development" |
| 85 | } |
Brian Salomon | 23d73ea | 2016-10-27 13:31:37 -0400 | [diff] [blame] | 86 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 87 | |
Adam Barth | 54ef74a | 2017-10-13 10:59:38 -0700 | [diff] [blame] | 88 | if (defined(skia_settings)) { |
| 89 | import(skia_settings) |
| 90 | } |
| 91 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 92 | skia_public_includes = [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 93 | "include/android", |
mtklein | fa84d94 | 2016-07-28 09:45:14 -0700 | [diff] [blame] | 94 | "include/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 95 | "include/codec", |
| 96 | "include/config", |
| 97 | "include/core", |
Hal Canary | 23564b9 | 2018-09-07 14:33:14 -0400 | [diff] [blame] | 98 | "include/docs", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 99 | "include/effects", |
Matt Sarett | 94fd06f | 2017-05-08 17:31:00 -0400 | [diff] [blame] | 100 | "include/encode", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 101 | "include/gpu", |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 102 | "include/atlastext", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 103 | "include/pathops", |
| 104 | "include/ports", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 105 | "include/svg", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 106 | "include/utils", |
| 107 | "include/utils/mac", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 108 | ] |
| 109 | |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 110 | if (skia_enable_atlas_text) { |
| 111 | skia_public_includes += [ "include/atlastext" ] |
| 112 | } |
Robert Phillips | fcd5fdd | 2017-06-14 01:43:29 +0000 | [diff] [blame] | 113 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 114 | # Skia public API, generally provided by :skia. |
| 115 | config("skia_public") { |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 116 | include_dirs = skia_public_includes |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 117 | defines = [] |
| 118 | if (is_component_build) { |
| 119 | defines += [ "SKIA_DLL" ] |
| 120 | } |
Mike Klein | c4cbd74 | 2016-09-26 21:37:09 -0400 | [diff] [blame] | 121 | if (is_fuchsia || is_linux) { |
jcgregorio | 5561e3d | 2016-08-25 09:25:11 -0700 | [diff] [blame] | 122 | defines += [ "SK_SAMPLES_FOR_X" ] |
| 123 | } |
Brian Osman | f2c9014 | 2017-07-13 15:50:03 -0400 | [diff] [blame] | 124 | if (skia_enable_flutter_defines) { |
| 125 | defines += flutter_defines |
| 126 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 127 | if (!skia_enable_gpu) { |
| 128 | defines += [ "SK_SUPPORT_GPU=0" ] |
| 129 | } |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 130 | if (skia_enable_atlas_text) { |
| 131 | defines += [ "SK_SUPPORT_ATLAS_TEXT=1" ] |
| 132 | } |
Mike Reed | 025f783 | 2018-11-12 09:27:05 -0500 | [diff] [blame] | 133 | if (is_fuchsia) { |
| 134 | defines += fuchsia_defines |
| 135 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | # Skia internal APIs, used by Skia itself and a few test tools. |
| 139 | config("skia_private") { |
| 140 | visibility = [ ":*" ] |
| 141 | |
| 142 | include_dirs = [ |
| 143 | "include/private", |
| 144 | "src/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 145 | "src/codec", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 146 | "src/core", |
| 147 | "src/effects", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 148 | "src/fonts", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 149 | "src/image", |
| 150 | "src/images", |
| 151 | "src/lazy", |
| 152 | "src/opts", |
| 153 | "src/pathops", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 154 | "src/pdf", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 155 | "src/ports", |
| 156 | "src/sfnt", |
Florin Malita | 5edba45 | 2017-05-30 16:39:47 -0400 | [diff] [blame] | 157 | "src/shaders", |
| 158 | "src/shaders/gradients", |
mtklein | 9e0d9dd | 2016-08-30 10:37:19 -0700 | [diff] [blame] | 159 | "src/sksl", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 160 | "src/utils", |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 161 | "src/utils/win", |
Herb Derby | 5a8fe97 | 2017-02-14 14:42:30 -0500 | [diff] [blame] | 162 | "src/xml", |
Jim Van Verth | 1676cb9 | 2019-01-15 13:24:45 -0500 | [diff] [blame] | 163 | "third_party/etc1", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 164 | "third_party/gif", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 165 | ] |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 166 | |
Mike Reed | a9e241d | 2017-05-03 10:52:00 -0400 | [diff] [blame] | 167 | defines = [ "SK_GAMMA_APPLY_TO_A8" ] |
Leon Scroggins III | c41a5f5 | 2018-11-15 15:54:59 -0500 | [diff] [blame] | 168 | if (skia_use_fixed_gamma_text) { |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 169 | defines += [ |
| 170 | "SK_GAMMA_EXPONENT=1.4", |
| 171 | "SK_GAMMA_CONTRAST=0.0", |
| 172 | ] |
| 173 | } |
mtklein | 88a7ac0 | 2016-09-14 11:16:49 -0700 | [diff] [blame] | 174 | if (is_official_build || is_android) { |
| 175 | # TODO(bsalomon): it'd be nice to make Android normal. |
| 176 | defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ] |
| 177 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 178 | libs = [] |
| 179 | lib_dirs = [] |
Brian Salomon | 03e0584 | 2017-02-23 12:23:47 -0500 | [diff] [blame] | 180 | if (skia_enable_gpu) { |
| 181 | include_dirs += [ "src/gpu" ] |
Greg Daniel | afb7ec7 | 2017-12-07 12:48:30 -0500 | [diff] [blame] | 182 | if (is_skia_dev_build && skia_use_vulkan) { |
| 183 | include_dirs += [ "tools/gpu/vk" ] |
| 184 | } |
Brian Salomon | 03e0584 | 2017-02-23 12:23:47 -0500 | [diff] [blame] | 185 | } |
Brian Osman | 34755e2 | 2016-12-05 09:46:02 -0500 | [diff] [blame] | 186 | if (skia_use_angle) { |
| 187 | defines += [ "SK_ANGLE" ] |
| 188 | } |
Brian Osman | 3f375d0 | 2016-12-28 11:19:22 -0500 | [diff] [blame] | 189 | if (skia_enable_discrete_gpu) { |
| 190 | defines += [ "SK_ENABLE_DISCRETE_GPU" ] |
| 191 | } |
Brian Salomon | 0c26a9d | 2017-07-06 10:09:38 -0400 | [diff] [blame] | 192 | if (!is_official_build) { |
| 193 | defines += [ "GR_TEST_UTILS=1" ] |
| 194 | } |
Ethan Nicholas | 26a9aad | 2018-03-27 14:10:52 -0400 | [diff] [blame] | 195 | if (skia_llvm_path != "") { |
| 196 | defines += [ "SK_LLVM_AVAILABLE" ] |
| 197 | include_dirs += [ "$skia_llvm_path/include" ] |
| 198 | libs += [ skia_llvm_lib ] |
| 199 | lib_dirs += [ "$skia_llvm_path/lib/" ] |
| 200 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 204 | config("skia_library") { |
| 205 | visibility = [ ":*" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 206 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
| 207 | } |
| 208 | |
| 209 | skia_library_configs = [ |
| 210 | ":skia_public", |
| 211 | ":skia_private", |
| 212 | ":skia_library", |
| 213 | ] |
| 214 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 215 | # Use for CPU-specific Skia code that needs particular compiler flags. |
| 216 | template("opts") { |
Mike Klein | 6d1df6d | 2018-11-07 15:03:58 -0500 | [diff] [blame] | 217 | visibility = [ ":*" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 218 | if (invoker.enabled) { |
| 219 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 220 | check_includes = false |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 221 | forward_variables_from(invoker, "*") |
| 222 | configs += skia_library_configs |
| 223 | } |
| 224 | } else { |
| 225 | # If not enabled, a phony empty target that swallows all otherwise unused variables. |
| 226 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 227 | check_includes = false |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 228 | forward_variables_from(invoker, |
| 229 | "*", |
| 230 | [ |
| 231 | "sources", |
| 232 | "cflags", |
| 233 | ]) |
| 234 | } |
| 235 | } |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 236 | } |
| 237 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 238 | is_x86 = current_cpu == "x64" || current_cpu == "x86" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 239 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 240 | opts("none") { |
| 241 | enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 242 | sources = skia_opts.none_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 243 | cflags = [] |
| 244 | } |
| 245 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 246 | opts("armv7") { |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 247 | enabled = current_cpu == "arm" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 248 | sources = skia_opts.armv7_sources + skia_opts.neon_sources |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 249 | cflags = [] |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 250 | } |
| 251 | |
| 252 | opts("arm64") { |
| 253 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 254 | sources = skia_opts.arm64_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 255 | cflags = [] |
| 256 | } |
| 257 | |
| 258 | opts("crc32") { |
| 259 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 260 | sources = skia_opts.crc32_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 261 | cflags = [ "-march=armv8-a+crc" ] |
| 262 | } |
| 263 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 264 | opts("sse2") { |
| 265 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 266 | sources = skia_opts.sse2_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 267 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 268 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ] |
| 269 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 270 | cflags = [ "-msse2" ] |
| 271 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 272 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 273 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 274 | opts("ssse3") { |
| 275 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 276 | sources = skia_opts.ssse3_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 277 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 278 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ] |
| 279 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 280 | cflags = [ "-mssse3" ] |
| 281 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 282 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 283 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 284 | opts("sse41") { |
| 285 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 286 | sources = skia_opts.sse41_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 287 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 288 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ] |
| 289 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 290 | cflags = [ "-msse4.1" ] |
| 291 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 292 | } |
mtklein | 4e97607 | 2016-08-08 09:06:27 -0700 | [diff] [blame] | 293 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 294 | opts("sse42") { |
| 295 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 296 | sources = skia_opts.sse42_sources |
Mike Klein | c722f79 | 2017-07-31 11:57:21 -0400 | [diff] [blame] | 297 | if (!is_clang && is_win) { |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 298 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ] |
| 299 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 300 | cflags = [ "-msse4.2" ] |
| 301 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 302 | } |
| 303 | |
| 304 | opts("avx") { |
| 305 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 306 | sources = skia_opts.avx_sources |
Mike Klein | 4d4b3aa | 2018-03-21 13:07:35 -0400 | [diff] [blame] | 307 | if (is_win) { |
Mike Klein | 17b6e48 | 2016-11-18 22:11:41 +0000 | [diff] [blame] | 308 | cflags = [ "/arch:AVX" ] |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 309 | } else { |
| 310 | cflags = [ "-mavx" ] |
| 311 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 312 | } |
| 313 | |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 314 | opts("hsw") { |
| 315 | enabled = is_x86 |
| 316 | sources = skia_opts.hsw_sources |
Mike Klein | 4d4b3aa | 2018-03-21 13:07:35 -0400 | [diff] [blame] | 317 | if (is_win) { |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 318 | cflags = [ "/arch:AVX2" ] |
| 319 | } else { |
Mike Klein | e87c486 | 2018-03-23 00:13:58 +0000 | [diff] [blame] | 320 | cflags = [ "-march=haswell" ] |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | # Oddly, clang-cl doesn't recognize this as a valid flag. |
| 324 | # If it ever does, it'd nice to move this up with -mavx2 and co. |
| 325 | if (is_clang && !is_win) { |
| 326 | # This flag lets Clang generate FMAs when it sees a mul-then-add. It's optional, |
| 327 | # but nice to have, generating slightly better code for paths without explicit FMAs. |
| 328 | cflags += [ "-ffp-contract=fast" ] |
| 329 | } |
| 330 | } |
| 331 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 332 | # 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] | 333 | template("optional") { |
Mike Klein | 6d1df6d | 2018-11-07 15:03:58 -0500 | [diff] [blame] | 334 | visibility = [ ":*" ] |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 335 | if (invoker.enabled) { |
| 336 | config(target_name + "_public") { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 337 | if (defined(invoker.public_defines)) { |
| 338 | defines = invoker.public_defines |
| 339 | } |
Chris Dalton | 3a67b8e | 2018-05-03 09:30:29 -0600 | [diff] [blame] | 340 | if (defined(invoker.public_configs)) { |
| 341 | configs = invoker.public_configs |
| 342 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 343 | } |
| 344 | source_set(target_name) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 345 | check_includes = false |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 346 | forward_variables_from(invoker, |
| 347 | "*", |
| 348 | [ |
| 349 | "public_defines", |
| 350 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 351 | "configs_to_remove", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 352 | ]) |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 353 | all_dependent_configs = [ ":" + target_name + "_public" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 354 | configs += skia_library_configs |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 355 | if (defined(invoker.configs_to_remove)) { |
| 356 | configs -= invoker.configs_to_remove |
| 357 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 358 | } |
| 359 | } else { |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 360 | source_set(target_name) { |
| 361 | forward_variables_from(invoker, |
| 362 | "*", |
| 363 | [ |
| 364 | "public_defines", |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 365 | "public_deps", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 366 | "deps", |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 367 | "libs", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 368 | "sources", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 369 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 370 | "configs_to_remove", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 371 | ]) |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 372 | if (defined(invoker.sources_when_disabled)) { |
| 373 | sources = invoker.sources_when_disabled |
| 374 | } |
| 375 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 376 | } |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 377 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 378 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 379 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 380 | optional("fontmgr_android") { |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 381 | enabled = skia_enable_fontmgr_android |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 382 | |
| 383 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 384 | ":typeface_freetype", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 385 | "//third_party/expat", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 386 | ] |
| 387 | sources = [ |
| 388 | "src/ports/SkFontMgr_android.cpp", |
| 389 | "src/ports/SkFontMgr_android_factory.cpp", |
| 390 | "src/ports/SkFontMgr_android_parser.cpp", |
| 391 | ] |
| 392 | } |
| 393 | |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 394 | optional("fontmgr_custom") { |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 395 | enabled = skia_enable_fontmgr_custom |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 396 | |
| 397 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 398 | ":typeface_freetype", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 399 | ] |
| 400 | sources = [ |
| 401 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 402 | "src/ports/SkFontMgr_custom.h", |
| 403 | "src/ports/SkFontMgr_custom_directory.cpp", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 404 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 405 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 406 | "src/ports/SkFontMgr_custom_empty.cpp", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 407 | ] |
| 408 | } |
| 409 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 410 | optional("fontmgr_custom_empty") { |
| 411 | enabled = skia_enable_fontmgr_custom_empty |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 412 | |
| 413 | deps = [ |
| 414 | ":typeface_freetype", |
| 415 | ] |
| 416 | sources = [ |
| 417 | "src/ports/SkFontMgr_custom.cpp", |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 418 | "src/ports/SkFontMgr_custom_empty.cpp", |
| 419 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 420 | ] |
| 421 | } |
| 422 | |
Hal Canary | ff2742e | 2018-01-30 11:35:47 -0500 | [diff] [blame] | 423 | optional("fontmgr_empty") { |
| 424 | enabled = skia_enable_fontmgr_empty |
| 425 | sources = [ |
| 426 | "src/ports/SkFontMgr_empty_factory.cpp", |
| 427 | ] |
| 428 | } |
| 429 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 430 | optional("fontmgr_fontconfig") { |
| 431 | enabled = skia_use_freetype && skia_use_fontconfig |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 432 | |
| 433 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 434 | ":typeface_freetype", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 435 | "//third_party:fontconfig", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 436 | ] |
| 437 | sources = [ |
bungeman | 1ae0e01 | 2016-09-19 12:13:16 -0700 | [diff] [blame] | 438 | "src/ports/SkFontConfigInterface.cpp", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 439 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 440 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 441 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
| 442 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 443 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
| 444 | ] |
| 445 | } |
| 446 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 447 | optional("fontmgr_fuchsia") { |
| 448 | enabled = skia_enable_fontmgr_fuchsia |
| 449 | |
| 450 | deps = [ |
| 451 | "//sdk/fidl/fuchsia.fonts", |
| 452 | ] |
| 453 | sources = [ |
| 454 | "src/ports/SkFontMgr_fuchsia.cpp", |
| 455 | "src/ports/SkFontMgr_fuchsia.h", |
| 456 | ] |
| 457 | } |
| 458 | |
| 459 | optional("fontmgr_wasm") { |
| 460 | enabled = target_cpu == "wasm" |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 461 | |
| 462 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 463 | ":typeface_freetype", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 464 | ] |
| 465 | sources = [ |
| 466 | "src/ports/SkFontMgr_custom.cpp", |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 467 | "src/ports/SkFontMgr_custom.h", |
| 468 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 469 | "src/ports/SkFontMgr_custom_embedded_factory.cpp", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 470 | ] |
| 471 | } |
| 472 | |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 473 | optional("fontmgr_win") { |
| 474 | enabled = skia_enable_fontmgr_win |
| 475 | |
| 476 | sources = [ |
| 477 | "src/fonts/SkFontMgr_indirect.cpp", |
| 478 | "src/ports/SkFontMgr_win_dw.cpp", |
| 479 | "src/ports/SkFontMgr_win_dw_factory.cpp", |
| 480 | "src/ports/SkScalerContext_win_dw.cpp", |
| 481 | "src/ports/SkTypeface_win_dw.cpp", |
| 482 | ] |
| 483 | } |
| 484 | |
| 485 | optional("fontmgr_win_gdi") { |
| 486 | enabled = skia_enable_fontmgr_win_gdi |
| 487 | |
| 488 | sources = [ |
| 489 | "src/ports/SkFontHost_win.cpp", |
| 490 | ] |
| 491 | libs = [ "Gdi32.lib" ] |
| 492 | } |
| 493 | |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 494 | if (skia_lex) { |
Ethan Nicholas | ca82a92 | 2017-09-07 09:39:50 -0400 | [diff] [blame] | 495 | executable("sksllex") { |
| 496 | sources = [ |
| 497 | "src/sksl/lex/Main.cpp", |
| 498 | "src/sksl/lex/NFA.cpp", |
| 499 | "src/sksl/lex/RegexNode.cpp", |
| 500 | "src/sksl/lex/RegexParser.cpp", |
| 501 | ] |
| 502 | include_dirs = [ "src/sksl/lex" ] |
| 503 | } |
| 504 | |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 505 | action("run_sksllex") { |
| 506 | script = "gn/run_sksllex.py" |
Ethan Nicholas | e148bf7 | 2017-10-06 14:22:22 -0400 | [diff] [blame] | 507 | deps = [ |
| 508 | ":sksllex(//gn/toolchain:$host_toolchain)", |
| 509 | ] |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 510 | sources = [ |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 511 | "src/sksl/lex/sksl.lex", |
| 512 | ] |
| 513 | |
| 514 | # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a |
| 515 | # path that starts with target_out_dir and then uses ".." to back up into the src dir. |
| 516 | outputs = [ |
| 517 | "$target_out_dir/" + |
| 518 | rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir), |
| 519 | # the script also modifies the corresponding .cpp file, but if we tell GN that it gets |
| 520 | # confused due to the same file being named by two different paths |
| 521 | ] |
| 522 | sksllex_path = "$root_out_dir/" |
| 523 | sksllex_path += "sksllex" |
| 524 | if (host_os == "win") { |
| 525 | sksllex_path += ".exe" |
| 526 | } |
| 527 | args = [ |
| 528 | rebase_path(sksllex_path), |
| 529 | rebase_path("bin/clang-format"), |
| 530 | rebase_path("src"), |
| 531 | ] |
| 532 | } |
| 533 | } else { |
| 534 | group("run_sksllex") { |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | if (skia_compile_processors) { |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 539 | executable("skslc") { |
| 540 | defines = [ "SKSL_STANDALONE" ] |
| 541 | sources = [ |
| 542 | "src/sksl/SkSLMain.cpp", |
| 543 | ] |
| 544 | sources += skia_sksl_sources |
| 545 | include_dirs = [ |
| 546 | "src/gpu", |
| 547 | "src/sksl", |
| 548 | ] |
| 549 | deps = [ |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 550 | ":run_sksllex", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 551 | "//third_party/spirv-tools", |
| 552 | ] |
| 553 | } |
| 554 | |
| 555 | skia_gpu_processor_outputs = [] |
| 556 | foreach(src, skia_gpu_processor_sources) { |
| 557 | dir = get_path_info(src, "dir") |
| 558 | name = get_path_info(src, "name") |
| 559 | |
| 560 | # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a |
| 561 | # path that starts with target_out_dir and then uses ".." to back up into the src dir. |
| 562 | skia_gpu_processor_outputs += [ |
| 563 | "$target_out_dir/" + rebase_path("$dir/$name.h", target_out_dir), |
| 564 | # the script also modifies the corresponding .cpp file, but if we tell GN that it gets |
| 565 | # confused due to the same file being named by two different paths |
| 566 | ] |
| 567 | } |
| 568 | |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 569 | action("create_sksl_enums") { |
| 570 | script = "gn/create_sksl_enums.py" |
| 571 | sources = [ |
| 572 | "include/private/GrSharedEnums.h", |
| 573 | ] |
| 574 | outputs = [ |
| 575 | "$target_out_dir/" + |
Ben Wagner | a56c4d2 | 2018-01-24 17:32:17 -0500 | [diff] [blame] | 576 | rebase_path("src/sksl/sksl_enums.inc", target_out_dir), |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 577 | ] |
| 578 | args = [ |
| 579 | rebase_path(sources[0]), |
| 580 | rebase_path(outputs[0]), |
| 581 | ] |
| 582 | } |
| 583 | |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 584 | action("compile_processors") { |
| 585 | script = "gn/compile_processors.py" |
| 586 | deps = [ |
Ethan Nicholas | aae47c8 | 2017-11-10 15:34:03 -0500 | [diff] [blame] | 587 | ":create_sksl_enums", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 588 | ":skslc(//gn/toolchain:$host_toolchain)", |
| 589 | ] |
| 590 | sources = skia_gpu_processor_sources |
| 591 | outputs = skia_gpu_processor_outputs |
| 592 | skslc_path = "$root_out_dir/" |
| 593 | if (host_toolchain != default_toolchain_name) { |
| 594 | skslc_path += "$host_toolchain/" |
| 595 | } |
| 596 | skslc_path += "skslc" |
| 597 | if (host_os == "win") { |
| 598 | skslc_path += ".exe" |
| 599 | } |
Ethan Nicholas | b9f6afb | 2017-07-27 16:02:37 -0400 | [diff] [blame] | 600 | args = [ |
| 601 | rebase_path(skslc_path), |
Eric Boren | b121be7 | 2017-07-28 10:00:51 -0400 | [diff] [blame] | 602 | rebase_path("bin/clang-format"), |
Ethan Nicholas | b9f6afb | 2017-07-27 16:02:37 -0400 | [diff] [blame] | 603 | ] |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 604 | args += rebase_path(skia_gpu_processor_sources) |
| 605 | } |
| 606 | } else { |
| 607 | skia_gpu_processor_outputs = [] |
| 608 | group("compile_processors") { |
| 609 | } |
| 610 | } |
| 611 | |
Ben Wagner | e27ee6c | 2019-02-15 14:59:30 -0500 | [diff] [blame] | 612 | optional("gpu") { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 613 | enabled = skia_enable_gpu |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 614 | deps = [ |
| 615 | ":compile_processors", |
Ethan Nicholas | 5b5f096 | 2017-09-11 13:50:14 -0700 | [diff] [blame] | 616 | ":run_sksllex", |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 617 | ] |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 618 | if (skia_generate_workarounds) { |
| 619 | deps += [ ":workaround_list" ] |
| 620 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 621 | public_defines = [] |
Chris Dalton | 3a67b8e | 2018-05-03 09:30:29 -0600 | [diff] [blame] | 622 | public_configs = [] |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 623 | public_deps = [] |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 624 | |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 625 | sources = skia_gpu_sources + skia_sksl_sources + skia_gpu_processor_outputs |
Kevin Lubick | 93faa67 | 2018-10-10 15:54:53 -0400 | [diff] [blame] | 626 | if (!skia_enable_ccpr) { |
| 627 | sources -= skia_ccpr_sources |
| 628 | sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ] |
| 629 | } |
Kevin Lubick | 4bf2c26 | 2018-10-15 09:35:54 -0400 | [diff] [blame] | 630 | if (!skia_enable_nvpr) { |
| 631 | sources -= skia_nvpr_sources |
| 632 | sources += [ "src/gpu/GrPathRendering_none.cpp" ] |
| 633 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 634 | |
| 635 | # These paths need to be absolute to match the ones produced by shared_sources.gni. |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 636 | sources -= get_path_info([ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ], |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 637 | "abspath") |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 638 | libs = [] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 639 | if (is_android) { |
Hal Canary | 25375e8 | 2018-03-14 15:16:56 -0400 | [diff] [blame] | 640 | sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ] |
Derek Sollenberger | 7a86987 | 2017-06-27 15:37:25 -0400 | [diff] [blame] | 641 | |
| 642 | # this lib is required to link against AHardwareBuffer |
| 643 | if (defined(ndk_api) && ndk_api >= 26) { |
| 644 | libs += [ "android" ] |
| 645 | } |
Kevin Lubick | 4a24e10 | 2017-03-29 11:19:01 -0400 | [diff] [blame] | 646 | } else if (skia_use_egl) { |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 647 | sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ] |
Kevin Lubick | 4a24e10 | 2017-03-29 11:19:01 -0400 | [diff] [blame] | 648 | libs += [ "EGL" ] |
Chinmay Garde | d92d035 | 2018-09-17 10:23:28 -0700 | [diff] [blame] | 649 | } else if (is_linux && skia_use_x11) { |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 650 | sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ] |
Mike Klein | a27f269 | 2018-06-20 11:06:39 -0400 | [diff] [blame] | 651 | libs += [ "GL" ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 652 | } else if (is_mac) { |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 653 | sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ] |
Chinmay Garde | 130a118 | 2016-11-23 11:43:56 -0800 | [diff] [blame] | 654 | } else if (is_ios) { |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 655 | sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ] |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 656 | } else if (is_win) { |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 657 | sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ] |
Brian Osman | 0c75727 | 2018-12-10 10:27:26 -0500 | [diff] [blame] | 658 | if (target_cpu != "arm64") { |
| 659 | libs += [ "OpenGL32.lib" ] |
| 660 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 661 | } else { |
Brian Salomon | 3d6801e | 2017-12-11 10:06:31 -0500 | [diff] [blame] | 662 | sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 663 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 664 | |
| 665 | if (skia_use_vulkan) { |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 666 | public_defines += [ "SK_VULKAN" ] |
Greg Daniel | 18dbfd0 | 2018-05-29 10:46:51 -0400 | [diff] [blame] | 667 | deps += [ "third_party/vulkanmemoryallocator" ] |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 668 | sources += skia_vk_sources |
egdaniel | e4a9bd7 | 2016-09-21 07:36:14 -0700 | [diff] [blame] | 669 | if (skia_enable_vulkan_debug_layers) { |
| 670 | public_defines += [ "SK_ENABLE_VK_LAYERS" ] |
| 671 | } |
Craig Stout | cb6b4bd | 2018-12-13 10:20:07 -0800 | [diff] [blame] | 672 | if (is_fuchsia) { |
Kevin Lubick | ec1c620 | 2018-12-14 11:42:53 -0500 | [diff] [blame] | 673 | public_deps += |
| 674 | [ "//third_party/vulkan_loader_and_validation_layers:vulkan" ] |
Craig Stout | cb6b4bd | 2018-12-13 10:20:07 -0800 | [diff] [blame] | 675 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 676 | } |
Greg Daniel | 91dfa3b | 2018-05-22 13:25:15 -0400 | [diff] [blame] | 677 | |
Ethan Nicholas | a6ae1f7 | 2017-03-16 09:56:54 -0400 | [diff] [blame] | 678 | if (skia_enable_spirv_validation) { |
Ethan Nicholas | 762466e | 2017-06-29 10:03:38 -0400 | [diff] [blame] | 679 | deps += [ "//third_party/spirv-tools" ] |
Ethan Nicholas | a6ae1f7 | 2017-03-16 09:56:54 -0400 | [diff] [blame] | 680 | public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ] |
| 681 | } |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 682 | |
Greg Daniel | 6b7e0e2 | 2017-07-12 16:21:09 -0400 | [diff] [blame] | 683 | cflags_objcc = [] |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 684 | if (skia_use_metal) { |
| 685 | public_defines += [ "SK_METAL" ] |
| 686 | sources += skia_metal_sources |
| 687 | libs += [ "Metal.framework" ] |
Greg Daniel | 53956d9 | 2018-08-08 14:41:19 -0400 | [diff] [blame] | 688 | libs += [ "Foundation.framework" ] |
Greg Daniel | 6b7e0e2 | 2017-07-12 16:21:09 -0400 | [diff] [blame] | 689 | cflags_objcc += [ "-fobjc-arc" ] |
Greg Daniel | e5ddff5 | 2017-07-05 16:49:36 -0400 | [diff] [blame] | 690 | } |
Brian Salomon | cbcb0a1 | 2017-11-19 13:20:13 -0500 | [diff] [blame] | 691 | |
| 692 | if (skia_enable_atlas_text) { |
| 693 | sources += skia_atlas_text_sources |
| 694 | } |
Kevin Lubick | f4def34 | 2018-10-04 12:52:50 -0400 | [diff] [blame] | 695 | |
| 696 | if (is_debug) { |
| 697 | public_defines += [ "SK_ENABLE_DUMP_GPU" ] |
| 698 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 699 | } |
| 700 | |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 701 | optional("gif") { |
| 702 | enabled = !skia_use_wuffs |
| 703 | sources = [ |
| 704 | "src/codec/SkGifCodec.cpp", |
| 705 | "third_party/gif/SkGifImageReader.cpp", |
| 706 | ] |
| 707 | } |
| 708 | |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 709 | optional("heif") { |
| 710 | enabled = skia_use_libheif |
| 711 | public_defines = [ "SK_HAS_HEIF_LIBRARY" ] |
| 712 | |
| 713 | deps = [] |
| 714 | |
| 715 | sources = [ |
| 716 | "src/codec/SkHeifCodec.cpp", |
| 717 | ] |
| 718 | } |
| 719 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 720 | optional("jpeg") { |
| 721 | enabled = skia_use_libjpeg_turbo |
| 722 | public_defines = [ "SK_HAS_JPEG_LIBRARY" ] |
| 723 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 724 | deps = [ |
| 725 | "//third_party/libjpeg-turbo:libjpeg", |
| 726 | ] |
Mike Klein | f105dc7 | 2018-06-05 15:22:54 -0400 | [diff] [blame] | 727 | public = [ |
| 728 | "include/encode/SkJpegEncoder.h", |
| 729 | ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 730 | sources = [ |
| 731 | "src/codec/SkJpegCodec.cpp", |
| 732 | "src/codec/SkJpegDecoderMgr.cpp", |
| 733 | "src/codec/SkJpegUtility.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 734 | "src/images/SkJPEGWriteUtility.cpp", |
Matt Sarett | 04c3731 | 2017-05-05 14:02:13 -0400 | [diff] [blame] | 735 | "src/images/SkJpegEncoder.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 736 | ] |
| 737 | } |
| 738 | |
| 739 | optional("pdf") { |
Hal Canary | 43fb7a0 | 2016-12-30 13:09:03 -0500 | [diff] [blame] | 740 | enabled = skia_use_zlib && skia_enable_pdf |
| 741 | public_defines = [ "SK_SUPPORT_PDF" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 742 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 743 | deps = [ |
| 744 | "//third_party/zlib", |
| 745 | ] |
Hal Canary | 83e0f1b | 2018-04-05 16:58:41 -0400 | [diff] [blame] | 746 | if (skia_use_libjpeg_turbo) { |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 747 | deps += [ ":jpeg" ] |
Hal Canary | 83e0f1b | 2018-04-05 16:58:41 -0400 | [diff] [blame] | 748 | } |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 749 | sources = skia_pdf_sources |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 750 | sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] |
Hal Canary | 2a3093c | 2019-02-20 11:25:45 -0500 | [diff] [blame] | 751 | if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) { |
| 752 | deps += [ "//third_party/harfbuzz" ] |
| 753 | defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ] |
| 754 | } else if (skia_use_icu && skia_use_sfntly) { |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 755 | deps += [ "//third_party/sfntly" ] |
Hal Canary | 32498f0 | 2019-02-04 15:36:31 -0500 | [diff] [blame] | 756 | defines = [ "SK_PDF_USE_SFNTLY" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 757 | } |
| 758 | } |
| 759 | |
| 760 | optional("png") { |
| 761 | enabled = skia_use_libpng |
| 762 | public_defines = [ "SK_HAS_PNG_LIBRARY" ] |
| 763 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 764 | deps = [ |
| 765 | "//third_party/libpng", |
| 766 | ] |
| 767 | sources = [ |
| 768 | "src/codec/SkIcoCodec.cpp", |
| 769 | "src/codec/SkPngCodec.cpp", |
Matt Sarett | 04c3731 | 2017-05-05 14:02:13 -0400 | [diff] [blame] | 770 | "src/images/SkPngEncoder.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 771 | ] |
| 772 | } |
| 773 | |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 774 | optional("raw") { |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 775 | enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 776 | public_defines = [ "SK_CODEC_DECODES_RAW" ] |
| 777 | |
| 778 | deps = [ |
| 779 | "//third_party/dng_sdk", |
| 780 | "//third_party/libjpeg-turbo:libjpeg", |
| 781 | "//third_party/piex", |
| 782 | ] |
| 783 | |
| 784 | # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of |
| 785 | # Skia. |
| 786 | configs_to_remove = [ "//gn:no_exceptions" ] |
| 787 | |
| 788 | sources = [ |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 789 | "src/codec/SkRawCodec.cpp", |
| 790 | ] |
| 791 | } |
| 792 | |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 793 | import("third_party/skcms/skcms.gni") |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 794 | source_set("skcms") { |
Mike Klein | 852a8cb | 2018-05-15 10:46:58 -0400 | [diff] [blame] | 795 | cflags = [] |
| 796 | if (!is_win || is_clang) { |
| 797 | cflags += [ |
| 798 | "-w", |
| 799 | "-std=c11", |
| 800 | ] |
| 801 | } |
| 802 | |
| 803 | public = [ |
| 804 | "third_party/skcms/skcms.h", |
| 805 | ] |
| 806 | sources = rebase_path(skcms_sources, ".", "third_party/skcms") |
| 807 | } |
| 808 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 809 | optional("typeface_freetype") { |
| 810 | enabled = skia_use_freetype |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 811 | |
| 812 | deps = [ |
| 813 | "//third_party/freetype2", |
| 814 | ] |
| 815 | sources = [ |
| 816 | "src/ports/SkFontHost_FreeType.cpp", |
| 817 | "src/ports/SkFontHost_FreeType_common.cpp", |
| 818 | ] |
| 819 | } |
| 820 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 821 | optional("webp") { |
| 822 | enabled = skia_use_libwebp |
| 823 | public_defines = [ "SK_HAS_WEBP_LIBRARY" ] |
| 824 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 825 | deps = [ |
| 826 | "//third_party/libwebp", |
| 827 | ] |
| 828 | sources = [ |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 829 | "src/codec/SkWebpCodec.cpp", |
Matt Sarett | 04c3731 | 2017-05-05 14:02:13 -0400 | [diff] [blame] | 830 | "src/images/SkWebpEncoder.cpp", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 831 | ] |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 832 | } |
| 833 | |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 834 | optional("wuffs") { |
| 835 | enabled = skia_use_wuffs |
| 836 | public_defines = [ "SK_HAS_WUFFS_LIBRARY" ] |
| 837 | |
| 838 | deps = [ |
| 839 | "//third_party/wuffs", |
| 840 | ] |
| 841 | sources = [ |
| 842 | "src/codec/SkWuffsCodec.cpp", |
| 843 | ] |
| 844 | } |
| 845 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 846 | optional("xml") { |
| 847 | enabled = skia_use_expat |
Florin Malita | 442fff9 | 2016-11-08 16:07:52 +0000 | [diff] [blame] | 848 | public_defines = [ "SK_XML" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 849 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 850 | deps = [ |
| 851 | "//third_party/expat", |
| 852 | ] |
| 853 | sources = [ |
Mike Klein | bd41bcc | 2017-02-09 16:38:15 -0500 | [diff] [blame] | 854 | "src/svg/SkSVGCanvas.cpp", |
| 855 | "src/svg/SkSVGDevice.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 856 | "src/xml/SkDOM.cpp", |
| 857 | "src/xml/SkXMLParser.cpp", |
| 858 | "src/xml/SkXMLWriter.cpp", |
| 859 | ] |
| 860 | } |
| 861 | |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 862 | if (skia_enable_gpu && skia_generate_workarounds) { |
| 863 | action("workaround_list") { |
| 864 | script = "tools/build_workaround_header.py" |
| 865 | |
| 866 | inputs = [ |
| 867 | "src/gpu/gpu_workaround_list.txt", |
| 868 | ] |
| 869 | |
| 870 | # see comments in skia_compile_processors about out dir path shenanigans. |
| 871 | output_file = |
Adrienne Walker | ab7181d | 2018-05-14 14:02:03 -0700 | [diff] [blame] | 872 | rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir) |
Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame] | 873 | |
| 874 | outputs = [ |
| 875 | "$root_out_dir/$output_file", |
| 876 | ] |
| 877 | args = [ |
| 878 | "--output-file", |
| 879 | "$output_file", |
| 880 | ] |
| 881 | |
| 882 | foreach(file, inputs) { |
| 883 | args += [ rebase_path(file, root_build_dir) ] |
| 884 | } |
| 885 | } |
| 886 | } |
| 887 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 888 | component("skia") { |
| 889 | public_configs = [ ":skia_public" ] |
| 890 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 891 | |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 892 | public_deps = [ |
Ben Wagner | e27ee6c | 2019-02-15 14:59:30 -0500 | [diff] [blame] | 893 | ":gpu", |
Mike Klein | 607b0a7 | 2018-11-07 16:17:34 -0500 | [diff] [blame] | 894 | ":pdf", |
| 895 | ":skcms", |
| 896 | ] |
| 897 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 898 | deps = [ |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 899 | ":arm64", |
| 900 | ":armv7", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 901 | ":avx", |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 902 | ":compile_processors", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 903 | ":crc32", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 904 | ":fontmgr_android", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 905 | ":fontmgr_custom", |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 906 | ":fontmgr_custom_empty", |
Hal Canary | ff2742e | 2018-01-30 11:35:47 -0500 | [diff] [blame] | 907 | ":fontmgr_empty", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 908 | ":fontmgr_fontconfig", |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 909 | ":fontmgr_fuchsia", |
Kevin Lubick | ddd0a33 | 2018-12-12 10:35:13 -0500 | [diff] [blame] | 910 | ":fontmgr_wasm", |
Leon Scroggins III | 631dbc8 | 2019-03-04 13:54:02 -0500 | [diff] [blame] | 911 | ":fontmgr_win", |
| 912 | ":fontmgr_win_gdi", |
Leon Scroggins III | 4116920 | 2019-01-29 09:29:57 -0500 | [diff] [blame] | 913 | ":gif", |
Leon Scroggins III | 04be2b5 | 2017-08-17 15:13:20 -0400 | [diff] [blame] | 914 | ":heif", |
Mike Klein | 1b9b7d5 | 2018-02-27 10:37:40 -0500 | [diff] [blame] | 915 | ":hsw", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 916 | ":jpeg", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 917 | ":none", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 918 | ":png", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 919 | ":raw", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 920 | ":sse2", |
| 921 | ":sse41", |
| 922 | ":sse42", |
| 923 | ":ssse3", |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 924 | ":webp", |
Leon Scroggins III | e93ec68 | 2018-10-26 09:25:51 -0400 | [diff] [blame] | 925 | ":wuffs", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 926 | ":xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 927 | ] |
| 928 | |
Kevin Lubick | 134be1d | 2018-10-30 15:05:04 -0400 | [diff] [blame] | 929 | if (skia_enable_nima) { |
| 930 | deps += [ "//third_party/Nima-Cpp" ] |
| 931 | } |
| 932 | |
Chinmay Garde | 43f115c | 2016-11-16 15:04:12 -0800 | [diff] [blame] | 933 | # This file (and all GN files in Skia) are designed to work with an |
| 934 | # empty sources assignment filter; we handle all that explicitly. |
| 935 | # We clear the filter here for clients who may have set up a global filter. |
| 936 | set_sources_assignment_filter([]) |
| 937 | |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 938 | public = skia_core_public |
| 939 | public += skia_utils_public |
| 940 | public += skia_effects_public |
| 941 | public += skia_effects_imagefilter_public |
| 942 | public += skia_xps_public |
| 943 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 944 | sources = [] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 945 | sources += skia_core_sources |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 946 | sources += skia_utils_sources |
Leon Scroggins III | ee0e5d0 | 2019-02-27 10:59:11 -0500 | [diff] [blame] | 947 | if (skia_use_xps) { |
| 948 | sources += skia_xps_sources |
| 949 | } |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 950 | sources += skia_effects_sources |
| 951 | sources += skia_effects_imagefilter_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 952 | sources += [ |
Stan Iliev | 73d8fd9 | 2017-08-02 15:36:24 -0400 | [diff] [blame] | 953 | "src/android/SkAndroidFrameworkUtils.cpp", |
Leon Scroggins III | 42ee284 | 2018-01-14 14:46:51 -0500 | [diff] [blame] | 954 | "src/android/SkAnimatedImage.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 955 | "src/android/SkBitmapRegionCodec.cpp", |
| 956 | "src/android/SkBitmapRegionDecoder.cpp", |
| 957 | "src/codec/SkAndroidCodec.cpp", |
Nigel Tao | 612a65d | 2018-11-09 10:10:31 +1100 | [diff] [blame] | 958 | "src/codec/SkAndroidCodecAdapter.cpp", |
Leon Scroggins III | d81fed9 | 2017-06-01 13:42:28 -0400 | [diff] [blame] | 959 | "src/codec/SkBmpBaseCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 960 | "src/codec/SkBmpCodec.cpp", |
| 961 | "src/codec/SkBmpMaskCodec.cpp", |
| 962 | "src/codec/SkBmpRLECodec.cpp", |
| 963 | "src/codec/SkBmpStandardCodec.cpp", |
| 964 | "src/codec/SkCodec.cpp", |
| 965 | "src/codec/SkCodecImageGenerator.cpp", |
Leon Scroggins III | 22f673d | 2018-05-30 15:33:46 -0400 | [diff] [blame] | 966 | "src/codec/SkColorTable.cpp", |
Leon Scroggins III | 36f7e32 | 2018-08-27 11:55:46 -0400 | [diff] [blame] | 967 | "src/codec/SkEncodedInfo.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 968 | "src/codec/SkMaskSwizzler.cpp", |
| 969 | "src/codec/SkMasks.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 970 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 971 | "src/codec/SkSampler.cpp", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 972 | "src/codec/SkStreamBuffer.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 973 | "src/codec/SkSwizzler.cpp", |
| 974 | "src/codec/SkWbmpCodec.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 975 | "src/images/SkImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 976 | "src/ports/SkDiscardableMemory_none.cpp", |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 977 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 978 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 979 | "src/ports/SkMemory_malloc.cpp", |
| 980 | "src/ports/SkOSFile_stdio.cpp", |
| 981 | "src/sfnt/SkOTTable_name.cpp", |
| 982 | "src/sfnt/SkOTUtils.cpp", |
| 983 | "src/utils/mac/SkStream_mac.cpp", |
Jim Van Verth | 1676cb9 | 2019-01-15 13:24:45 -0500 | [diff] [blame] | 984 | "third_party/etc1/etc1.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 985 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 986 | |
Kevin Lubick | 32dfdbe | 2018-10-18 09:47:01 -0400 | [diff] [blame] | 987 | defines = [] |
| 988 | if (!skia_enable_skpicture) { |
| 989 | defines = [ "SK_DISABLE_SKPICTURE" ] |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 990 | public -= skia_skpicture_public |
Kevin Lubick | 32dfdbe | 2018-10-18 09:47:01 -0400 | [diff] [blame] | 991 | sources -= skia_skpicture_sources |
Mike Klein | 5437823 | 2018-11-08 12:08:05 +0000 | [diff] [blame] | 992 | sources -= [ "//src/effects/imagefilters/SkPictureImageFilter.cpp" ] |
Kevin Lubick | 32dfdbe | 2018-10-18 09:47:01 -0400 | [diff] [blame] | 993 | sources += [ "src/core/SkPicture_none.cpp" ] |
| 994 | } |
| 995 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 996 | libs = [] |
| 997 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 998 | if (is_win) { |
| 999 | sources += [ |
| 1000 | "src/ports/SkDebug_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1001 | "src/ports/SkImageEncoder_WIC.cpp", |
| 1002 | "src/ports/SkImageGeneratorWIC.cpp", |
| 1003 | "src/ports/SkOSFile_win.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 1004 | "src/ports/SkOSLibrary_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1005 | "src/ports/SkTLS_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1006 | ] |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 1007 | libs += [ |
| 1008 | "FontSub.lib", |
| 1009 | "Ole32.lib", |
| 1010 | "OleAut32.lib", |
| 1011 | "User32.lib", |
Mike Klein | 0c5fdcb | 2017-11-13 12:40:46 -0500 | [diff] [blame] | 1012 | "Usp10.lib", |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 1013 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1014 | } else { |
| 1015 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1016 | "src/ports/SkOSFile_posix.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 1017 | "src/ports/SkOSLibrary_posix.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1018 | "src/ports/SkTLS_pthread.cpp", |
| 1019 | ] |
Ben Wagner | be6ae5b | 2017-08-31 16:45:23 -0400 | [diff] [blame] | 1020 | libs += [ "dl" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1021 | } |
| 1022 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1023 | if (is_android) { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 1024 | deps += [ "//third_party/expat" ] |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 1025 | if (defined(ndk) && ndk != "") { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 1026 | deps += [ "//third_party/cpu-features" ] |
| 1027 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1028 | sources += [ "src/ports/SkDebug_android.cpp" ] |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1029 | libs += [ |
| 1030 | "EGL", |
| 1031 | "GLESv2", |
| 1032 | "log", |
| 1033 | ] |
| 1034 | } |
| 1035 | |
Kevin Lubick | 217056c | 2018-09-20 17:39:31 -0400 | [diff] [blame] | 1036 | if (is_linux || target_cpu == "wasm") { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1037 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
Hal Canary | 25375e8 | 2018-03-14 15:16:56 -0400 | [diff] [blame] | 1038 | if (skia_use_egl) { |
| 1039 | libs += [ "GLESv2" ] |
| 1040 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1041 | } |
| 1042 | |
Leon Scroggins III | 85e22fc | 2018-11-28 08:58:47 -0500 | [diff] [blame] | 1043 | if (skia_use_fonthost_mac) { |
Sergey Ulanov | f3babcd | 2018-11-30 17:42:00 -0800 | [diff] [blame] | 1044 | sources += [ "src/ports/SkFontHost_mac.cpp" ] |
Leon Scroggins III | 85e22fc | 2018-11-28 08:58:47 -0500 | [diff] [blame] | 1045 | } |
| 1046 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1047 | if (is_mac) { |
| 1048 | sources += [ |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 1049 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1050 | "src/ports/SkImageEncoder_CG.cpp", |
| 1051 | "src/ports/SkImageGeneratorCG.cpp", |
| 1052 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 1053 | libs += [ |
bungeman | 3e306f6 | 2017-03-29 11:32:02 -0400 | [diff] [blame] | 1054 | # AppKit symbols NSFontWeightXXX may be dlsym'ed. |
| 1055 | "AppKit.framework", |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 1056 | "ApplicationServices.framework", |
| 1057 | "OpenGL.framework", |
| 1058 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1059 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1060 | |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1061 | if (is_ios) { |
| 1062 | sources += [ |
| 1063 | "src/ports/SkDebug_stdio.cpp", |
| 1064 | "src/ports/SkFontHost_mac.cpp", |
| 1065 | "src/ports/SkImageEncoder_CG.cpp", |
| 1066 | "src/ports/SkImageGeneratorCG.cpp", |
| 1067 | ] |
| 1068 | libs += [ |
| 1069 | "CoreFoundation.framework", |
| 1070 | "CoreGraphics.framework", |
| 1071 | "CoreText.framework", |
| 1072 | "ImageIO.framework", |
| 1073 | "MobileCoreServices.framework", |
bungeman | 3e306f6 | 2017-03-29 11:32:02 -0400 | [diff] [blame] | 1074 | |
| 1075 | # UIKit symbols UIFontWeightXXX may be dlsym'ed. |
| 1076 | "UIKit.framework", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1077 | ] |
| 1078 | } |
| 1079 | |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1080 | if (is_fuchsia) { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 1081 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 1082 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 1083 | } |
| 1084 | |
Nathaniel Nifong | ad5f6cd | 2019-03-05 10:45:40 -0500 | [diff] [blame] | 1085 | # DebugCanvas used in experimental/wasm-skp-debugger |
| 1086 | if (target_cpu == "wasm") { |
| 1087 | static_library("debugcanvas") { |
| 1088 | public_configs = [ ":skia_public" ] |
| 1089 | |
| 1090 | include_dirs = [ |
| 1091 | "include/gpu", |
| 1092 | "include/private", |
| 1093 | "src/gpu", |
| 1094 | "src/core", |
| 1095 | "src/shaders", |
| 1096 | "src/utils", |
| 1097 | "tools", |
| 1098 | "tools/debugger", |
| 1099 | ] |
| 1100 | |
| 1101 | sources = [ |
| 1102 | "tools/UrlDataManager.cpp", |
| 1103 | "tools/debugger/SkDebugCanvas.cpp", |
| 1104 | "tools/debugger/SkDrawCommand.cpp", |
| 1105 | "tools/debugger/SkJsonWriteBuffer.cpp", |
| 1106 | ] |
| 1107 | |
| 1108 | deps = [ |
| 1109 | ":fontmgr_wasm", |
| 1110 | ] |
| 1111 | } |
| 1112 | } |
| 1113 | |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1114 | static_library("pathkit") { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1115 | check_includes = false |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1116 | public_configs = [ ":skia_public" ] |
| 1117 | configs += skia_library_configs |
| 1118 | |
| 1119 | deps = [ |
| 1120 | ":arm64", |
| 1121 | ":armv7", |
| 1122 | ":avx", |
| 1123 | ":crc32", |
| 1124 | ":hsw", |
| 1125 | ":none", |
| 1126 | ":sse2", |
| 1127 | ":sse41", |
| 1128 | ":sse42", |
| 1129 | ":ssse3", |
| 1130 | ] |
| 1131 | |
| 1132 | # This file (and all GN files in Skia) are designed to work with an |
| 1133 | # empty sources assignment filter; we handle all that explicitly. |
| 1134 | # We clear the filter here for clients who may have set up a global filter. |
| 1135 | set_sources_assignment_filter([]) |
| 1136 | |
| 1137 | sources = [] |
| 1138 | sources += skia_pathops_sources |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1139 | sources += skia_pathops_public |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1140 | sources += [ |
| 1141 | "src/core/SkAnalyticEdge.cpp", |
| 1142 | "src/core/SkArenaAlloc.cpp", |
Mike Reed | cc88f3a | 2019-02-06 11:40:27 -0500 | [diff] [blame] | 1143 | "src/core/SkContourMeasure.cpp", |
Kevin Lubick | cbcff38 | 2018-10-02 09:02:18 -0400 | [diff] [blame] | 1144 | "src/core/SkCubicMap.cpp", |
| 1145 | "src/core/SkEdge.cpp", |
| 1146 | "src/core/SkEdgeBuilder.cpp", |
| 1147 | "src/core/SkEdgeClipper.cpp", |
| 1148 | "src/core/SkGeometry.cpp", |
| 1149 | "src/core/SkLineClipper.cpp", |
| 1150 | "src/core/SkMallocPixelRef.cpp", |
| 1151 | "src/core/SkMath.cpp", |
| 1152 | "src/core/SkMatrix.cpp", |
| 1153 | "src/core/SkOpts.cpp", |
| 1154 | "src/core/SkPaint.cpp", |
| 1155 | "src/core/SkPath.cpp", |
| 1156 | "src/core/SkPathEffect.cpp", |
| 1157 | "src/core/SkPathMeasure.cpp", |
| 1158 | "src/core/SkPathRef.cpp", |
| 1159 | "src/core/SkPoint.cpp", |
| 1160 | "src/core/SkRRect.cpp", |
| 1161 | "src/core/SkRect.cpp", |
| 1162 | "src/core/SkSemaphore.cpp", |
| 1163 | "src/core/SkStream.cpp", |
| 1164 | "src/core/SkString.cpp", |
| 1165 | "src/core/SkStringUtils.cpp", |
| 1166 | "src/core/SkStroke.cpp", |
| 1167 | "src/core/SkStrokeRec.cpp", |
| 1168 | "src/core/SkStrokerPriv.cpp", |
| 1169 | "src/core/SkThreadID.cpp", |
| 1170 | "src/core/SkUtils.cpp", |
| 1171 | "src/effects/SkDashPathEffect.cpp", |
| 1172 | "src/effects/SkTrimPathEffect.cpp", |
| 1173 | "src/ports/SkDebug_stdio.cpp", |
| 1174 | "src/ports/SkMemory_malloc.cpp", |
| 1175 | "src/utils/SkDashPath.cpp", |
| 1176 | "src/utils/SkParse.cpp", |
| 1177 | "src/utils/SkParsePath.cpp", |
| 1178 | "src/utils/SkUTF.cpp", |
| 1179 | ] |
| 1180 | } |
| 1181 | |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1182 | group("modules") { |
| 1183 | deps = [ |
Kevin Lubick | 9663484 | 2019-03-05 14:09:24 -0500 | [diff] [blame] | 1184 | "modules/particles", |
Kevin Lubick | 1ba9c4d | 2019-02-22 10:04:06 -0500 | [diff] [blame] | 1185 | "modules/skottie", |
| 1186 | "modules/skshaper", |
| 1187 | ] |
| 1188 | } |
| 1189 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1190 | # Targets guarded by skia_enable_tools may use //third_party freely. |
| 1191 | if (skia_enable_tools) { |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 1192 | # Used by gn_to_bp.py to list our public include dirs. |
| 1193 | source_set("public") { |
| 1194 | configs += [ ":skia_public" ] |
| 1195 | } |
| 1196 | |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1197 | config("skia.h_config") { |
| 1198 | include_dirs = [ "$target_gen_dir" ] |
| 1199 | } |
| 1200 | action("skia.h") { |
| 1201 | public_configs = [ ":skia.h_config" ] |
| 1202 | skia_h = "$target_gen_dir/skia.h" |
| 1203 | script = "gn/find_headers.py" |
Florin Malita | 6e4d95f | 2018-05-30 09:27:32 -0400 | [diff] [blame] | 1204 | |
| 1205 | # TODO: would be cool to not hard-code these here, but how? |
| 1206 | module_public_includes = [ |
| 1207 | "modules/sksg/include", |
| 1208 | "modules/skottie/include", |
| 1209 | ] |
| 1210 | args = |
| 1211 | [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] + |
| 1212 | [ rebase_path(skia_h, root_build_dir) ] + |
| 1213 | rebase_path(skia_public_includes) + rebase_path(module_public_includes) |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1214 | depfile = "$skia_h.deps" |
| 1215 | outputs = [ |
| 1216 | skia_h, |
| 1217 | ] |
| 1218 | } |
| 1219 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1220 | if (target_cpu == "x64") { |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1221 | executable("fiddle") { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1222 | check_includes = false |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1223 | libs = [] |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1224 | sources = [ |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1225 | "tools/fiddle/draw.cpp", |
| 1226 | "tools/fiddle/fiddle_main.cpp", |
| 1227 | ] |
Joe Gregorio | a8fabd3 | 2017-05-31 09:45:19 -0400 | [diff] [blame] | 1228 | |
| 1229 | if (skia_use_egl) { |
| 1230 | sources += [ "tools/fiddle/egl_context.cpp" ] |
Joe Gregorio | a8fabd3 | 2017-05-31 09:45:19 -0400 | [diff] [blame] | 1231 | } else { |
| 1232 | sources += [ "tools/fiddle/null_context.cpp" ] |
| 1233 | } |
Joe Gregorio | 1e735c0 | 2017-04-19 14:05:14 -0400 | [diff] [blame] | 1234 | testonly = true |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1235 | deps = [ |
Joe Gregorio | 1e735c0 | 2017-04-19 14:05:14 -0400 | [diff] [blame] | 1236 | ":flags", |
Robert Phillips | 57e0828 | 2017-11-16 14:59:48 -0500 | [diff] [blame] | 1237 | ":gpu_tool_utils", |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1238 | ":skia", |
| 1239 | ":skia.h", |
Florin Malita | 6e4d95f | 2018-05-30 09:27:32 -0400 | [diff] [blame] | 1240 | "modules/skottie", |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1241 | ] |
| 1242 | } |
| 1243 | } |
| 1244 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1245 | source_set("public_headers_warnings_check") { |
| 1246 | sources = [ |
| 1247 | "tools/public_headers_warnings_check.cpp", |
| 1248 | ] |
| 1249 | configs -= [ "//gn:warnings_except_public_headers" ] |
| 1250 | deps = [ |
| 1251 | ":skia", |
| 1252 | ":skia.h", |
| 1253 | "modules/skottie", |
| 1254 | ] |
Greg Daniel | 54bfb18 | 2018-11-20 17:12:36 -0500 | [diff] [blame] | 1255 | |
| 1256 | # We add this directory to simulate the client already have |
| 1257 | # vulkan/vulkan_core.h on their path. |
Greg Daniel | 54200e4 | 2018-12-11 17:03:39 -0500 | [diff] [blame] | 1258 | include_dirs = [ "include/third_party/vulkan" ] |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 1259 | } |
| 1260 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1261 | template("test_lib") { |
| 1262 | config(target_name + "_config") { |
| 1263 | include_dirs = invoker.public_include_dirs |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 1264 | if (defined(invoker.public_defines)) { |
| 1265 | defines = invoker.public_defines |
| 1266 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1267 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1268 | source_set(target_name) { |
| 1269 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1270 | check_includes = false |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1271 | public_configs = [ |
| 1272 | ":" + target_name + "_config", |
| 1273 | ":skia_private", |
| 1274 | ] |
| 1275 | |
| 1276 | if (!defined(deps)) { |
| 1277 | deps = [] |
| 1278 | } |
| 1279 | deps += [ ":skia" ] |
| 1280 | testonly = true |
| 1281 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1282 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1283 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1284 | template("test_app") { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1285 | if (is_ios) { |
| 1286 | app_name = target_name |
| 1287 | gen_path = target_gen_dir |
| 1288 | |
| 1289 | action("${app_name}_generate_info_plist") { |
| 1290 | script = "//gn/gen_plist_ios.py" |
| 1291 | outputs = [ |
| 1292 | "$gen_path/${app_name}_Info.plist", |
| 1293 | ] |
| 1294 | args = [ rebase_path("$gen_path/$app_name", root_build_dir) ] |
| 1295 | } |
| 1296 | |
| 1297 | bundle_data("${app_name}_bundle_info_plist") { |
| 1298 | public_deps = [ |
| 1299 | ":${app_name}_generate_info_plist", |
| 1300 | ] |
| 1301 | sources = [ |
| 1302 | "$gen_path/${app_name}_Info.plist", |
| 1303 | ] |
| 1304 | outputs = [ |
| 1305 | "{{bundle_root_dir}}/Info.plist", |
| 1306 | ] |
| 1307 | } |
| 1308 | |
Jim Van Verth | 329c5a6 | 2017-11-29 11:42:33 -0500 | [diff] [blame] | 1309 | bundle_ios_data = |
| 1310 | defined(invoker.bundle_ios_data) && invoker.bundle_ios_data |
| 1311 | |
| 1312 | if (bundle_ios_data) { |
| 1313 | has_skps = |
| 1314 | "True" == exec_script("//gn/checkdir.py", |
| 1315 | [ rebase_path("skps", root_build_dir) ], |
| 1316 | "trim string") |
| 1317 | bundle_data("${app_name}_bundle_resources") { |
| 1318 | sources = [ |
| 1319 | "resources", |
| 1320 | ] |
| 1321 | outputs = [ |
| 1322 | # iOS reserves the folders 'Resources' and 'resources' so store one level deeper |
| 1323 | "{{bundle_resources_dir}}/data/resources", |
| 1324 | ] |
| 1325 | } |
| 1326 | |
| 1327 | if (has_skps) { |
| 1328 | bundle_data("${app_name}_bundle_skps") { |
| 1329 | sources = [ |
| 1330 | "skps", |
| 1331 | ] |
| 1332 | outputs = [ |
| 1333 | # Store in same folder as resources |
| 1334 | "{{bundle_resources_dir}}/data/skps", |
| 1335 | ] |
| 1336 | } |
| 1337 | } |
| 1338 | } |
| 1339 | |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1340 | executable("${app_name}_generate_executable") { |
| 1341 | forward_variables_from(invoker, |
| 1342 | "*", |
| 1343 | [ |
| 1344 | "output_name", |
| 1345 | "visibility", |
| 1346 | "is_shared_library", |
| 1347 | ]) |
Mike Klein | 154e6da | 2017-07-26 15:13:47 -0400 | [diff] [blame] | 1348 | configs += [ ":skia_private" ] |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1349 | testonly = true |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1350 | output_name = rebase_path("$gen_path/$app_name", root_build_dir) |
| 1351 | } |
| 1352 | |
| 1353 | bundle_data("${app_name}_bundle_executable") { |
| 1354 | public_deps = [ |
| 1355 | ":${app_name}_generate_executable", |
| 1356 | ] |
| 1357 | sources = [ |
| 1358 | "$gen_path/$app_name", |
| 1359 | ] |
| 1360 | outputs = [ |
| 1361 | "{{bundle_executable_dir}}/$app_name", |
| 1362 | ] |
| 1363 | testonly = true |
| 1364 | } |
| 1365 | |
| 1366 | create_bundle("$app_name") { |
| 1367 | product_type = "com.apple.product-type.application" |
| 1368 | testonly = true |
| 1369 | |
| 1370 | bundle_root_dir = "${root_build_dir}/${target_name}.app" |
| 1371 | bundle_resources_dir = bundle_root_dir |
| 1372 | bundle_executable_dir = bundle_root_dir |
| 1373 | bundle_plugins_dir = bundle_root_dir + "/Plugins" |
| 1374 | |
| 1375 | deps = [ |
| 1376 | ":${app_name}_bundle_executable", |
| 1377 | ":${app_name}_bundle_info_plist", |
| 1378 | ] |
Jim Van Verth | 329c5a6 | 2017-11-29 11:42:33 -0500 | [diff] [blame] | 1379 | if (bundle_ios_data) { |
| 1380 | deps += [ ":${app_name}_bundle_resources" ] |
| 1381 | if (has_skps) { |
| 1382 | deps += [ ":${app_name}_bundle_skps" ] |
| 1383 | } |
| 1384 | } |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1385 | |
| 1386 | # should only code sign when running on a device, not the simulator |
| 1387 | if (target_cpu != "x64") { |
| 1388 | code_signing_script = "//gn/codesign_ios.py" |
| 1389 | code_signing_sources = [ "$target_gen_dir/$app_name" ] |
| 1390 | code_signing_outputs = [ |
| 1391 | "$bundle_root_dir/_CodeSignature/CodeResources", |
| 1392 | "$bundle_root_dir/embedded.mobileprovision", |
| 1393 | ] |
Jim Van Verth | 4e50297 | 2017-12-07 15:16:10 -0500 | [diff] [blame] | 1394 | code_signing_args = [ |
| 1395 | rebase_path("$bundle_root_dir", root_build_dir), |
| 1396 | skia_ios_identity, |
| 1397 | skia_ios_profile, |
| 1398 | ] |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1399 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1400 | } |
| 1401 | } else { |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1402 | # !is_ios |
| 1403 | |
| 1404 | if (defined(invoker.is_shared_library) && invoker.is_shared_library) { |
| 1405 | shared_library("lib" + target_name) { |
| 1406 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 1407 | configs += [ ":skia_private" ] |
| 1408 | testonly = true |
| 1409 | } |
| 1410 | } else { |
| 1411 | _executable = target_name |
| 1412 | executable(_executable) { |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 1413 | check_includes = false |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1414 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 1415 | configs += [ ":skia_private" ] |
| 1416 | testonly = true |
| 1417 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1418 | } |
Jim Van Verth | 443a913 | 2017-11-28 09:45:26 -0500 | [diff] [blame] | 1419 | if (is_android && skia_android_serial != "" && defined(_executable)) { |
| 1420 | action("push_" + target_name) { |
| 1421 | script = "gn/push_to_android.py" |
| 1422 | deps = [ |
| 1423 | ":" + _executable, |
| 1424 | ] |
| 1425 | _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial" |
| 1426 | outputs = [ |
| 1427 | _stamp, |
| 1428 | ] |
| 1429 | args = [ |
| 1430 | rebase_path("$root_build_dir/$_executable"), |
| 1431 | skia_android_serial, |
| 1432 | rebase_path(_stamp), |
| 1433 | ] |
| 1434 | testonly = true |
| 1435 | } |
Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame] | 1436 | } |
| 1437 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1438 | } |
| 1439 | |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1440 | config("moltenvk_config") { |
| 1441 | if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") { |
| 1442 | if (is_ios) { |
| 1443 | moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/iOS" |
| 1444 | } else { |
| 1445 | moltenvk_framework_path = "$skia_moltenvk_path/MoltenVK/macOS" |
| 1446 | } |
| 1447 | cflags = [ "-F$moltenvk_framework_path" ] |
| 1448 | ldflags = [ "-F$moltenvk_framework_path" ] |
| 1449 | libs = [ |
| 1450 | "MoltenVK.framework", |
| 1451 | "Metal.framework", |
| 1452 | "IOSurface.framework", |
| 1453 | "QuartzCore.framework", |
| 1454 | "Foundation.framework", |
| 1455 | ] |
| 1456 | if (is_ios) { |
| 1457 | libs += [ "UIKit.framework" ] |
| 1458 | } else { |
| 1459 | libs += [ "IOKit.framework" ] |
| 1460 | } |
| 1461 | defines = [ "SK_MOLTENVK" ] |
| 1462 | } |
| 1463 | } |
| 1464 | |
| 1465 | source_set("moltenvk") { |
| 1466 | public_configs = [ ":moltenvk_config" ] |
| 1467 | } |
| 1468 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1469 | test_lib("gpu_tool_utils") { |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1470 | public_include_dirs = [] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1471 | public_defines = [] |
| 1472 | public_include_dirs += [ "tools/gpu" ] |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 1473 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1474 | deps = [] |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1475 | public_deps = [] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1476 | sources = [ |
| 1477 | "tools/gpu/GrContextFactory.cpp", |
| 1478 | "tools/gpu/GrTest.cpp", |
Brian Salomon | 00a5eb8 | 2018-07-11 15:32:05 -0400 | [diff] [blame] | 1479 | "tools/gpu/MemoryCache.cpp", |
| 1480 | "tools/gpu/MemoryCache.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1481 | "tools/gpu/ProxyUtils.cpp", |
| 1482 | "tools/gpu/TestContext.cpp", |
| 1483 | "tools/gpu/atlastext/GLTestAtlasTextRenderer.cpp", |
| 1484 | "tools/gpu/gl/GLTestContext.cpp", |
| 1485 | "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1486 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 1487 | "tools/gpu/mock/MockTestContext.cpp", |
| 1488 | ] |
| 1489 | libs = [] |
| 1490 | |
| 1491 | if (is_android || skia_use_egl) { |
| 1492 | sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] |
| 1493 | } else if (is_ios) { |
| 1494 | sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ] |
| 1495 | libs += [ "OpenGLES.framework" ] |
| 1496 | } else if (is_linux) { |
| 1497 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
Mike Klein | a27f269 | 2018-06-20 11:06:39 -0400 | [diff] [blame] | 1498 | libs += [ |
| 1499 | "GLU", |
| 1500 | "X11", |
| 1501 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1502 | } else if (is_mac) { |
| 1503 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
| 1504 | } else if (is_win) { |
| 1505 | sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ] |
Brian Osman | 0c75727 | 2018-12-10 10:27:26 -0500 | [diff] [blame] | 1506 | libs += [ "Gdi32.lib" ] |
| 1507 | if (target_cpu != "arm64") { |
| 1508 | libs += [ "OpenGL32.lib" ] |
| 1509 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1510 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1511 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1512 | cflags_objcc = [ "-fobjc-arc" ] |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 1513 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1514 | if (skia_use_angle) { |
| 1515 | deps += [ "//third_party/angle2" ] |
| 1516 | sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ] |
| 1517 | } |
Greg Daniel | 54200e4 | 2018-12-11 17:03:39 -0500 | [diff] [blame] | 1518 | |
Greg Daniel | 487132b | 2018-12-20 14:09:36 -0500 | [diff] [blame] | 1519 | public_include_dirs += [ "include/third_party/vulkan" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1520 | if (skia_use_vulkan) { |
| 1521 | sources += [ "tools/gpu/vk/VkTestContext.cpp" ] |
| 1522 | sources += [ "tools/gpu/vk/VkTestUtils.cpp" ] |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1523 | if (defined(skia_moltenvk_path) && skia_moltenvk_path != "") { |
| 1524 | public_deps += [ ":moltenvk" ] |
| 1525 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1526 | } |
| 1527 | if (skia_use_metal) { |
| 1528 | sources += [ "tools/gpu/mtl/MtlTestContext.mm" ] |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 1529 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1530 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1531 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1532 | test_lib("flags") { |
| 1533 | public_include_dirs = [ "tools/flags" ] |
| 1534 | sources = [ |
Mike Klein | 88544fb | 2019-03-20 10:50:33 -0500 | [diff] [blame] | 1535 | "tools/flags/CommandLineFlags.cpp", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1536 | ] |
| 1537 | } |
| 1538 | test_lib("common_flags") { |
| 1539 | public_include_dirs = [ "tools/flags" ] |
| 1540 | sources = [ |
Mike Klein | 88544fb | 2019-03-20 10:50:33 -0500 | [diff] [blame] | 1541 | "tools/flags/CommonFlags.cpp", |
| 1542 | "tools/flags/CommonFlagsConfig.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1543 | ] |
| 1544 | deps = [ |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1545 | ":flags", |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1546 | ] |
| 1547 | public_deps = [ |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1548 | ":gpu_tool_utils", |
| 1549 | ] |
| 1550 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1551 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1552 | test_lib("tool_utils") { |
| 1553 | public_include_dirs = [ |
| 1554 | "tools", |
| 1555 | "tools/debugger", |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 1556 | "tools/fonts", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1557 | "tools/timer", |
Brian Salomon | dcbb9d9 | 2017-07-19 10:53:20 -0400 | [diff] [blame] | 1558 | "tools/trace", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1559 | ] |
| 1560 | sources = [ |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 1561 | "tools/AndroidSkDebugToStdOut.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1562 | "tools/CrashHandler.cpp", |
Robert Phillips | 9660108 | 2018-05-29 16:13:26 -0400 | [diff] [blame] | 1563 | "tools/DDLPromiseImageHelper.cpp", |
| 1564 | "tools/DDLTileHelper.cpp", |
mtklein | 0590fa5 | 2016-09-01 07:06:54 -0700 | [diff] [blame] | 1565 | "tools/LsanSuppressions.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1566 | "tools/ProcStats.cpp", |
| 1567 | "tools/Resources.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1568 | "tools/UrlDataManager.cpp", |
| 1569 | "tools/debugger/SkDebugCanvas.cpp", |
| 1570 | "tools/debugger/SkDrawCommand.cpp", |
| 1571 | "tools/debugger/SkJsonWriteBuffer.cpp", |
Brian Salomon | 5f33a8c | 2018-02-26 14:32:39 -0500 | [diff] [blame] | 1572 | "tools/fonts/SkRandomScalerContext.cpp", |
Herb Derby | 33ac15e | 2018-08-29 12:36:22 -0400 | [diff] [blame] | 1573 | "tools/fonts/SkTestEmptyTypeface.h", |
Brian Salomon | 5f33a8c | 2018-02-26 14:32:39 -0500 | [diff] [blame] | 1574 | "tools/fonts/SkTestFontMgr.cpp", |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 1575 | "tools/fonts/SkTestFontMgr.h", |
| 1576 | "tools/fonts/SkTestSVGTypeface.cpp", |
| 1577 | "tools/fonts/SkTestSVGTypeface.h", |
| 1578 | "tools/fonts/SkTestTypeface.cpp", |
| 1579 | "tools/fonts/SkTestTypeface.h", |
Brian Salomon | 5f33a8c | 2018-02-26 14:32:39 -0500 | [diff] [blame] | 1580 | "tools/fonts/sk_tool_utils_font.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1581 | "tools/random_parse_path.cpp", |
| 1582 | "tools/sk_tool_utils.cpp", |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 1583 | "tools/timer/SkAnimTimer.h", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1584 | "tools/timer/Timer.cpp", |
Brian Osman | 53136aa | 2017-07-20 15:43:35 -0400 | [diff] [blame] | 1585 | "tools/trace/SkChromeTracingTracer.cpp", |
| 1586 | "tools/trace/SkChromeTracingTracer.h", |
Brian Salomon | dcbb9d9 | 2017-07-19 10:53:20 -0400 | [diff] [blame] | 1587 | "tools/trace/SkDebugfTracer.cpp", |
| 1588 | "tools/trace/SkDebugfTracer.h", |
Brian Osman | 53136aa | 2017-07-20 15:43:35 -0400 | [diff] [blame] | 1589 | "tools/trace/SkEventTracingPriv.cpp", |
| 1590 | "tools/trace/SkEventTracingPriv.h", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1591 | ] |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 1592 | libs = [] |
| 1593 | if (is_ios) { |
| 1594 | sources += [ "tools/ios_utils.m" ] |
| 1595 | libs += [ "Foundation.framework" ] |
| 1596 | } |
Hal Canary | fd9bcab | 2018-04-24 11:47:23 -0400 | [diff] [blame] | 1597 | defines = [] |
| 1598 | if (skia_tools_require_resources) { |
| 1599 | defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ] |
| 1600 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1601 | deps = [ |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 1602 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1603 | ":flags", |
| 1604 | "//third_party/libpng", |
| 1605 | ] |
| 1606 | public_deps = [ |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1607 | ":common_flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1608 | ] |
| 1609 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1610 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1611 | import("gn/gm.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1612 | test_lib("gm") { |
| 1613 | public_include_dirs = [ "gm" ] |
| 1614 | sources = gm_sources |
| 1615 | deps = [ |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 1616 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1617 | ":skia", |
| 1618 | ":tool_utils", |
Mike Reed | 2f0edd5 | 2018-05-31 14:22:30 -0400 | [diff] [blame] | 1619 | "modules/skottie", |
Florin Malita | 2687072 | 2018-09-20 14:35:30 -0400 | [diff] [blame] | 1620 | "modules/skottie:gm", |
Florin Malita | 3b526b0 | 2018-05-25 12:43:51 -0400 | [diff] [blame] | 1621 | "modules/sksg", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1622 | ] |
Greg Daniel | da16cce | 2018-08-01 09:23:57 -0400 | [diff] [blame] | 1623 | public_deps = [ |
| 1624 | ":gpu_tool_utils", |
| 1625 | ] |
Hal Canary | b6f5378 | 2019-02-13 10:29:50 -0500 | [diff] [blame] | 1626 | if (skia_enable_skshaper) { |
| 1627 | deps += [ "modules/skshaper" ] |
| 1628 | defines = [ "SK_USING_SKSHAPER" ] |
| 1629 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1630 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1631 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1632 | import("gn/tests.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1633 | test_lib("tests") { |
| 1634 | public_include_dirs = [ "tests" ] |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1635 | sources = tests_sources + pathops_tests_sources |
Leon Scroggins III | be85c19 | 2018-11-13 13:50:12 -0500 | [diff] [blame] | 1636 | if (!skia_enable_fontmgr_android) { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1637 | sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 1638 | } |
Ben Wagner | 37a06c0 | 2018-06-22 21:11:00 +0000 | [diff] [blame] | 1639 | if (!(skia_use_freetype && skia_use_fontconfig)) { |
| 1640 | sources -= [ "//tests/FontMgrFontConfigTest.cpp" ] |
| 1641 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1642 | deps = [ |
Hal Canary | 0f66681 | 2018-03-22 15:21:12 -0400 | [diff] [blame] | 1643 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1644 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1645 | ":skia", |
| 1646 | ":tool_utils", |
Florin Malita | 94d4d3e | 2018-06-18 13:10:51 -0400 | [diff] [blame] | 1647 | "modules/skottie:tests", |
Brian Osman | ccb8752 | 2018-06-01 19:20:00 +0000 | [diff] [blame] | 1648 | "modules/sksg:tests", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1649 | "//third_party/libpng", |
Leon Scroggins III | 194580d | 2019-02-22 12:32:16 -0500 | [diff] [blame] | 1650 | "//third_party/libwebp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1651 | "//third_party/zlib", |
| 1652 | ] |
Mike Klein | d63442d | 2017-03-27 14:16:04 -0400 | [diff] [blame] | 1653 | public_deps = [ |
| 1654 | ":gpu_tool_utils", # Test.h #includes headers from this target. |
| 1655 | ] |
Hal Canary | b6f5378 | 2019-02-13 10:29:50 -0500 | [diff] [blame] | 1656 | if (skia_enable_skshaper) { |
| 1657 | deps += [ "modules/skshaper" ] |
| 1658 | defines = [ "SK_USING_SKSHAPER" ] |
| 1659 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1660 | } |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 1661 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1662 | import("gn/bench.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1663 | test_lib("bench") { |
| 1664 | public_include_dirs = [ "bench" ] |
| 1665 | sources = bench_sources |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1666 | deps = [ |
| 1667 | ":flags", |
| 1668 | ":gm", |
| 1669 | ":gpu_tool_utils", |
| 1670 | ":skia", |
| 1671 | ":tool_utils", |
| 1672 | ] |
| 1673 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1674 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1675 | test_lib("experimental_svg_model") { |
Hal Canary | 0f66681 | 2018-03-22 15:21:12 -0400 | [diff] [blame] | 1676 | public_include_dirs = [] |
| 1677 | if (skia_use_expat) { |
| 1678 | public_include_dirs += [ "experimental/svg/model" ] |
| 1679 | sources = [ |
| 1680 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 1681 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
| 1682 | "experimental/svg/model/SkSVGCircle.cpp", |
| 1683 | "experimental/svg/model/SkSVGClipPath.cpp", |
| 1684 | "experimental/svg/model/SkSVGContainer.cpp", |
| 1685 | "experimental/svg/model/SkSVGDOM.cpp", |
| 1686 | "experimental/svg/model/SkSVGEllipse.cpp", |
| 1687 | "experimental/svg/model/SkSVGGradient.cpp", |
| 1688 | "experimental/svg/model/SkSVGLine.cpp", |
| 1689 | "experimental/svg/model/SkSVGLinearGradient.cpp", |
| 1690 | "experimental/svg/model/SkSVGNode.cpp", |
| 1691 | "experimental/svg/model/SkSVGPath.cpp", |
| 1692 | "experimental/svg/model/SkSVGPattern.cpp", |
| 1693 | "experimental/svg/model/SkSVGPoly.cpp", |
| 1694 | "experimental/svg/model/SkSVGRadialGradient.cpp", |
| 1695 | "experimental/svg/model/SkSVGRect.cpp", |
| 1696 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 1697 | "experimental/svg/model/SkSVGSVG.cpp", |
| 1698 | "experimental/svg/model/SkSVGShape.cpp", |
| 1699 | "experimental/svg/model/SkSVGStop.cpp", |
| 1700 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 1701 | "experimental/svg/model/SkSVGUse.cpp", |
| 1702 | "experimental/svg/model/SkSVGValue.cpp", |
| 1703 | ] |
| 1704 | deps = [ |
| 1705 | ":skia", |
| 1706 | ":xml", |
| 1707 | ] |
| 1708 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1709 | } |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 1710 | |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1711 | if (skia_use_lua) { |
| 1712 | test_lib("lua") { |
| 1713 | public_include_dirs = [] |
| 1714 | sources = [ |
| 1715 | "src/utils/SkLua.cpp", |
| 1716 | "src/utils/SkLuaCanvas.cpp", |
| 1717 | ] |
| 1718 | deps = [ |
Herb Derby | 264182c | 2018-05-29 15:53:40 -0400 | [diff] [blame] | 1719 | "modules/skshaper", |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1720 | "//third_party/lua", |
| 1721 | ] |
| 1722 | } |
| 1723 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1724 | test_app("lua_app") { |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1725 | sources = [ |
| 1726 | "tools/lua/lua_app.cpp", |
| 1727 | ] |
| 1728 | deps = [ |
| 1729 | ":lua", |
| 1730 | ":skia", |
| 1731 | "//third_party/lua", |
| 1732 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1733 | } |
| 1734 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1735 | test_app("lua_pictures") { |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1736 | sources = [ |
| 1737 | "tools/lua/lua_pictures.cpp", |
| 1738 | ] |
| 1739 | deps = [ |
| 1740 | ":flags", |
| 1741 | ":lua", |
| 1742 | ":skia", |
| 1743 | ":tool_utils", |
| 1744 | "//third_party/lua", |
| 1745 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1746 | } |
| 1747 | } |
| 1748 | |
Cary Clark | 8032b98 | 2017-07-28 11:04:54 -0400 | [diff] [blame] | 1749 | test_app("bookmaker") { |
| 1750 | sources = [ |
Cary Clark | 2da9fb8 | 2018-11-01 09:29:36 -0400 | [diff] [blame] | 1751 | "tools/bookmaker/bmhParser.cpp", |
Cary Clark | 8032b98 | 2017-07-28 11:04:54 -0400 | [diff] [blame] | 1752 | "tools/bookmaker/bookmaker.cpp", |
Cary Clark | bef063a | 2017-10-31 15:44:45 -0400 | [diff] [blame] | 1753 | "tools/bookmaker/cataloger.cpp", |
Cary Clark | a560c47 | 2017-11-27 10:44:06 -0500 | [diff] [blame] | 1754 | "tools/bookmaker/definition.cpp", |
Cary Clark | 8032b98 | 2017-07-28 11:04:54 -0400 | [diff] [blame] | 1755 | "tools/bookmaker/fiddleParser.cpp", |
Cary Clark | 2da9fb8 | 2018-11-01 09:29:36 -0400 | [diff] [blame] | 1756 | "tools/bookmaker/hackParser.cpp", |
Cary Clark | 8032b98 | 2017-07-28 11:04:54 -0400 | [diff] [blame] | 1757 | "tools/bookmaker/includeParser.cpp", |
| 1758 | "tools/bookmaker/includeWriter.cpp", |
| 1759 | "tools/bookmaker/mdOut.cpp", |
| 1760 | "tools/bookmaker/parserCommon.cpp", |
Cary Clark | ac47b88 | 2018-01-11 10:35:44 -0500 | [diff] [blame] | 1761 | "tools/bookmaker/selfCheck.cpp", |
Cary Clark | 8032b98 | 2017-07-28 11:04:54 -0400 | [diff] [blame] | 1762 | "tools/bookmaker/spellCheck.cpp", |
Cary Clark | 2da9fb8 | 2018-11-01 09:29:36 -0400 | [diff] [blame] | 1763 | "tools/bookmaker/textParser.cpp", |
Cary Clark | 8032b98 | 2017-07-28 11:04:54 -0400 | [diff] [blame] | 1764 | ] |
| 1765 | deps = [ |
| 1766 | ":flags", |
| 1767 | ":skia", |
| 1768 | ":tool_utils", |
| 1769 | ] |
| 1770 | } |
| 1771 | |
Florin Malita | bfe876a | 2018-09-02 12:33:59 -0400 | [diff] [blame] | 1772 | if (is_linux || is_mac) { |
Florin Malita | 79725d3 | 2018-06-05 16:16:57 -0400 | [diff] [blame] | 1773 | test_app("skottie_tool") { |
| 1774 | deps = [ |
| 1775 | "modules/skottie:tool", |
| 1776 | ] |
| 1777 | } |
| 1778 | } |
| 1779 | |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1780 | if (target_cpu != "wasm") { |
| 1781 | import("gn/samples.gni") |
| 1782 | test_lib("samples") { |
| 1783 | public_include_dirs = [ "samplecode" ] |
| 1784 | include_dirs = [ "experimental" ] |
Yuqian Li | 56a4a09 | 2018-02-12 14:47:34 +0800 | [diff] [blame] | 1785 | sources = samples_sources |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 1786 | public_deps = [ |
| 1787 | ":tool_utils", |
| 1788 | ] |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1789 | deps = [ |
| 1790 | ":experimental_svg_model", |
| 1791 | ":flags", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1792 | ":xml", |
Mike Reed | ec80d90 | 2019-02-12 11:31:27 -0500 | [diff] [blame] | 1793 | "modules/sksg", |
Herb Derby | 264182c | 2018-05-29 15:53:40 -0400 | [diff] [blame] | 1794 | "modules/skshaper", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1795 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1796 | |
Ruiqi Mao | f510149 | 2018-06-29 14:32:21 -0400 | [diff] [blame] | 1797 | # NIMA does not build on Windows clang |
| 1798 | if (!is_win || !is_clang) { |
Kevin Lubick | d969932 | 2018-10-30 15:08:53 -0400 | [diff] [blame] | 1799 | sources += [ "experimental/nima/NimaActor.cpp" ] |
Ruiqi Mao | f510149 | 2018-06-29 14:32:21 -0400 | [diff] [blame] | 1800 | deps += [ "//third_party/Nima-Cpp" ] |
| 1801 | } |
| 1802 | |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1803 | if (skia_use_lua) { |
| 1804 | sources += [ "samplecode/SampleLua.cpp" ] |
| 1805 | deps += [ |
| 1806 | ":lua", |
| 1807 | "//third_party/lua", |
| 1808 | ] |
| 1809 | } |
| 1810 | } |
Mike Klein | 7af351a | 2018-07-27 09:54:43 -0400 | [diff] [blame] | 1811 | test_app("imgcvt") { |
| 1812 | sources = [ |
| 1813 | "tools/imgcvt.cpp", |
| 1814 | ] |
| 1815 | deps = [ |
| 1816 | ":skcms", |
| 1817 | ":skia", |
| 1818 | ] |
| 1819 | } |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1820 | test_app("dm") { |
| 1821 | sources = [ |
| 1822 | "dm/DM.cpp", |
Hal Canary | b6c5e5b | 2017-10-09 16:13:02 -0400 | [diff] [blame] | 1823 | "dm/DMGpuTestProcs.cpp", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1824 | "dm/DMJsonWriter.cpp", |
| 1825 | "dm/DMSrcSink.cpp", |
| 1826 | ] |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1827 | deps = [ |
| 1828 | ":common_flags", |
| 1829 | ":experimental_svg_model", |
| 1830 | ":flags", |
| 1831 | ":gm", |
| 1832 | ":gpu_tool_utils", |
| 1833 | ":skia", |
| 1834 | ":tests", |
| 1835 | ":tool_utils", |
Florin Malita | 3d856bd | 2018-05-26 09:49:28 -0400 | [diff] [blame] | 1836 | "modules/skottie", |
Florin Malita | a831655 | 2018-11-09 16:19:44 -0500 | [diff] [blame] | 1837 | "modules/skottie:utils", |
Florin Malita | 3b526b0 | 2018-05-25 12:43:51 -0400 | [diff] [blame] | 1838 | "modules/sksg", |
Kevin Lubick | ebf648e | 2017-09-21 13:45:16 -0400 | [diff] [blame] | 1839 | "//third_party/libpng", |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1840 | ] |
Ruiqi Mao | f510149 | 2018-06-29 14:32:21 -0400 | [diff] [blame] | 1841 | |
| 1842 | # NIMA does not build on Windows clang |
| 1843 | if (!is_win || !is_clang) { |
| 1844 | deps += [ "//third_party/Nima-Cpp" ] |
| 1845 | } |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1846 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1847 | } |
| 1848 | |
Mike Klein | a8a51ce | 2018-01-09 12:34:11 -0500 | [diff] [blame] | 1849 | if (!is_win) { |
| 1850 | test_app("remote_demo") { |
| 1851 | sources = [ |
| 1852 | "tools/remote_demo.cpp", |
| 1853 | ] |
| 1854 | deps = [ |
| 1855 | ":skia", |
| 1856 | ] |
| 1857 | } |
| 1858 | } |
| 1859 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1860 | test_app("nanobench") { |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1861 | sources = [ |
| 1862 | "bench/nanobench.cpp", |
| 1863 | ] |
| 1864 | deps = [ |
| 1865 | ":bench", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1866 | ":common_flags", |
fmalita | 6519c21 | 2016-09-14 08:05:17 -0700 | [diff] [blame] | 1867 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1868 | ":flags", |
| 1869 | ":gm", |
| 1870 | ":gpu_tool_utils", |
| 1871 | ":skia", |
| 1872 | ":tool_utils", |
Florin Malita | 3b526b0 | 2018-05-25 12:43:51 -0400 | [diff] [blame] | 1873 | "modules/sksg", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1874 | ] |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1875 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 1876 | |
Ravi Mistry | 10d36c5 | 2017-01-31 09:49:18 -0500 | [diff] [blame] | 1877 | test_app("skpinfo") { |
| 1878 | sources = [ |
| 1879 | "tools/skpinfo.cpp", |
| 1880 | ] |
| 1881 | deps = [ |
| 1882 | ":flags", |
| 1883 | ":skia", |
| 1884 | ] |
| 1885 | } |
| 1886 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 1887 | test_app("skpbench") { |
| 1888 | sources = [ |
| 1889 | "tools/skpbench/skpbench.cpp", |
| 1890 | ] |
| 1891 | deps = [ |
| 1892 | ":flags", |
| 1893 | ":gpu_tool_utils", |
| 1894 | ":skia", |
| 1895 | ":tool_utils", |
| 1896 | ] |
csmartdalton | 4b5179b | 2016-09-19 11:03:58 -0700 | [diff] [blame] | 1897 | } |
| 1898 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1899 | test_app("sktexttopdf") { |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1900 | sources = [ |
Herb Derby | 264182c | 2018-05-29 15:53:40 -0400 | [diff] [blame] | 1901 | "tools/using_skia_and_harfbuzz.cpp", |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1902 | ] |
| 1903 | deps = [ |
| 1904 | ":skia", |
Herb Derby | 264182c | 2018-05-29 15:53:40 -0400 | [diff] [blame] | 1905 | "modules/skshaper", |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1906 | ] |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1907 | } |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1908 | |
Ben Wagner | 219f362 | 2017-07-17 15:32:25 -0400 | [diff] [blame] | 1909 | test_app("create_test_font") { |
| 1910 | sources = [ |
Ben Wagner | 483c772 | 2018-02-20 17:06:07 -0500 | [diff] [blame] | 1911 | "tools/fonts/create_test_font.cpp", |
Ben Wagner | 219f362 | 2017-07-17 15:32:25 -0400 | [diff] [blame] | 1912 | ] |
| 1913 | deps = [ |
| 1914 | ":skia", |
| 1915 | ] |
| 1916 | assert_no_deps = [ |
| 1917 | # tool_utils requires the output of this app. |
| 1918 | ":tool_utils", |
| 1919 | ] |
| 1920 | } |
| 1921 | |
Florin Malita | 5d3ff43 | 2018-07-31 16:38:43 -0400 | [diff] [blame] | 1922 | if (skia_use_expat) { |
| 1923 | test_app("create_test_font_color") { |
| 1924 | sources = [ |
| 1925 | "tools/fonts/create_test_font_color.cpp", |
| 1926 | ] |
| 1927 | deps = [ |
| 1928 | ":flags", |
| 1929 | ":skia", |
| 1930 | ":tool_utils", |
| 1931 | ] |
| 1932 | } |
Ben Wagner | 97182cc | 2018-02-15 10:20:04 -0500 | [diff] [blame] | 1933 | } |
| 1934 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1935 | test_app("get_images_from_skps") { |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1936 | sources = [ |
| 1937 | "tools/get_images_from_skps.cpp", |
| 1938 | ] |
| 1939 | deps = [ |
| 1940 | ":flags", |
| 1941 | ":skia", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1942 | ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1943 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1944 | |
Brian Osman | 6788a54 | 2018-12-10 11:56:01 -0500 | [diff] [blame] | 1945 | if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1946 | test_app("skiaserve") { |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1947 | sources = [ |
| 1948 | "tools/skiaserve/Request.cpp", |
| 1949 | "tools/skiaserve/Response.cpp", |
| 1950 | "tools/skiaserve/skiaserve.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1951 | "tools/skiaserve/urlhandlers/BreakHandler.cpp", |
| 1952 | "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp", |
| 1953 | "tools/skiaserve/urlhandlers/CmdHandler.cpp", |
| 1954 | "tools/skiaserve/urlhandlers/ColorModeHandler.cpp", |
| 1955 | "tools/skiaserve/urlhandlers/DataHandler.cpp", |
| 1956 | "tools/skiaserve/urlhandlers/DownloadHandler.cpp", |
| 1957 | "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp", |
| 1958 | "tools/skiaserve/urlhandlers/ImgHandler.cpp", |
| 1959 | "tools/skiaserve/urlhandlers/InfoHandler.cpp", |
Brian Salomon | 144a5c5 | 2016-12-20 16:48:59 -0500 | [diff] [blame] | 1960 | "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp", |
| 1961 | "tools/skiaserve/urlhandlers/OpsHandler.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1962 | "tools/skiaserve/urlhandlers/OverdrawHandler.cpp", |
| 1963 | "tools/skiaserve/urlhandlers/PostHandler.cpp", |
| 1964 | "tools/skiaserve/urlhandlers/QuitHandler.cpp", |
| 1965 | "tools/skiaserve/urlhandlers/RootHandler.cpp", |
| 1966 | ] |
| 1967 | deps = [ |
| 1968 | ":flags", |
| 1969 | ":gpu_tool_utils", |
| 1970 | ":skia", |
| 1971 | ":tool_utils", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1972 | "//third_party/libmicrohttpd", |
| 1973 | "//third_party/libpng", |
| 1974 | ] |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1975 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1976 | } |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1977 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1978 | test_app("fuzz") { |
Kevin Lubick | 9ff5dc9 | 2018-01-09 12:47:33 -0500 | [diff] [blame] | 1979 | include_dirs = [ |
| 1980 | "tools", |
| 1981 | "tools/debugger", |
Kevin Lubick | ec1c620 | 2018-12-14 11:42:53 -0500 | [diff] [blame] | 1982 | "tools/fonts", |
Kevin Lubick | e9c1ce8 | 2019-03-11 11:09:40 -0400 | [diff] [blame] | 1983 | "src/sksl", |
Kevin Lubick | 9ff5dc9 | 2018-01-09 12:47:33 -0500 | [diff] [blame] | 1984 | ] |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1985 | sources = [ |
Kevin Lubick | bc9a1a8 | 2018-09-17 14:46:57 -0400 | [diff] [blame] | 1986 | "fuzz/Fuzz.cpp", |
Hal Canary | 24ac42b | 2017-02-14 13:35:14 -0500 | [diff] [blame] | 1987 | "fuzz/FuzzCanvas.cpp", |
Cary Clark | 91390c8 | 2018-03-09 14:02:46 -0500 | [diff] [blame] | 1988 | "fuzz/FuzzCommon.cpp", |
Kevin Lubick | fec1dea | 2016-11-22 13:57:18 -0500 | [diff] [blame] | 1989 | "fuzz/FuzzDrawFunctions.cpp", |
Kevin Lubick | e4be55d | 2018-03-30 15:05:13 -0400 | [diff] [blame] | 1990 | "fuzz/FuzzEncoders.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1991 | "fuzz/FuzzGradients.cpp", |
Kevin Lubick | bc9a1a8 | 2018-09-17 14:46:57 -0400 | [diff] [blame] | 1992 | "fuzz/FuzzMain.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1993 | "fuzz/FuzzParsePath.cpp", |
Cary Clark | 91390c8 | 2018-03-09 14:02:46 -0500 | [diff] [blame] | 1994 | "fuzz/FuzzPathMeasure.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1995 | "fuzz/FuzzPathop.cpp", |
Jim Van Verth | 061cc21 | 2018-07-11 14:09:09 -0400 | [diff] [blame] | 1996 | "fuzz/FuzzPolyUtils.cpp", |
Hal Canary | 13872dd | 2018-04-06 10:25:12 -0400 | [diff] [blame] | 1997 | "fuzz/FuzzRegionOp.cpp", |
Leon Scroggins III | 0b8fcbc | 2018-10-16 15:52:17 -0400 | [diff] [blame] | 1998 | "fuzz/oss_fuzz/FuzzAndroidCodec.cpp", |
Kevin Lubick | 2416f96 | 2018-02-12 08:26:39 -0500 | [diff] [blame] | 1999 | "fuzz/oss_fuzz/FuzzAnimatedImage.cpp", |
| 2000 | "fuzz/oss_fuzz/FuzzImage.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 2001 | "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp", |
Leon Scroggins III | 0b8fcbc | 2018-10-16 15:52:17 -0400 | [diff] [blame] | 2002 | "fuzz/oss_fuzz/FuzzIncrementalImage.cpp", |
Florin Malita | 80452be | 2018-06-19 11:27:20 -0400 | [diff] [blame] | 2003 | "fuzz/oss_fuzz/FuzzJSON.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 2004 | "fuzz/oss_fuzz/FuzzPathDeserialize.cpp", |
Kevin Lubick | 2541edf | 2018-01-11 10:27:14 -0500 | [diff] [blame] | 2005 | "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp", |
| 2006 | "fuzz/oss_fuzz/FuzzRegionSetPath.cpp", |
Kevin Lubick | e9c1ce8 | 2019-03-11 11:09:40 -0400 | [diff] [blame] | 2007 | "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp", |
| 2008 | "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp", |
Kevin Lubick | 0f0a710 | 2019-03-18 16:20:55 -0400 | [diff] [blame] | 2009 | "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp", |
Kevin Lubick | e9c1ce8 | 2019-03-11 11:09:40 -0400 | [diff] [blame] | 2010 | "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp", |
Kevin Lubick | f034d11 | 2018-02-08 14:31:24 -0500 | [diff] [blame] | 2011 | "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp", |
Kevin Lubick | 9ff5dc9 | 2018-01-09 12:47:33 -0500 | [diff] [blame] | 2012 | "tools/UrlDataManager.cpp", |
| 2013 | "tools/debugger/SkDebugCanvas.cpp", |
| 2014 | "tools/debugger/SkDrawCommand.cpp", |
| 2015 | "tools/debugger/SkJsonWriteBuffer.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2016 | ] |
| 2017 | deps = [ |
| 2018 | ":flags", |
Hal Canary | 44801ca | 2017-03-15 11:39:06 -0400 | [diff] [blame] | 2019 | ":gpu_tool_utils", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2020 | ":skia", |
Florin Malita | 3d856bd | 2018-05-26 09:49:28 -0400 | [diff] [blame] | 2021 | "modules/skottie:fuzz", |
Kevin Lubick | 9ff5dc9 | 2018-01-09 12:47:33 -0500 | [diff] [blame] | 2022 | "//third_party/libpng", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2023 | ] |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 2024 | } |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2025 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2026 | test_app("pathops_unittest") { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 2027 | sources = pathops_tests_sources + [ |
Mike Klein | 6e55fef | 2016-10-26 11:41:47 -0400 | [diff] [blame] | 2028 | rebase_path("tests/skia_test.cpp"), |
| 2029 | rebase_path("tests/Test.cpp"), |
| 2030 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 2031 | deps = [ |
| 2032 | ":flags", |
| 2033 | ":gpu_tool_utils", |
| 2034 | ":skia", |
| 2035 | ":tool_utils", |
| 2036 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 2037 | } |
| 2038 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2039 | test_app("dump_record") { |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2040 | sources = [ |
| 2041 | "tools/DumpRecord.cpp", |
| 2042 | "tools/dump_record.cpp", |
| 2043 | ] |
| 2044 | deps = [ |
| 2045 | ":flags", |
| 2046 | ":skia", |
| 2047 | ] |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 2048 | } |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2049 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2050 | test_app("skdiff") { |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2051 | sources = [ |
| 2052 | "tools/skdiff/skdiff.cpp", |
| 2053 | "tools/skdiff/skdiff_html.cpp", |
| 2054 | "tools/skdiff/skdiff_main.cpp", |
| 2055 | "tools/skdiff/skdiff_utils.cpp", |
| 2056 | ] |
| 2057 | deps = [ |
| 2058 | ":skia", |
| 2059 | ":tool_utils", |
| 2060 | ] |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 2061 | } |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2062 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 2063 | test_app("skp_parser") { |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2064 | sources = [ |
| 2065 | "tools/skp_parser.cpp", |
| 2066 | ] |
| 2067 | deps = [ |
| 2068 | ":skia", |
| 2069 | ":tool_utils", |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2070 | ] |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 2071 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2072 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2073 | if (!is_win) { |
Hal Canary | d7b3845 | 2017-12-11 17:46:26 -0500 | [diff] [blame] | 2074 | test_lib("skqp_lib") { |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2075 | public_include_dirs = [ "tools/skqp/src" ] |
Hal Canary | 0e07ad7 | 2018-02-08 13:06:56 -0500 | [diff] [blame] | 2076 | defines = |
| 2077 | [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ] |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2078 | sources = [ |
| 2079 | "dm/DMGpuTestProcs.cpp", |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2080 | "tools/skqp/src/skqp.cpp", |
| 2081 | "tools/skqp/src/skqp_model.cpp", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2082 | ] |
| 2083 | deps = [ |
| 2084 | ":gm", |
| 2085 | ":gpu_tool_utils", |
| 2086 | ":skia", |
| 2087 | ":tests", |
Hal Canary | d7b3845 | 2017-12-11 17:46:26 -0500 | [diff] [blame] | 2088 | ":tool_utils", |
| 2089 | ] |
| 2090 | } |
| 2091 | test_app("skqp") { |
| 2092 | sources = [ |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2093 | "tools/skqp/src/skqp_main.cpp", |
Hal Canary | d7b3845 | 2017-12-11 17:46:26 -0500 | [diff] [blame] | 2094 | ] |
| 2095 | deps = [ |
| 2096 | ":skia", |
| 2097 | ":skqp_lib", |
Hal Canary | 537d9c0 | 2018-01-30 11:30:48 -0500 | [diff] [blame] | 2098 | ":tool_utils", |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2099 | ] |
| 2100 | } |
| 2101 | test_app("jitter_gms") { |
| 2102 | sources = [ |
| 2103 | "tools/skqp/jitter_gms.cpp", |
| 2104 | ] |
| 2105 | deps = [ |
| 2106 | ":gm", |
| 2107 | ":skia", |
| 2108 | ":skqp_lib", |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2109 | ] |
| 2110 | } |
| 2111 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2112 | if (is_android) { |
Hal Canary | 28f8938 | 2017-12-12 09:42:14 -0500 | [diff] [blame] | 2113 | test_app("skqp_app") { |
| 2114 | is_shared_library = true |
| 2115 | sources = [ |
Hal Canary | ac7f23c | 2018-11-26 14:07:41 -0500 | [diff] [blame] | 2116 | "tools/skqp/src/jni_skqp.cpp", |
Hal Canary | 28f8938 | 2017-12-12 09:42:14 -0500 | [diff] [blame] | 2117 | ] |
| 2118 | deps = [ |
| 2119 | ":skia", |
| 2120 | ":skqp_lib", |
Hal Canary | b4d01a9 | 2018-01-29 13:10:08 -0500 | [diff] [blame] | 2121 | ":tool_utils", |
Hal Canary | 28f8938 | 2017-12-12 09:42:14 -0500 | [diff] [blame] | 2122 | ] |
| 2123 | libs = [ "android" ] |
| 2124 | } |
| 2125 | } |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2126 | if (is_android && skia_enable_gpu) { |
| 2127 | test_app("skottie_android") { |
| 2128 | is_shared_library = true |
| 2129 | |
| 2130 | sources = [ |
| 2131 | "platform_tools/android/apps/skottie/src/main/cpp/JavaInputStreamAdaptor.cpp", |
| 2132 | "platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp", |
| 2133 | ] |
| 2134 | libs = [] |
| 2135 | |
| 2136 | include_dirs = [] |
| 2137 | deps = [ |
| 2138 | ":skia", |
| 2139 | "modules/skottie", |
Stan Iliev | a7a52b9 | 2018-10-01 15:36:32 -0400 | [diff] [blame] | 2140 | "modules/sksg:samples", |
Stan Iliev | 9315172 | 2018-08-02 11:10:52 -0400 | [diff] [blame] | 2141 | ] |
| 2142 | } |
| 2143 | } |
Hal Canary | 7542713 | 2017-10-11 16:00:31 -0400 | [diff] [blame] | 2144 | |
Hal Canary | a9de760 | 2018-01-19 13:08:23 -0500 | [diff] [blame] | 2145 | test_app("list_gms") { |
| 2146 | sources = [ |
| 2147 | "tools/list_gms.cpp", |
| 2148 | ] |
| 2149 | deps = [ |
| 2150 | ":gm", |
| 2151 | ":skia", |
| 2152 | ] |
| 2153 | } |
| 2154 | test_app("list_gpu_unit_tests") { |
| 2155 | sources = [ |
| 2156 | "dm/DMGpuTestProcs.cpp", |
| 2157 | "tools/list_gpu_unit_tests.cpp", |
| 2158 | ] |
| 2159 | deps = [ |
| 2160 | ":skia", |
| 2161 | ":tests", |
| 2162 | ] |
| 2163 | } |
| 2164 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2165 | test_lib("sk_app") { |
| 2166 | public_include_dirs = [ "tools/sk_app" ] |
| 2167 | sources = [ |
| 2168 | "tools/sk_app/CommandSet.cpp", |
| 2169 | "tools/sk_app/GLWindowContext.cpp", |
| 2170 | "tools/sk_app/Window.cpp", |
| 2171 | ] |
| 2172 | libs = [] |
| 2173 | |
| 2174 | if (is_android) { |
| 2175 | sources += [ |
| 2176 | "tools/sk_app/android/GLWindowContext_android.cpp", |
| 2177 | "tools/sk_app/android/RasterWindowContext_android.cpp", |
| 2178 | "tools/sk_app/android/Window_android.cpp", |
| 2179 | "tools/sk_app/android/main_android.cpp", |
| 2180 | "tools/sk_app/android/surface_glue_android.cpp", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2181 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2182 | libs += [ "android" ] |
| 2183 | } else if (is_linux) { |
| 2184 | sources += [ |
| 2185 | "tools/sk_app/unix/GLWindowContext_unix.cpp", |
| 2186 | "tools/sk_app/unix/RasterWindowContext_unix.cpp", |
| 2187 | "tools/sk_app/unix/Window_unix.cpp", |
| 2188 | "tools/sk_app/unix/keysym2ucs.c", |
| 2189 | "tools/sk_app/unix/main_unix.cpp", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2190 | ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2191 | libs += [ |
| 2192 | "GL", |
| 2193 | "X11", |
| 2194 | ] |
| 2195 | } else if (is_win) { |
| 2196 | sources += [ |
| 2197 | "tools/sk_app/win/GLWindowContext_win.cpp", |
| 2198 | "tools/sk_app/win/RasterWindowContext_win.cpp", |
| 2199 | "tools/sk_app/win/Window_win.cpp", |
| 2200 | "tools/sk_app/win/main_win.cpp", |
| 2201 | ] |
Brian Salomon | 194db17 | 2017-08-17 14:37:06 -0400 | [diff] [blame] | 2202 | if (skia_use_angle) { |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2203 | sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ] |
Brian Salomon | 194db17 | 2017-08-17 14:37:06 -0400 | [diff] [blame] | 2204 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2205 | } else if (is_mac) { |
| 2206 | sources += [ |
Jim Van Verth | 1f086ca | 2019-01-28 14:46:04 -0500 | [diff] [blame] | 2207 | "tools/sk_app/mac/GLWindowContext_mac.mm", |
| 2208 | "tools/sk_app/mac/RasterWindowContext_mac.mm", |
| 2209 | "tools/sk_app/mac/Window_mac.mm", |
| 2210 | "tools/sk_app/mac/main_mac.mm", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2211 | ] |
| 2212 | libs += [ |
| 2213 | "QuartzCore.framework", |
| 2214 | "Cocoa.framework", |
| 2215 | "Foundation.framework", |
| 2216 | ] |
| 2217 | } else if (is_ios) { |
| 2218 | sources += [ |
| 2219 | "tools/sk_app/ios/GLWindowContext_ios.cpp", |
| 2220 | "tools/sk_app/ios/RasterWindowContext_ios.cpp", |
| 2221 | "tools/sk_app/ios/Window_ios.cpp", |
| 2222 | "tools/sk_app/ios/main_ios.cpp", |
| 2223 | ] |
| 2224 | } |
| 2225 | |
| 2226 | if (skia_use_vulkan) { |
| 2227 | sources += [ "tools/sk_app/VulkanWindowContext.cpp" ] |
| 2228 | if (is_android) { |
| 2229 | sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ] |
| 2230 | } else if (is_linux) { |
| 2231 | sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ] |
| 2232 | libs += [ "X11-xcb" ] |
| 2233 | } else if (is_win) { |
| 2234 | sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ] |
Jim Van Verth | ce51c14 | 2019-02-14 14:07:46 -0500 | [diff] [blame] | 2235 | } else if (is_mac) { |
| 2236 | sources += [ "tools/sk_app/mac/VulkanWindowContext_mac.mm" ] |
| 2237 | libs += [ "MetalKit.framework" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2238 | } |
| 2239 | } |
| 2240 | |
Jim Van Verth | be39f71 | 2019-02-08 15:36:14 -0500 | [diff] [blame] | 2241 | if (skia_use_metal) { |
| 2242 | sources += [ "tools/sk_app/MetalWindowContext.mm" ] |
| 2243 | if (is_mac) { |
| 2244 | sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ] |
| 2245 | } |
| 2246 | libs += [ "MetalKit.framework" ] |
| 2247 | } |
| 2248 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2249 | deps = [ |
| 2250 | ":gpu_tool_utils", |
| 2251 | ":skia", |
| 2252 | ":tool_utils", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2253 | ] |
| 2254 | if (is_android) { |
| 2255 | deps += [ "//third_party/native_app_glue" ] |
Jim Van Verth | 1f086ca | 2019-01-28 14:46:04 -0500 | [diff] [blame] | 2256 | } else if (is_ios) { |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2257 | deps += [ "//third_party/libsdl" ] |
| 2258 | } |
| 2259 | if (skia_use_angle) { |
| 2260 | deps += [ "//third_party/angle2" ] |
Mike Klein | a92c383 | 2016-12-08 09:49:39 -0500 | [diff] [blame] | 2261 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 2262 | } |
Ethan Nicholas | 4f3985c | 2016-11-14 11:16:37 -0500 | [diff] [blame] | 2263 | |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2264 | import("gn/examples.gni") |
| 2265 | if (!skia_use_vulkan && (is_mac || is_linux || is_win)) { |
| 2266 | test_app("fiddle_examples") { |
| 2267 | sources = [ |
| 2268 | "tools/fiddle/examples.cpp", |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2269 | "tools/fiddle/examples.h", |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2270 | ] |
| 2271 | sources += examples_sources |
| 2272 | include_dirs = [ "tools" ] |
Brian Osman | 72ef2d5 | 2019-03-17 11:09:17 -0400 | [diff] [blame] | 2273 | if (is_win) { |
| 2274 | cflags = [ "/wd4756" ] # Overflow in constant arithmetic |
| 2275 | } |
Hal Canary | 8751512 | 2019-03-15 14:22:51 -0400 | [diff] [blame] | 2276 | deps = [ |
| 2277 | ":skia", |
| 2278 | ":skia.h", |
| 2279 | "modules/skottie", |
| 2280 | ] |
| 2281 | } |
| 2282 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2283 | test_app("viewer") { |
| 2284 | is_shared_library = is_android |
| 2285 | if (is_ios) { |
| 2286 | bundle_ios_data = true |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2287 | } |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2288 | sources = [ |
| 2289 | "tools/viewer/BisectSlide.cpp", |
| 2290 | "tools/viewer/GMSlide.cpp", |
| 2291 | "tools/viewer/ImGuiLayer.cpp", |
| 2292 | "tools/viewer/ImageSlide.cpp", |
Brian Osman | 7c979f5 | 2019-02-12 13:27:51 -0500 | [diff] [blame] | 2293 | "tools/viewer/ParticlesSlide.cpp", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2294 | "tools/viewer/SKPSlide.cpp", |
| 2295 | "tools/viewer/SampleSlide.cpp", |
| 2296 | "tools/viewer/SkottieSlide.cpp", |
| 2297 | "tools/viewer/SlideDir.cpp", |
| 2298 | "tools/viewer/StatsLayer.cpp", |
| 2299 | "tools/viewer/SvgSlide.cpp", |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 2300 | "tools/viewer/TouchGesture.cpp", |
Leon Scroggins III | 81886e8 | 2018-08-22 11:18:08 -0400 | [diff] [blame] | 2301 | "tools/viewer/TouchGesture.h", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2302 | "tools/viewer/Viewer.cpp", |
| 2303 | ] |
| 2304 | libs = [] |
| 2305 | |
Kevin Lubick | d969932 | 2018-10-30 15:08:53 -0400 | [diff] [blame] | 2306 | include_dirs = [ "experimental" ] |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2307 | deps = [ |
| 2308 | ":experimental_svg_model", |
| 2309 | ":flags", |
| 2310 | ":gm", |
| 2311 | ":gpu_tool_utils", |
| 2312 | ":samples", |
| 2313 | ":sk_app", |
| 2314 | ":skia", |
| 2315 | ":tool_utils", |
Brian Osman | 7c979f5 | 2019-02-12 13:27:51 -0500 | [diff] [blame] | 2316 | "modules/particles", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2317 | "modules/skottie", |
Florin Malita | a831655 | 2018-11-09 16:19:44 -0500 | [diff] [blame] | 2318 | "modules/skottie:utils", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2319 | "modules/sksg", |
Ben Wagner | b2c4ea6 | 2018-08-08 11:36:17 -0400 | [diff] [blame] | 2320 | "modules/sksg:samples", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2321 | "//third_party/imgui", |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2322 | ] |
Ruiqi Mao | f510149 | 2018-06-29 14:32:21 -0400 | [diff] [blame] | 2323 | |
| 2324 | # NIMA does not build on Windows clang |
| 2325 | if (!is_win || !is_clang) { |
| 2326 | sources += [ "tools/viewer/NIMASlide.cpp" ] |
| 2327 | deps += [ "//third_party/Nima-Cpp" ] |
| 2328 | } |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2329 | } |
| 2330 | |
ziadb | bceddbc | 2018-06-19 13:57:15 -0400 | [diff] [blame] | 2331 | if (is_android) { |
| 2332 | test_app("arcore") { |
| 2333 | is_shared_library = true |
| 2334 | configs = [ |
| 2335 | ":skia_public", |
| 2336 | "gn:default", |
| 2337 | ] |
| 2338 | |
| 2339 | # For internship expedience, yes, we're rebuilding Skia rather than depending on :skia. |
| 2340 | # At the moment there's no way to use Skia and Skottie/SkShaper unless they're in the same .so. |
Hal Canary | c25f4e9 | 2019-02-26 11:54:25 -0500 | [diff] [blame] | 2341 | public = skia_core_public |
| 2342 | public += skia_utils_public |
ziadb | bceddbc | 2018-06-19 13:57:15 -0400 | [diff] [blame] | 2343 | sources = [] |
| 2344 | sources += skia_core_sources |
| 2345 | sources += skia_utils_sources |
| 2346 | sources += skia_xps_sources |
| 2347 | sources += [ |
| 2348 | "src/android/SkAndroidFrameworkUtils.cpp", |
| 2349 | "src/android/SkAnimatedImage.cpp", |
| 2350 | "src/android/SkBitmapRegionCodec.cpp", |
| 2351 | "src/android/SkBitmapRegionDecoder.cpp", |
| 2352 | "src/codec/SkAndroidCodec.cpp", |
| 2353 | "src/codec/SkBmpBaseCodec.cpp", |
| 2354 | "src/codec/SkBmpCodec.cpp", |
| 2355 | "src/codec/SkBmpMaskCodec.cpp", |
| 2356 | "src/codec/SkBmpRLECodec.cpp", |
| 2357 | "src/codec/SkBmpStandardCodec.cpp", |
| 2358 | "src/codec/SkCodec.cpp", |
| 2359 | "src/codec/SkCodecImageGenerator.cpp", |
| 2360 | "src/codec/SkColorTable.cpp", |
| 2361 | "src/codec/SkGifCodec.cpp", |
| 2362 | "src/codec/SkMaskSwizzler.cpp", |
| 2363 | "src/codec/SkMasks.cpp", |
| 2364 | "src/codec/SkSampledCodec.cpp", |
| 2365 | "src/codec/SkSampler.cpp", |
| 2366 | "src/codec/SkStreamBuffer.cpp", |
| 2367 | "src/codec/SkSwizzler.cpp", |
| 2368 | "src/codec/SkWbmpCodec.cpp", |
| 2369 | "src/images/SkImageEncoder.cpp", |
| 2370 | "src/ports/SkDiscardableMemory_none.cpp", |
| 2371 | "src/ports/SkImageGenerator_skia.cpp", |
| 2372 | "src/ports/SkMemory_malloc.cpp", |
| 2373 | "src/ports/SkOSFile_stdio.cpp", |
| 2374 | "src/sfnt/SkOTTable_name.cpp", |
| 2375 | "src/sfnt/SkOTUtils.cpp", |
| 2376 | "src/utils/mac/SkStream_mac.cpp", |
Jim Van Verth | 1676cb9 | 2019-01-15 13:24:45 -0500 | [diff] [blame] | 2377 | "third_party/etc1/etc1.cpp", |
ziadb | bceddbc | 2018-06-19 13:57:15 -0400 | [diff] [blame] | 2378 | "third_party/gif/SkGifImageReader.cpp", |
| 2379 | ] |
| 2380 | deps = [ |
| 2381 | ":tool_utils", |
| 2382 | "modules/skottie", |
| 2383 | "modules/skshaper", |
| 2384 | ] |
| 2385 | } |
| 2386 | } |
| 2387 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2388 | if (!skia_use_angle && (is_linux || is_win || is_mac)) { |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2389 | test_app("HelloWorld") { |
| 2390 | sources = [ |
| 2391 | "example/HelloWorld.cpp", |
| 2392 | ] |
| 2393 | libs = [] |
| 2394 | |
| 2395 | include_dirs = [] |
| 2396 | deps = [ |
| 2397 | ":flags", |
| 2398 | ":gpu_tool_utils", |
| 2399 | ":sk_app", |
| 2400 | ":skia", |
| 2401 | ":tool_utils", |
Brian Osman | eff04b5 | 2017-11-21 13:18:02 -0500 | [diff] [blame] | 2402 | ] |
| 2403 | } |
| 2404 | } |
| 2405 | |
Brian Osman | c9a4247 | 2018-05-31 13:17:12 -0400 | [diff] [blame] | 2406 | if (is_linux || is_mac || is_ios) { |
Jim Van Verth | 4c70c75 | 2017-07-11 12:03:01 -0400 | [diff] [blame] | 2407 | test_app("SkiaSDLExample") { |
| 2408 | sources = [ |
| 2409 | "example/SkiaSDLExample.cpp", |
| 2410 | ] |
| 2411 | libs = [] |
| 2412 | include_dirs = [] |
| 2413 | deps = [ |
| 2414 | ":gpu_tool_utils", |
| 2415 | ":skia", |
| 2416 | "//third_party/libsdl", |
| 2417 | ] |
| 2418 | } |
| 2419 | } |
| 2420 | |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2421 | if (skia_qt_path != "" && (is_win || is_linux || is_mac)) { |
| 2422 | action_foreach("generate_mocs") { |
| 2423 | script = "gn/call.py" |
| 2424 | sources = [ |
| 2425 | "tools/mdbviz/MainWindow.h", |
| 2426 | ] |
| 2427 | outputs = [ |
| 2428 | "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp", |
| 2429 | ] |
| 2430 | args = [ |
| 2431 | "$skia_qt_path" + "/bin/moc", |
| 2432 | "{{source}}", |
| 2433 | "-o", |
| 2434 | "gen/mdbviz/{{source_name_part}}_moc.cpp", |
| 2435 | ] |
| 2436 | } |
| 2437 | action_foreach("generate_resources") { |
| 2438 | script = "gn/call.py" |
| 2439 | sources = [ |
| 2440 | "tools/mdbviz/resources.qrc", |
| 2441 | ] |
| 2442 | outputs = [ |
| 2443 | "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp", |
| 2444 | ] |
| 2445 | args = [ |
| 2446 | "$skia_qt_path" + "/bin/rcc", |
| 2447 | "{{source}}", |
| 2448 | "-o", |
| 2449 | "gen/mdbviz/{{source_name_part}}_res.cpp", |
| 2450 | ] |
| 2451 | } |
| 2452 | test_app("mdbviz") { |
| 2453 | if (is_win) { |
| 2454 | # on Windows we need to disable some exception handling warnings due to the Qt headers |
| 2455 | cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017 |
| 2456 | } |
| 2457 | sources = [ |
Robert Phillips | 5fccf9d | 2017-09-05 15:10:12 -0400 | [diff] [blame] | 2458 | "tools/UrlDataManager.cpp", |
| 2459 | "tools/debugger/SkDebugCanvas.cpp", |
| 2460 | "tools/debugger/SkDrawCommand.cpp", |
| 2461 | "tools/debugger/SkJsonWriteBuffer.cpp", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2462 | "tools/mdbviz/MainWindow.cpp", |
Robert Phillips | deaf568 | 2017-09-06 13:07:21 -0400 | [diff] [blame] | 2463 | "tools/mdbviz/Model.cpp", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2464 | "tools/mdbviz/main.cpp", |
| 2465 | |
| 2466 | # generated files |
| 2467 | "$target_gen_dir/mdbviz/MainWindow_moc.cpp", |
| 2468 | "$target_gen_dir/mdbviz/resources_res.cpp", |
| 2469 | ] |
| 2470 | lib_dirs = [ "$skia_qt_path/lib" ] |
| 2471 | libs = [ |
| 2472 | "Qt5Core.lib", |
| 2473 | "Qt5Gui.lib", |
| 2474 | "Qt5Widgets.lib", |
| 2475 | ] |
| 2476 | include_dirs = [ |
| 2477 | "$skia_qt_path/include", |
Robert Phillips | 276066b | 2017-09-06 17:17:44 -0400 | [diff] [blame] | 2478 | "$skia_qt_path/include/QtCore", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2479 | "$skia_qt_path/include/QtWidgets", |
Robert Phillips | 5fccf9d | 2017-09-05 15:10:12 -0400 | [diff] [blame] | 2480 | "tools", |
| 2481 | "tools/debugger", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2482 | ] |
| 2483 | deps = [ |
| 2484 | ":generate_mocs", |
| 2485 | ":generate_resources", |
| 2486 | ":skia", |
Robert Phillips | 5fccf9d | 2017-09-05 15:10:12 -0400 | [diff] [blame] | 2487 | "//third_party/libpng", |
Robert Phillips | a6d2d70 | 2017-09-01 12:17:03 -0400 | [diff] [blame] | 2488 | ] |
| 2489 | } |
| 2490 | } |
| 2491 | |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 2492 | if (is_android && defined(ndk) && ndk != "") { |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2493 | copy("gdbserver") { |
| 2494 | sources = [ |
| 2495 | "$ndk/$ndk_gdbserver", |
| 2496 | ] |
| 2497 | outputs = [ |
| 2498 | "$root_out_dir/gdbserver", |
| 2499 | ] |
| 2500 | } |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 2501 | } |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 2502 | |
| 2503 | if (skia_use_opencl) { |
| 2504 | test_app("hello-opencl") { |
| 2505 | sources = [ |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 2506 | "tools/hello-opencl.cpp", |
| 2507 | ] |
Mike Klein | 8a1f15d | 2019-02-11 11:59:41 -0500 | [diff] [blame] | 2508 | deps = [ |
| 2509 | "//third_party/opencl", |
| 2510 | ] |
Mike Klein | f9ae670 | 2018-06-20 14:05:05 -0400 | [diff] [blame] | 2511 | } |
| 2512 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 2513 | } |