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