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