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