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