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