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