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