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