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