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