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