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