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