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