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