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