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