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