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