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