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