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