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