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