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