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