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