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