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