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