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