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