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