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 | |
Mike Klein | cfc4f44 | 2016-10-26 17:19:03 -0400 | [diff] [blame] | 6 | import("gn/android_framework_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 | |
Mike Klein | 3669a82 | 2017-03-03 10:55:02 -0500 | [diff] [blame] | 9 | if (!defined(is_skia_standalone)) { |
| 10 | is_skia_standalone = false |
| 11 | } |
| 12 | is_skia_dev_build = is_skia_standalone && !is_official_build |
| 13 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 14 | declare_args() { |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 15 | skia_use_angle = false |
Kevin Lubick | 4a24e10 | 2017-03-29 11:19:01 -0400 | [diff] [blame] | 16 | skia_use_egl = false |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 17 | skia_use_expat = true |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 18 | skia_use_fontconfig = is_linux |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 19 | skia_use_freetype = is_android || is_fuchsia || is_linux |
Mike Klein | 69f6ed4 | 2016-10-13 15:45:07 -0400 | [diff] [blame] | 20 | skia_use_gdi = false |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 21 | skia_use_icu = !is_fuchsia && !is_ios && !is_win # TODO: Windows |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 22 | skia_use_libjpeg_turbo = true |
| 23 | skia_use_libpng = true |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 24 | skia_use_libwebp = !is_fuchsia |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 25 | skia_use_lua = false |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 26 | skia_use_mesa = false |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 27 | skia_use_piex = !is_win |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 28 | skia_use_zlib = true |
mtklein | 1bd72ba | 2016-09-16 07:45:52 -0700 | [diff] [blame] | 29 | |
Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame] | 30 | skia_android_serial = "" |
mtklein | 1bd72ba | 2016-09-16 07:45:52 -0700 | [diff] [blame] | 31 | skia_enable_android_framework_defines = false |
Brian Osman | 3f375d0 | 2016-12-28 11:19:22 -0500 | [diff] [blame] | 32 | skia_enable_discrete_gpu = true |
Mike Klein | a04bb45 | 2017-02-09 12:24:07 -0500 | [diff] [blame] | 33 | skia_enable_effects = true |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 34 | skia_enable_gpu = true |
Hal Canary | 43fb7a0 | 2016-12-30 13:09:03 -0500 | [diff] [blame] | 35 | skia_enable_pdf = true |
Ethan Nicholas | a6ae1f7 | 2017-03-16 09:56:54 -0400 | [diff] [blame] | 36 | skia_enable_spirv_validation = is_skia_dev_build && is_debug |
Mike Klein | 3669a82 | 2017-03-03 10:55:02 -0500 | [diff] [blame] | 37 | skia_enable_tools = is_skia_dev_build |
| 38 | skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug |
Greg Daniel | 686bb21 | 2016-10-27 10:48:48 -0400 | [diff] [blame] | 39 | skia_vulkan_sdk = getenv("VULKAN_SDK") |
Michael Jurka | da3e596 | 2017-04-14 17:44:09 -0700 | [diff] [blame] | 40 | skia_link_with_vulkan = !is_fuchsia |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 41 | } |
Brian Salomon | 23d73ea | 2016-10-27 13:31:37 -0400 | [diff] [blame] | 42 | declare_args() { |
Matt Sarett | 189491c | 2017-03-20 18:09:30 -0400 | [diff] [blame] | 43 | 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] | 44 | skia_use_sfntly = skia_use_icu |
| 45 | |
Mike Klein | 4d598a3 | 2016-10-31 13:44:49 -0400 | [diff] [blame] | 46 | if (is_android) { |
| 47 | skia_use_vulkan = defined(ndk_api) && ndk_api >= 24 |
| 48 | } else { |
| 49 | skia_use_vulkan = skia_vulkan_sdk != "" |
| 50 | } |
Michael Jurka | 3251ed8 | 2017-04-05 09:52:55 -0700 | [diff] [blame] | 51 | if (is_win) { |
| 52 | skia_vulkan_headers_path = "$skia_vulkan_sdk/Include" |
| 53 | } else { |
| 54 | skia_vulkan_headers_path = "$skia_vulkan_sdk/include" |
| 55 | } |
Brian Salomon | 23d73ea | 2016-10-27 13:31:37 -0400 | [diff] [blame] | 56 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 57 | |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 58 | # Our tools require static linking (they use non-exported symbols). |
| 59 | skia_enable_tools = skia_enable_tools && !is_component_build |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 60 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 61 | fontmgr_android_enabled = skia_use_expat && skia_use_freetype |
| 62 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 63 | skia_public_includes = [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 64 | "include/android", |
mtklein | fa84d94 | 2016-07-28 09:45:14 -0700 | [diff] [blame] | 65 | "include/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 66 | "include/codec", |
| 67 | "include/config", |
| 68 | "include/core", |
| 69 | "include/effects", |
| 70 | "include/gpu", |
| 71 | "include/gpu/gl", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 72 | "include/pathops", |
| 73 | "include/ports", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 74 | "include/svg", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 75 | "include/utils", |
| 76 | "include/utils/mac", |
Greg Daniel | 50130e4 | 2017-04-12 13:29:50 -0400 | [diff] [blame] | 77 | skia_vulkan_headers_path, |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 78 | ] |
| 79 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 80 | # Skia public API, generally provided by :skia. |
| 81 | config("skia_public") { |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 82 | include_dirs = skia_public_includes |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 83 | defines = [] |
| 84 | if (is_component_build) { |
| 85 | defines += [ "SKIA_DLL" ] |
| 86 | } |
Mike Klein | c4cbd74 | 2016-09-26 21:37:09 -0400 | [diff] [blame] | 87 | if (is_fuchsia || is_linux) { |
jcgregorio | 5561e3d | 2016-08-25 09:25:11 -0700 | [diff] [blame] | 88 | defines += [ "SK_SAMPLES_FOR_X" ] |
| 89 | } |
mtklein | cae1be5 | 2016-09-20 08:24:34 -0700 | [diff] [blame] | 90 | if (skia_enable_android_framework_defines) { |
Mike Klein | cfc4f44 | 2016-10-26 17:19:03 -0400 | [diff] [blame] | 91 | defines += android_framework_defines |
mtklein | cae1be5 | 2016-09-20 08:24:34 -0700 | [diff] [blame] | 92 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 93 | if (!skia_enable_gpu) { |
| 94 | defines += [ "SK_SUPPORT_GPU=0" ] |
| 95 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | # Skia internal APIs, used by Skia itself and a few test tools. |
| 99 | config("skia_private") { |
| 100 | visibility = [ ":*" ] |
| 101 | |
| 102 | include_dirs = [ |
| 103 | "include/private", |
| 104 | "src/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 105 | "src/codec", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 106 | "src/core", |
| 107 | "src/effects", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 108 | "src/effects/gradients", |
| 109 | "src/fonts", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 110 | "src/image", |
| 111 | "src/images", |
| 112 | "src/lazy", |
| 113 | "src/opts", |
| 114 | "src/pathops", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 115 | "src/pdf", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 116 | "src/ports", |
| 117 | "src/sfnt", |
mtklein | 9e0d9dd | 2016-08-30 10:37:19 -0700 | [diff] [blame] | 118 | "src/sksl", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 119 | "src/utils", |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 120 | "src/utils/win", |
Herb Derby | 5a8fe97 | 2017-02-14 14:42:30 -0500 | [diff] [blame] | 121 | "src/xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 122 | "third_party/etc1", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 123 | "third_party/gif", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 124 | ] |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 125 | |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 126 | defines = [ |
| 127 | "SK_GAMMA_APPLY_TO_A8", |
| 128 | "SK_INTERNAL", |
| 129 | ] |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 130 | if (is_android) { |
| 131 | defines += [ |
| 132 | "SK_GAMMA_EXPONENT=1.4", |
| 133 | "SK_GAMMA_CONTRAST=0.0", |
| 134 | ] |
| 135 | } |
mtklein | 88a7ac0 | 2016-09-14 11:16:49 -0700 | [diff] [blame] | 136 | if (is_official_build || is_android) { |
| 137 | # TODO(bsalomon): it'd be nice to make Android normal. |
| 138 | defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ] |
| 139 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 140 | libs = [] |
| 141 | lib_dirs = [] |
| 142 | if (skia_use_vulkan) { |
Michael Jurka | da3e596 | 2017-04-14 17:44:09 -0700 | [diff] [blame] | 143 | if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) { |
Mike Klein | 487bfc2 | 2016-10-14 14:04:56 -0400 | [diff] [blame] | 144 | if (is_win) { |
Brian Salomon | 3b5bf35 | 2017-03-20 15:54:41 -0400 | [diff] [blame] | 145 | lib_dirs += [ |
| 146 | "$skia_vulkan_sdk/Bin", |
| 147 | "$skia_vulkan_sdk/Lib", |
| 148 | ] |
Mike Klein | 487bfc2 | 2016-10-14 14:04:56 -0400 | [diff] [blame] | 149 | } else { |
Greg Daniel | 686bb21 | 2016-10-27 10:48:48 -0400 | [diff] [blame] | 150 | lib_dirs += [ "$skia_vulkan_sdk/lib/" ] |
Mike Klein | 487bfc2 | 2016-10-14 14:04:56 -0400 | [diff] [blame] | 151 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 152 | } |
Michael Jurka | 3251ed8 | 2017-04-05 09:52:55 -0700 | [diff] [blame] | 153 | |
| 154 | if (skia_link_with_vulkan) { |
| 155 | defines += [ "SK_LINK_WITH_VULKAN" ] |
| 156 | if (is_win) { |
| 157 | libs += [ "vulkan-1.lib" ] |
| 158 | } else { |
| 159 | libs += [ "vulkan" ] |
| 160 | } |
Mike Klein | 487bfc2 | 2016-10-14 14:04:56 -0400 | [diff] [blame] | 161 | } |
Brian Salomon | 789e25e | 2016-09-30 13:41:03 -0400 | [diff] [blame] | 162 | } |
Brian Salomon | 03e0584 | 2017-02-23 12:23:47 -0500 | [diff] [blame] | 163 | if (skia_enable_gpu) { |
| 164 | include_dirs += [ "src/gpu" ] |
| 165 | } |
Brian Osman | 34755e2 | 2016-12-05 09:46:02 -0500 | [diff] [blame] | 166 | if (skia_use_angle) { |
| 167 | defines += [ "SK_ANGLE" ] |
| 168 | } |
Brian Osman | 3f375d0 | 2016-12-28 11:19:22 -0500 | [diff] [blame] | 169 | if (skia_enable_discrete_gpu) { |
| 170 | defines += [ "SK_ENABLE_DISCRETE_GPU" ] |
| 171 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 175 | config("skia_library") { |
| 176 | visibility = [ ":*" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 177 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
| 178 | } |
| 179 | |
| 180 | skia_library_configs = [ |
| 181 | ":skia_public", |
| 182 | ":skia_private", |
| 183 | ":skia_library", |
| 184 | ] |
| 185 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 186 | # Use for CPU-specific Skia code that needs particular compiler flags. |
| 187 | template("opts") { |
| 188 | if (invoker.enabled) { |
| 189 | source_set(target_name) { |
| 190 | forward_variables_from(invoker, "*") |
| 191 | configs += skia_library_configs |
| 192 | } |
| 193 | } else { |
| 194 | # If not enabled, a phony empty target that swallows all otherwise unused variables. |
| 195 | source_set(target_name) { |
| 196 | forward_variables_from(invoker, |
| 197 | "*", |
| 198 | [ |
| 199 | "sources", |
| 200 | "cflags", |
| 201 | ]) |
| 202 | } |
| 203 | } |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 204 | } |
| 205 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 206 | is_x86 = current_cpu == "x64" || current_cpu == "x86" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 207 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 208 | opts("none") { |
| 209 | enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 210 | sources = skia_opts.none_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 211 | cflags = [] |
| 212 | } |
| 213 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 214 | opts("armv7") { |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 215 | enabled = current_cpu == "arm" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 216 | sources = skia_opts.armv7_sources + skia_opts.neon_sources |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 217 | cflags = [] |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | opts("arm64") { |
| 221 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 222 | sources = skia_opts.arm64_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 223 | cflags = [] |
| 224 | } |
| 225 | |
| 226 | opts("crc32") { |
| 227 | enabled = current_cpu == "arm64" |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 228 | sources = skia_opts.crc32_sources |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 229 | cflags = [ "-march=armv8-a+crc" ] |
| 230 | } |
| 231 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 232 | opts("sse2") { |
| 233 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 234 | sources = skia_opts.sse2_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 235 | if (is_win) { |
| 236 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ] |
| 237 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 238 | cflags = [ "-msse2" ] |
| 239 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 240 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 241 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 242 | opts("ssse3") { |
| 243 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 244 | sources = skia_opts.ssse3_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 245 | if (is_win) { |
| 246 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ] |
| 247 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 248 | cflags = [ "-mssse3" ] |
| 249 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 250 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 251 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 252 | opts("sse41") { |
| 253 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 254 | sources = skia_opts.sse41_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 255 | if (is_win) { |
| 256 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ] |
| 257 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 258 | cflags = [ "-msse4.1" ] |
| 259 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 260 | } |
mtklein | 4e97607 | 2016-08-08 09:06:27 -0700 | [diff] [blame] | 261 | |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 262 | opts("sse42") { |
| 263 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 264 | sources = skia_opts.sse42_sources |
Mike Klein | d8765e3 | 2016-10-19 13:39:13 -0400 | [diff] [blame] | 265 | if (is_win) { |
| 266 | defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ] |
| 267 | } else { |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 268 | cflags = [ "-msse4.2" ] |
| 269 | } |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 270 | } |
| 271 | |
| 272 | opts("avx") { |
| 273 | enabled = is_x86 |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 274 | sources = skia_opts.avx_sources |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 275 | if (is_win) { |
Mike Klein | 17b6e48 | 2016-11-18 22:11:41 +0000 | [diff] [blame] | 276 | cflags = [ "/arch:AVX" ] |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 277 | } else { |
| 278 | cflags = [ "-mavx" ] |
| 279 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 280 | } |
| 281 | |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 282 | opts("hsw") { |
| 283 | enabled = is_x86 |
| 284 | sources = skia_opts.hsw_sources |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 285 | if (is_win) { |
Mike Klein | 17b6e48 | 2016-11-18 22:11:41 +0000 | [diff] [blame] | 286 | cflags = [ "/arch:AVX2" ] |
Mike Klein | 3eb7121 | 2016-10-11 17:08:53 -0400 | [diff] [blame] | 287 | } else { |
| 288 | cflags = [ |
| 289 | "-mavx2", |
| 290 | "-mbmi", |
| 291 | "-mbmi2", |
| 292 | "-mf16c", |
| 293 | "-mfma", |
| 294 | ] |
| 295 | } |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 296 | } |
| 297 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 298 | # 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] | 299 | template("optional") { |
| 300 | if (invoker.enabled) { |
| 301 | config(target_name + "_public") { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 302 | if (defined(invoker.public_defines)) { |
| 303 | defines = invoker.public_defines |
| 304 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 305 | } |
| 306 | source_set(target_name) { |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 307 | forward_variables_from(invoker, |
| 308 | "*", |
| 309 | [ |
| 310 | "public_defines", |
| 311 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 312 | "configs_to_remove", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 313 | ]) |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 314 | all_dependent_configs = [ ":" + target_name + "_public" ] |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 315 | configs += skia_library_configs |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 316 | if (defined(invoker.configs_to_remove)) { |
| 317 | configs -= invoker.configs_to_remove |
| 318 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 319 | } |
| 320 | } else { |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 321 | source_set(target_name) { |
| 322 | forward_variables_from(invoker, |
| 323 | "*", |
| 324 | [ |
| 325 | "public_defines", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 326 | "deps", |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 327 | "libs", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 328 | "sources", |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 329 | "sources_when_disabled", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 330 | "configs_to_remove", |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 331 | ]) |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 332 | if (defined(invoker.sources_when_disabled)) { |
| 333 | sources = invoker.sources_when_disabled |
| 334 | } |
| 335 | configs += skia_library_configs |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 336 | } |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 337 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 338 | } |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 339 | |
Mike Klein | a04bb45 | 2017-02-09 12:24:07 -0500 | [diff] [blame] | 340 | optional("effects") { |
| 341 | enabled = skia_enable_effects |
| 342 | sources = |
| 343 | skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ] |
| 344 | sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ] |
| 345 | } |
| 346 | |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 347 | optional("fontmgr_android") { |
| 348 | enabled = fontmgr_android_enabled |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 349 | |
| 350 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 351 | ":typeface_freetype", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 352 | "//third_party/expat", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 353 | ] |
| 354 | sources = [ |
| 355 | "src/ports/SkFontMgr_android.cpp", |
| 356 | "src/ports/SkFontMgr_android_factory.cpp", |
| 357 | "src/ports/SkFontMgr_android_parser.cpp", |
| 358 | ] |
| 359 | } |
| 360 | |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 361 | optional("fontmgr_custom") { |
| 362 | enabled = is_linux && skia_use_freetype && !skia_use_fontconfig |
| 363 | |
| 364 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 365 | ":typeface_freetype", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 366 | ] |
| 367 | sources = [ |
| 368 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 369 | "src/ports/SkFontMgr_custom.h", |
| 370 | "src/ports/SkFontMgr_custom_directory.cpp", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 371 | "src/ports/SkFontMgr_custom_directory_factory.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 372 | "src/ports/SkFontMgr_custom_embedded.cpp", |
| 373 | "src/ports/SkFontMgr_custom_empty.cpp", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 374 | ] |
| 375 | } |
| 376 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 377 | optional("fontmgr_fontconfig") { |
| 378 | enabled = skia_use_freetype && skia_use_fontconfig |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 379 | |
| 380 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 381 | ":typeface_freetype", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 382 | "//third_party:fontconfig", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 383 | ] |
| 384 | sources = [ |
bungeman | 1ae0e01 | 2016-09-19 12:13:16 -0700 | [diff] [blame] | 385 | "src/ports/SkFontConfigInterface.cpp", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 386 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 387 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 388 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
| 389 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 390 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
| 391 | ] |
| 392 | } |
| 393 | |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 394 | optional("fontmgr_fuchsia") { |
| 395 | enabled = is_fuchsia && skia_use_freetype |
| 396 | |
| 397 | deps = [ |
Ben Wagner | fc49734 | 2017-02-24 11:15:26 -0500 | [diff] [blame] | 398 | ":typeface_freetype", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 399 | ] |
| 400 | sources = [ |
| 401 | "src/ports/SkFontMgr_custom.cpp", |
Ben Wagner | 8ab590f | 2017-02-08 17:29:33 -0500 | [diff] [blame] | 402 | "src/ports/SkFontMgr_custom_empty.cpp", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 403 | "src/ports/SkFontMgr_custom_empty_factory.cpp", |
| 404 | ] |
| 405 | } |
| 406 | |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 407 | optional("gpu") { |
| 408 | enabled = skia_enable_gpu |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 409 | public_defines = [] |
| 410 | |
Mike Klein | 29b3e58 | 2017-02-09 11:57:32 -0500 | [diff] [blame] | 411 | sources = skia_gpu_sources + skia_sksl_sources + |
| 412 | [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 413 | |
| 414 | # These paths need to be absolute to match the ones produced by shared_sources.gni. |
| 415 | sources -= get_path_info([ |
| 416 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 417 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
| 418 | ], |
| 419 | "abspath") |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 420 | libs = [] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 421 | if (is_android) { |
| 422 | sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ] |
Kevin Lubick | 4a24e10 | 2017-03-29 11:19:01 -0400 | [diff] [blame] | 423 | } else if (skia_use_egl) { |
| 424 | sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ] |
| 425 | libs += [ "EGL" ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 426 | } else if (is_linux) { |
| 427 | sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ] |
Mike Klein | a979a1d | 2017-02-23 10:31:13 -0500 | [diff] [blame] | 428 | libs += [ |
| 429 | "GL", |
| 430 | "GLU", |
| 431 | ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 432 | } else if (is_mac) { |
| 433 | sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ] |
Chinmay Garde | 130a118 | 2016-11-23 11:43:56 -0800 | [diff] [blame] | 434 | } else if (is_ios) { |
| 435 | sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ] |
Mike Klein | 703cf5a | 2016-10-13 17:18:04 -0400 | [diff] [blame] | 436 | } else if (is_win) { |
| 437 | sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ] |
| 438 | libs += [ "OpenGL32.lib" ] |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 439 | } else { |
| 440 | sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ] |
| 441 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 442 | |
| 443 | if (skia_use_vulkan) { |
| 444 | public_defines += [ "SK_VULKAN" ] |
| 445 | sources += skia_vk_sources |
egdaniel | e4a9bd7 | 2016-09-21 07:36:14 -0700 | [diff] [blame] | 446 | if (skia_enable_vulkan_debug_layers) { |
| 447 | public_defines += [ "SK_ENABLE_VK_LAYERS" ] |
| 448 | } |
mtklein | e9fb3d5 | 2016-09-20 15:11:46 -0700 | [diff] [blame] | 449 | } |
Ethan Nicholas | a6ae1f7 | 2017-03-16 09:56:54 -0400 | [diff] [blame] | 450 | if (skia_enable_spirv_validation) { |
| 451 | deps = [ |
| 452 | "//third_party/spirv-tools", |
| 453 | ] |
| 454 | public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ] |
| 455 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 456 | } |
| 457 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 458 | optional("jpeg") { |
| 459 | enabled = skia_use_libjpeg_turbo |
| 460 | public_defines = [ "SK_HAS_JPEG_LIBRARY" ] |
| 461 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 462 | deps = [ |
| 463 | "//third_party/libjpeg-turbo:libjpeg", |
| 464 | ] |
| 465 | sources = [ |
| 466 | "src/codec/SkJpegCodec.cpp", |
| 467 | "src/codec/SkJpegDecoderMgr.cpp", |
| 468 | "src/codec/SkJpegUtility.cpp", |
| 469 | "src/images/SkJPEGImageEncoder.cpp", |
| 470 | "src/images/SkJPEGWriteUtility.cpp", |
| 471 | ] |
| 472 | } |
| 473 | |
| 474 | optional("pdf") { |
Hal Canary | 43fb7a0 | 2016-12-30 13:09:03 -0500 | [diff] [blame] | 475 | enabled = skia_use_zlib && skia_enable_pdf |
| 476 | public_defines = [ "SK_SUPPORT_PDF" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 477 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 478 | deps = [ |
| 479 | "//third_party/zlib", |
| 480 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 481 | sources = skia_pdf_sources |
mtklein | cd01b03 | 2016-08-31 04:58:19 -0700 | [diff] [blame] | 482 | sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 483 | |
| 484 | if (skia_use_sfntly) { |
| 485 | deps += [ "//third_party/sfntly" ] |
Hal Canary | 43fb7a0 | 2016-12-30 13:09:03 -0500 | [diff] [blame] | 486 | public_defines += [ "SK_PDF_USE_SFNTLY" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 487 | } |
| 488 | } |
| 489 | |
| 490 | optional("png") { |
| 491 | enabled = skia_use_libpng |
| 492 | public_defines = [ "SK_HAS_PNG_LIBRARY" ] |
| 493 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 494 | deps = [ |
| 495 | "//third_party/libpng", |
| 496 | ] |
| 497 | sources = [ |
| 498 | "src/codec/SkIcoCodec.cpp", |
| 499 | "src/codec/SkPngCodec.cpp", |
| 500 | "src/images/SkPNGImageEncoder.cpp", |
| 501 | ] |
| 502 | } |
| 503 | |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 504 | optional("raw") { |
Mike Klein | 10d665d | 2016-11-01 11:46:10 -0400 | [diff] [blame] | 505 | enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 506 | public_defines = [ "SK_CODEC_DECODES_RAW" ] |
| 507 | |
| 508 | deps = [ |
| 509 | "//third_party/dng_sdk", |
| 510 | "//third_party/libjpeg-turbo:libjpeg", |
| 511 | "//third_party/piex", |
| 512 | ] |
| 513 | |
| 514 | # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of |
| 515 | # Skia. |
| 516 | configs_to_remove = [ "//gn:no_exceptions" ] |
| 517 | |
| 518 | sources = [ |
| 519 | "src/codec/SkRawAdapterCodec.cpp", |
| 520 | "src/codec/SkRawCodec.cpp", |
| 521 | ] |
| 522 | } |
| 523 | |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 524 | optional("typeface_freetype") { |
| 525 | enabled = skia_use_freetype |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 526 | |
| 527 | deps = [ |
| 528 | "//third_party/freetype2", |
| 529 | ] |
| 530 | sources = [ |
| 531 | "src/ports/SkFontHost_FreeType.cpp", |
| 532 | "src/ports/SkFontHost_FreeType_common.cpp", |
| 533 | ] |
| 534 | } |
| 535 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 536 | optional("webp") { |
| 537 | enabled = skia_use_libwebp |
| 538 | public_defines = [ "SK_HAS_WEBP_LIBRARY" ] |
| 539 | |
mtklein | 457b42a | 2016-08-23 13:56:37 -0700 | [diff] [blame] | 540 | deps = [ |
| 541 | "//third_party/libwebp", |
| 542 | ] |
| 543 | sources = [ |
| 544 | "src/codec/SkWebpAdapterCodec.cpp", |
| 545 | "src/codec/SkWebpCodec.cpp", |
| 546 | "src/images/SkWEBPImageEncoder.cpp", |
| 547 | ] |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 548 | } |
| 549 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 550 | optional("xml") { |
| 551 | enabled = skia_use_expat |
Florin Malita | 442fff9 | 2016-11-08 16:07:52 +0000 | [diff] [blame] | 552 | public_defines = [ "SK_XML" ] |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 553 | |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 554 | deps = [ |
| 555 | "//third_party/expat", |
| 556 | ] |
| 557 | sources = [ |
Mike Klein | bd41bcc | 2017-02-09 16:38:15 -0500 | [diff] [blame] | 558 | "src/svg/SkSVGCanvas.cpp", |
| 559 | "src/svg/SkSVGDevice.cpp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 560 | "src/xml/SkDOM.cpp", |
| 561 | "src/xml/SkXMLParser.cpp", |
| 562 | "src/xml/SkXMLWriter.cpp", |
| 563 | ] |
| 564 | } |
| 565 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 566 | component("skia") { |
| 567 | public_configs = [ ":skia_public" ] |
| 568 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 569 | |
| 570 | deps = [ |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 571 | ":arm64", |
| 572 | ":armv7", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 573 | ":avx", |
anmittal | b8b3f71 | 2016-08-25 04:55:19 -0700 | [diff] [blame] | 574 | ":crc32", |
Mike Klein | a04bb45 | 2017-02-09 12:24:07 -0500 | [diff] [blame] | 575 | ":effects", |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 576 | ":fontmgr_android", |
mtklein | d2e39db | 2016-09-07 07:52:55 -0700 | [diff] [blame] | 577 | ":fontmgr_custom", |
mtklein | 3cc2218 | 2016-08-29 13:26:14 -0700 | [diff] [blame] | 578 | ":fontmgr_fontconfig", |
mtklein | cdedd0e | 2016-09-12 15:15:44 -0700 | [diff] [blame] | 579 | ":fontmgr_fuchsia", |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 580 | ":gpu", |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 581 | ":hsw", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 582 | ":jpeg", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 583 | ":none", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 584 | ":pdf", |
| 585 | ":png", |
scroggo | f84ad64 | 2016-10-31 09:02:57 -0700 | [diff] [blame] | 586 | ":raw", |
mtklein | 9b8583d | 2016-08-24 17:32:30 -0700 | [diff] [blame] | 587 | ":sse2", |
| 588 | ":sse41", |
| 589 | ":sse42", |
| 590 | ":ssse3", |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 591 | ":webp", |
mtklein | 6321381 | 2016-08-24 09:55:56 -0700 | [diff] [blame] | 592 | ":xml", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 593 | ] |
| 594 | |
Chinmay Garde | 43f115c | 2016-11-16 15:04:12 -0800 | [diff] [blame] | 595 | # This file (and all GN files in Skia) are designed to work with an |
| 596 | # empty sources assignment filter; we handle all that explicitly. |
| 597 | # We clear the filter here for clients who may have set up a global filter. |
| 598 | set_sources_assignment_filter([]) |
| 599 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 600 | sources = [] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 601 | sources += skia_core_sources |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 602 | sources += skia_utils_sources |
Hal Canary | 6ad3d2f | 2016-12-20 16:15:56 -0500 | [diff] [blame] | 603 | sources += skia_xps_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 604 | sources += [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 605 | "src/android/SkBitmapRegionCodec.cpp", |
| 606 | "src/android/SkBitmapRegionDecoder.cpp", |
| 607 | "src/codec/SkAndroidCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 608 | "src/codec/SkBmpCodec.cpp", |
| 609 | "src/codec/SkBmpMaskCodec.cpp", |
| 610 | "src/codec/SkBmpRLECodec.cpp", |
| 611 | "src/codec/SkBmpStandardCodec.cpp", |
| 612 | "src/codec/SkCodec.cpp", |
| 613 | "src/codec/SkCodecImageGenerator.cpp", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 614 | "src/codec/SkGifCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 615 | "src/codec/SkMaskSwizzler.cpp", |
| 616 | "src/codec/SkMasks.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 617 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 618 | "src/codec/SkSampler.cpp", |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 619 | "src/codec/SkStreamBuffer.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 620 | "src/codec/SkSwizzler.cpp", |
| 621 | "src/codec/SkWbmpCodec.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 622 | "src/images/SkImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 623 | "src/ports/SkDiscardableMemory_none.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 624 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 625 | "src/ports/SkMemory_malloc.cpp", |
| 626 | "src/ports/SkOSFile_stdio.cpp", |
| 627 | "src/sfnt/SkOTTable_name.cpp", |
| 628 | "src/sfnt/SkOTUtils.cpp", |
| 629 | "src/utils/mac/SkStream_mac.cpp", |
| 630 | "third_party/etc1/etc1.cpp", |
scroggo | 3d3a65c | 2016-10-24 12:28:30 -0700 | [diff] [blame] | 631 | "third_party/gif/SkGifImageReader.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 632 | ] |
brettw | b944728 | 2016-09-01 14:24:39 -0700 | [diff] [blame] | 633 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 634 | libs = [] |
| 635 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 636 | if (is_win) { |
| 637 | sources += [ |
Mike Klein | ae7e671 | 2016-10-11 17:49:33 -0400 | [diff] [blame] | 638 | "src/fonts/SkFontMgr_indirect.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 639 | "src/ports/SkDebug_win.cpp", |
| 640 | "src/ports/SkFontHost_win.cpp", |
| 641 | "src/ports/SkFontMgr_win_dw.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 642 | "src/ports/SkImageEncoder_WIC.cpp", |
| 643 | "src/ports/SkImageGeneratorWIC.cpp", |
| 644 | "src/ports/SkOSFile_win.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 645 | "src/ports/SkOSLibrary_win.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 646 | "src/ports/SkScalerContext_win_dw.cpp", |
| 647 | "src/ports/SkTLS_win.cpp", |
| 648 | "src/ports/SkTypeface_win_dw.cpp", |
| 649 | ] |
Mike Klein | 69f6ed4 | 2016-10-13 15:45:07 -0400 | [diff] [blame] | 650 | if (skia_use_gdi) { |
| 651 | sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ] |
| 652 | libs += [ |
| 653 | "Gdi32.lib", |
| 654 | "Usp10.lib", |
| 655 | ] |
| 656 | } else { |
| 657 | sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ] |
| 658 | } |
mtklein | b9be979 | 2016-09-16 14:44:18 -0700 | [diff] [blame] | 659 | sources -= |
| 660 | [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ] |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 661 | libs += [ |
| 662 | "FontSub.lib", |
| 663 | "Ole32.lib", |
| 664 | "OleAut32.lib", |
| 665 | "User32.lib", |
| 666 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 667 | } else { |
| 668 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 669 | "src/ports/SkOSFile_posix.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 670 | "src/ports/SkOSLibrary_posix.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 671 | "src/ports/SkTLS_pthread.cpp", |
| 672 | ] |
| 673 | } |
| 674 | |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 675 | if (is_android) { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 676 | deps += [ "//third_party/expat" ] |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 677 | if (defined(ndk) && ndk != "") { |
Mike Klein | 1c47187 | 2017-01-13 15:27:45 -0500 | [diff] [blame] | 678 | deps += [ "//third_party/cpu-features" ] |
| 679 | } |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 680 | sources += [ "src/ports/SkDebug_android.cpp" ] |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 681 | libs += [ |
| 682 | "EGL", |
| 683 | "GLESv2", |
| 684 | "log", |
| 685 | ] |
| 686 | } |
| 687 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 688 | if (is_linux) { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 689 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 690 | } |
| 691 | |
| 692 | if (is_mac) { |
| 693 | sources += [ |
mtklein | 7d6fb2c | 2016-08-25 14:50:44 -0700 | [diff] [blame] | 694 | "src/ports/SkDebug_stdio.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 695 | "src/ports/SkFontHost_mac.cpp", |
| 696 | "src/ports/SkImageEncoder_CG.cpp", |
| 697 | "src/ports/SkImageGeneratorCG.cpp", |
| 698 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 699 | libs += [ |
bungeman | 3e306f6 | 2017-03-29 11:32:02 -0400 | [diff] [blame] | 700 | # AppKit symbols NSFontWeightXXX may be dlsym'ed. |
| 701 | "AppKit.framework", |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame] | 702 | "ApplicationServices.framework", |
| 703 | "OpenGL.framework", |
| 704 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 705 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 706 | |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 707 | if (is_ios) { |
| 708 | sources += [ |
| 709 | "src/ports/SkDebug_stdio.cpp", |
| 710 | "src/ports/SkFontHost_mac.cpp", |
| 711 | "src/ports/SkImageEncoder_CG.cpp", |
| 712 | "src/ports/SkImageGeneratorCG.cpp", |
| 713 | ] |
| 714 | libs += [ |
| 715 | "CoreFoundation.framework", |
| 716 | "CoreGraphics.framework", |
| 717 | "CoreText.framework", |
| 718 | "ImageIO.framework", |
| 719 | "MobileCoreServices.framework", |
bungeman | 3e306f6 | 2017-03-29 11:32:02 -0400 | [diff] [blame] | 720 | |
| 721 | # UIKit symbols UIFontWeightXXX may be dlsym'ed. |
| 722 | "UIKit.framework", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 723 | ] |
| 724 | } |
| 725 | |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 726 | if (is_fuchsia) { |
mtklein | 06c35c0 | 2016-09-20 12:28:12 -0700 | [diff] [blame] | 727 | sources += [ "src/ports/SkDebug_stdio.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 728 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 729 | } |
| 730 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 731 | # Targets guarded by skia_enable_tools may use //third_party freely. |
| 732 | if (skia_enable_tools) { |
Mike Klein | 308b5ac | 2016-12-06 16:03:52 -0500 | [diff] [blame] | 733 | # Used by gn_to_bp.py to list our public include dirs. |
| 734 | source_set("public") { |
| 735 | configs += [ ":skia_public" ] |
| 736 | } |
| 737 | |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 738 | config("skia.h_config") { |
| 739 | include_dirs = [ "$target_gen_dir" ] |
| 740 | } |
| 741 | action("skia.h") { |
| 742 | public_configs = [ ":skia.h_config" ] |
| 743 | skia_h = "$target_gen_dir/skia.h" |
| 744 | script = "gn/find_headers.py" |
Greg Daniel | 50130e4 | 2017-04-12 13:29:50 -0400 | [diff] [blame] | 745 | if (skia_use_vulkan) { |
| 746 | use_vulkan_string = "True" |
| 747 | } else { |
| 748 | use_vulkan_string = "False" |
| 749 | } |
| 750 | args = [ |
| 751 | rebase_path(skia_h, root_build_dir), |
| 752 | use_vulkan_string, |
| 753 | ] + rebase_path(skia_public_includes - [ skia_vulkan_headers_path ]) |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 754 | depfile = "$skia_h.deps" |
| 755 | outputs = [ |
| 756 | skia_h, |
| 757 | ] |
| 758 | } |
| 759 | |
| 760 | if (skia_enable_gpu && target_cpu == "x64") { |
| 761 | # Our bots only have 64-bit libOSMesa installed. |
| 762 | # TODO: worth fixing? |
| 763 | executable("fiddle") { |
| 764 | libs = [] |
| 765 | if (is_linux) { |
| 766 | libs += [ "OSMesa" ] |
| 767 | } |
| 768 | |
| 769 | sources = [ |
Mike Klein | c36dedf | 2016-11-18 09:35:28 -0500 | [diff] [blame] | 770 | "tools/fiddle/draw.cpp", |
| 771 | "tools/fiddle/fiddle_main.cpp", |
| 772 | ] |
| 773 | deps = [ |
| 774 | ":skia", |
| 775 | ":skia.h", |
| 776 | ] |
| 777 | } |
| 778 | } |
| 779 | |
| 780 | if (skia_enable_gpu) { |
| 781 | source_set("public_headers_warnings_check") { |
| 782 | sources = [ |
| 783 | "tools/public_headers_warnings_check.cpp", |
| 784 | ] |
| 785 | configs -= [ "//gn:warnings_except_public_headers" ] |
| 786 | deps = [ |
| 787 | ":skia", |
| 788 | ":skia.h", |
| 789 | ] |
| 790 | } |
| 791 | } |
| 792 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 793 | template("test_lib") { |
| 794 | config(target_name + "_config") { |
| 795 | include_dirs = invoker.public_include_dirs |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 796 | if (defined(invoker.public_defines)) { |
| 797 | defines = invoker.public_defines |
| 798 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 799 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 800 | source_set(target_name) { |
| 801 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 802 | public_configs = [ |
| 803 | ":" + target_name + "_config", |
| 804 | ":skia_private", |
| 805 | ] |
| 806 | |
| 807 | if (!defined(deps)) { |
| 808 | deps = [] |
| 809 | } |
| 810 | deps += [ ":skia" ] |
| 811 | testonly = true |
| 812 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 813 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 814 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 815 | template("test_app") { |
| 816 | if (defined(invoker.is_shared_library) && invoker.is_shared_library) { |
| 817 | shared_library("lib" + target_name) { |
| 818 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 819 | testonly = true |
| 820 | } |
| 821 | } else { |
Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame] | 822 | _executable = target_name |
| 823 | executable(_executable) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 824 | forward_variables_from(invoker, "*", [ "is_shared_library" ]) |
| 825 | testonly = true |
| 826 | } |
| 827 | } |
Mike Klein | 7d92103 | 2017-01-05 12:20:41 -0500 | [diff] [blame] | 828 | if (is_android && skia_android_serial != "" && defined(_executable)) { |
| 829 | action("push_" + target_name) { |
| 830 | script = "gn/push_to_android.py" |
| 831 | deps = [ |
| 832 | ":" + _executable, |
| 833 | ] |
| 834 | _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial" |
| 835 | outputs = [ |
| 836 | _stamp, |
| 837 | ] |
| 838 | args = [ |
| 839 | rebase_path("$root_build_dir/$_executable"), |
| 840 | skia_android_serial, |
| 841 | rebase_path(_stamp), |
| 842 | ] |
| 843 | testonly = true |
| 844 | } |
| 845 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 846 | } |
| 847 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 848 | test_lib("gpu_tool_utils") { |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 849 | public_include_dirs = [] |
| 850 | if (skia_enable_gpu) { |
| 851 | public_defines = [] |
| 852 | public_include_dirs += [ "tools/gpu" ] |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 853 | |
| 854 | deps = [] |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 855 | sources = [ |
| 856 | "tools/gpu/GrContextFactory.cpp", |
| 857 | "tools/gpu/GrTest.cpp", |
| 858 | "tools/gpu/TestContext.cpp", |
| 859 | "tools/gpu/gl/GLTestContext.cpp", |
mtklein | 605d952 | 2016-09-21 14:01:32 -0700 | [diff] [blame] | 860 | "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp", |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 861 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", |
| 862 | "tools/gpu/gl/debug/GrBufferObj.cpp", |
| 863 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", |
| 864 | "tools/gpu/gl/debug/GrProgramObj.cpp", |
| 865 | "tools/gpu/gl/debug/GrShaderObj.cpp", |
| 866 | "tools/gpu/gl/debug/GrTextureObj.cpp", |
| 867 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", |
| 868 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 869 | ] |
| 870 | libs = [] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 871 | |
Kevin Lubick | 4a24e10 | 2017-03-29 11:19:01 -0400 | [diff] [blame] | 872 | if (is_android || skia_use_egl) { |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 873 | sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ] |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 874 | } else if (is_ios) { |
| 875 | sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ] |
| 876 | libs += [ "OpenGLES.framework" ] |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 877 | } else if (is_linux) { |
| 878 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
Mike Klein | a979a1d | 2017-02-23 10:31:13 -0500 | [diff] [blame] | 879 | libs += [ "X11" ] |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 880 | } else if (is_mac) { |
| 881 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
Mike Klein | 4b167fc | 2016-10-11 18:13:53 -0400 | [diff] [blame] | 882 | } else if (is_win) { |
| 883 | sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ] |
| 884 | libs += [ |
| 885 | "Gdi32.lib", |
| 886 | "OpenGL32.lib", |
| 887 | ] |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 888 | } |
mtklein | 6ef6999 | 2016-09-14 06:12:09 -0700 | [diff] [blame] | 889 | |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 890 | if (skia_use_angle) { |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 891 | deps += [ "//third_party/angle2" ] |
| 892 | sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ] |
| 893 | } |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 894 | if (skia_use_mesa) { |
| 895 | public_defines += [ "SK_MESA" ] |
| 896 | sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ] |
| 897 | libs += [ "OSMesa" ] |
| 898 | } |
mtklein | d68f9b0 | 2016-09-23 13:18:41 -0700 | [diff] [blame] | 899 | if (skia_use_vulkan) { |
| 900 | sources += [ "tools/gpu/vk/VkTestContext.cpp" ] |
| 901 | } |
mtklein | a627b5c | 2016-09-20 13:36:47 -0700 | [diff] [blame] | 902 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 903 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 904 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 905 | test_lib("flags") { |
| 906 | public_include_dirs = [ "tools/flags" ] |
| 907 | sources = [ |
| 908 | "tools/flags/SkCommandLineFlags.cpp", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 909 | ] |
| 910 | } |
| 911 | test_lib("common_flags") { |
| 912 | public_include_dirs = [ "tools/flags" ] |
| 913 | sources = [ |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 914 | "tools/flags/SkCommonFlags.cpp", |
| 915 | "tools/flags/SkCommonFlagsConfig.cpp", |
| 916 | ] |
| 917 | deps = [ |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 918 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 919 | ":gpu_tool_utils", |
| 920 | ] |
| 921 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 922 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 923 | test_lib("tool_utils") { |
| 924 | public_include_dirs = [ |
| 925 | "tools", |
| 926 | "tools/debugger", |
| 927 | "tools/timer", |
| 928 | ] |
| 929 | sources = [ |
mtklein | b37c034 | 2016-09-09 11:07:45 -0700 | [diff] [blame] | 930 | "tools/AndroidSkDebugToStdOut.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 931 | "tools/CrashHandler.cpp", |
mtklein | 0590fa5 | 2016-09-01 07:06:54 -0700 | [diff] [blame] | 932 | "tools/LsanSuppressions.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 933 | "tools/ProcStats.cpp", |
| 934 | "tools/Resources.cpp", |
| 935 | "tools/ThermalManager.cpp", |
| 936 | "tools/UrlDataManager.cpp", |
| 937 | "tools/debugger/SkDebugCanvas.cpp", |
| 938 | "tools/debugger/SkDrawCommand.cpp", |
| 939 | "tools/debugger/SkJsonWriteBuffer.cpp", |
| 940 | "tools/debugger/SkObjectParser.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 941 | "tools/picture_utils.cpp", |
| 942 | "tools/random_parse_path.cpp", |
| 943 | "tools/sk_tool_utils.cpp", |
| 944 | "tools/sk_tool_utils_font.cpp", |
| 945 | "tools/timer/Timer.cpp", |
| 946 | ] |
Mike Klein | adacaef | 2017-02-06 09:26:14 -0500 | [diff] [blame] | 947 | libs = [] |
| 948 | if (is_ios) { |
| 949 | sources += [ "tools/ios_utils.m" ] |
| 950 | libs += [ "Foundation.framework" ] |
| 951 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 952 | deps = [ |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 953 | ":common_flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 954 | ":flags", |
| 955 | "//third_party/libpng", |
| 956 | ] |
| 957 | public_deps = [ |
| 958 | "//third_party/jsoncpp", |
| 959 | ] |
| 960 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 961 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 962 | import("gn/gm.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 963 | test_lib("gm") { |
| 964 | public_include_dirs = [ "gm" ] |
| 965 | sources = gm_sources |
| 966 | deps = [ |
scroggo | 19b9153 | 2016-10-24 09:03:26 -0700 | [diff] [blame] | 967 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 968 | ":gpu_tool_utils", |
| 969 | ":skia", |
| 970 | ":tool_utils", |
| 971 | ] |
| 972 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 973 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 974 | import("gn/tests.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 975 | test_lib("tests") { |
| 976 | public_include_dirs = [ "tests" ] |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 977 | sources = tests_sources + pathops_tests_sources |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 978 | if (!fontmgr_android_enabled) { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 979 | sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ] |
mtklein | a45be61 | 2016-08-29 15:22:10 -0700 | [diff] [blame] | 980 | } |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 981 | deps = [ |
fmalita | 6cf896d | 2016-08-25 08:44:35 -0700 | [diff] [blame] | 982 | ":experimental_svg_model", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 983 | ":flags", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 984 | ":skia", |
| 985 | ":tool_utils", |
| 986 | "//third_party/libpng", |
| 987 | "//third_party/zlib", |
| 988 | ] |
Mike Klein | d63442d | 2017-03-27 14:16:04 -0400 | [diff] [blame] | 989 | public_deps = [ |
| 990 | ":gpu_tool_utils", # Test.h #includes headers from this target. |
| 991 | ] |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 992 | } |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 993 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 994 | import("gn/bench.gni") |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 995 | test_lib("bench") { |
| 996 | public_include_dirs = [ "bench" ] |
| 997 | sources = bench_sources |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 998 | deps = [ |
| 999 | ":flags", |
| 1000 | ":gm", |
| 1001 | ":gpu_tool_utils", |
| 1002 | ":skia", |
| 1003 | ":tool_utils", |
| 1004 | ] |
| 1005 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1006 | |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1007 | test_lib("experimental_svg_model") { |
| 1008 | public_include_dirs = [ "experimental/svg/model" ] |
| 1009 | sources = [ |
| 1010 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 1011 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
| 1012 | "experimental/svg/model/SkSVGCircle.cpp", |
Florin Malita | ce8840e | 2016-12-08 09:26:47 -0500 | [diff] [blame] | 1013 | "experimental/svg/model/SkSVGClipPath.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1014 | "experimental/svg/model/SkSVGContainer.cpp", |
| 1015 | "experimental/svg/model/SkSVGDOM.cpp", |
| 1016 | "experimental/svg/model/SkSVGEllipse.cpp", |
| 1017 | "experimental/svg/model/SkSVGLine.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 1018 | "experimental/svg/model/SkSVGLinearGradient.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1019 | "experimental/svg/model/SkSVGNode.cpp", |
| 1020 | "experimental/svg/model/SkSVGPath.cpp", |
| 1021 | "experimental/svg/model/SkSVGPoly.cpp", |
| 1022 | "experimental/svg/model/SkSVGRect.cpp", |
| 1023 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 1024 | "experimental/svg/model/SkSVGSVG.cpp", |
| 1025 | "experimental/svg/model/SkSVGShape.cpp", |
fmalita | 28d5b72 | 2016-09-12 17:06:47 -0700 | [diff] [blame] | 1026 | "experimental/svg/model/SkSVGStop.cpp", |
mtklein | c095df5 | 2016-08-24 12:23:52 -0700 | [diff] [blame] | 1027 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 1028 | "experimental/svg/model/SkSVGValue.cpp", |
| 1029 | ] |
| 1030 | deps = [ |
| 1031 | ":skia", |
| 1032 | ] |
| 1033 | } |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 1034 | |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1035 | test_lib("views") { |
| 1036 | public_include_dirs = [ "include/views" ] |
| 1037 | sources = [ |
| 1038 | "src/views/SkEvent.cpp", |
| 1039 | "src/views/SkEventSink.cpp", |
| 1040 | "src/views/SkOSMenu.cpp", |
| 1041 | "src/views/SkTagList.cpp", |
| 1042 | "src/views/SkTouchGesture.cpp", |
| 1043 | "src/views/SkView.cpp", |
| 1044 | "src/views/SkViewPriv.cpp", |
| 1045 | ] |
| 1046 | libs = [] |
Brian Osman | 34755e2 | 2016-12-05 09:46:02 -0500 | [diff] [blame] | 1047 | deps = [] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1048 | if (!is_android) { |
| 1049 | sources += [ "src/views/SkWindow.cpp" ] |
| 1050 | } |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1051 | if (is_linux) { |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 1052 | public_include_dirs += [ "src/views/unix" ] |
| 1053 | sources += [ |
| 1054 | "src/views/unix/SkOSWindow_Unix.cpp", |
| 1055 | "src/views/unix/keysym2ucs.c", |
| 1056 | ] |
Mike Klein | a979a1d | 2017-02-23 10:31:13 -0500 | [diff] [blame] | 1057 | libs += [ |
| 1058 | "GL", |
| 1059 | "X11", |
| 1060 | ] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1061 | } else if (is_mac) { |
| 1062 | sources += [ |
| 1063 | "src/views/mac/SkEventNotifier.mm", |
| 1064 | "src/views/mac/SkNSView.mm", |
| 1065 | "src/views/mac/SkOSWindow_Mac.mm", |
| 1066 | "src/views/mac/SkTextFieldCell.m", |
| 1067 | ] |
| 1068 | libs += [ |
| 1069 | "QuartzCore.framework", |
| 1070 | "Cocoa.framework", |
| 1071 | "Foundation.framework", |
| 1072 | ] |
| 1073 | } else if (is_win) { |
| 1074 | sources += [ "src/views/win/SkOSWindow_win.cpp" ] |
| 1075 | } |
Brian Osman | 34755e2 | 2016-12-05 09:46:02 -0500 | [diff] [blame] | 1076 | if (skia_use_angle) { |
| 1077 | deps += [ "//third_party/angle2" ] |
| 1078 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1079 | } |
| 1080 | |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1081 | if (skia_use_lua) { |
| 1082 | test_lib("lua") { |
| 1083 | public_include_dirs = [] |
| 1084 | sources = [ |
| 1085 | "src/utils/SkLua.cpp", |
| 1086 | "src/utils/SkLuaCanvas.cpp", |
| 1087 | ] |
| 1088 | deps = [ |
| 1089 | "//third_party/lua", |
| 1090 | ] |
| 1091 | } |
| 1092 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1093 | test_app("lua_app") { |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1094 | sources = [ |
| 1095 | "tools/lua/lua_app.cpp", |
| 1096 | ] |
| 1097 | deps = [ |
| 1098 | ":lua", |
| 1099 | ":skia", |
| 1100 | "//third_party/lua", |
| 1101 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1102 | } |
| 1103 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1104 | test_app("lua_pictures") { |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1105 | sources = [ |
| 1106 | "tools/lua/lua_pictures.cpp", |
| 1107 | ] |
| 1108 | deps = [ |
| 1109 | ":flags", |
| 1110 | ":lua", |
| 1111 | ":skia", |
| 1112 | ":tool_utils", |
| 1113 | "//third_party/lua", |
| 1114 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1115 | } |
| 1116 | } |
| 1117 | |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1118 | import("gn/samples.gni") |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1119 | test_lib("samples") { |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1120 | public_include_dirs = [ "samplecode" ] |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1121 | include_dirs = [ "experimental" ] |
| 1122 | sources = samples_sources + [ |
| 1123 | "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp", |
| 1124 | "experimental/SkSetPoly3To3.cpp", |
| 1125 | "experimental/SkSetPoly3To3_A.cpp", |
| 1126 | "experimental/SkSetPoly3To3_D.cpp", |
| 1127 | ] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1128 | deps = [ |
| 1129 | ":experimental_svg_model", |
csmartdalton | 8c67909 | 2017-03-27 12:32:29 -0600 | [diff] [blame] | 1130 | ":flags", |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1131 | ":gm", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1132 | ":tool_utils", |
| 1133 | ":views", |
| 1134 | ":xml", |
| 1135 | ] |
Mike Klein | 38af943 | 2016-11-11 11:39:44 -0500 | [diff] [blame] | 1136 | |
| 1137 | if (skia_use_lua) { |
| 1138 | sources += [ "samplecode/SampleLua.cpp" ] |
| 1139 | deps += [ |
| 1140 | ":lua", |
| 1141 | "//third_party/lua", |
| 1142 | ] |
| 1143 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1144 | } |
| 1145 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1146 | test_app("dm") { |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1147 | sources = [ |
| 1148 | "dm/DM.cpp", |
| 1149 | "dm/DMJsonWriter.cpp", |
| 1150 | "dm/DMSrcSink.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1151 | ] |
| 1152 | include_dirs = [ "tests" ] |
| 1153 | deps = [ |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1154 | ":common_flags", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 1155 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1156 | ":flags", |
| 1157 | ":gm", |
| 1158 | ":gpu_tool_utils", |
| 1159 | ":skia", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 1160 | ":tests", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1161 | ":tool_utils", |
| 1162 | "//third_party/jsoncpp", |
| 1163 | "//third_party/libpng", |
| 1164 | ] |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1165 | } |
| 1166 | |
Mike Klein | 06432b2 | 2017-03-21 13:14:33 -0400 | [diff] [blame] | 1167 | test_app("ok") { |
| 1168 | sources = [ |
| 1169 | "tools/ok.cpp", |
Mike Klein | 7ac0483 | 2017-03-25 11:29:41 -0400 | [diff] [blame] | 1170 | "tools/ok_dsts.cpp", |
| 1171 | "tools/ok_srcs.cpp", |
Mike Klein | d63442d | 2017-03-27 14:16:04 -0400 | [diff] [blame] | 1172 | "tools/ok_test.cpp", |
Mike Klein | f5d1a55 | 2017-03-25 12:32:22 -0400 | [diff] [blame] | 1173 | "tools/ok_vias.cpp", |
Mike Klein | 06432b2 | 2017-03-21 13:14:33 -0400 | [diff] [blame] | 1174 | ] |
| 1175 | deps = [ |
| 1176 | ":gm", |
| 1177 | ":skia", |
Mike Klein | d63442d | 2017-03-27 14:16:04 -0400 | [diff] [blame] | 1178 | ":tests", |
Mike Klein | 06432b2 | 2017-03-21 13:14:33 -0400 | [diff] [blame] | 1179 | ] |
| 1180 | } |
| 1181 | |
Mike Klein | a343017 | 2016-09-27 16:46:29 -0400 | [diff] [blame] | 1182 | if (!is_debug) { # I've benchmarked debug code once too many times... |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1183 | test_app("monobench") { |
Mike Klein | a343017 | 2016-09-27 16:46:29 -0400 | [diff] [blame] | 1184 | sources = [ |
| 1185 | "tools/monobench.cpp", |
| 1186 | ] |
| 1187 | deps = [ |
| 1188 | ":bench", |
| 1189 | ":skia", |
| 1190 | ] |
Mike Klein | a343017 | 2016-09-27 16:46:29 -0400 | [diff] [blame] | 1191 | } |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1192 | } |
| 1193 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1194 | test_app("nanobench") { |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1195 | sources = [ |
| 1196 | "bench/nanobench.cpp", |
| 1197 | ] |
| 1198 | deps = [ |
| 1199 | ":bench", |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1200 | ":common_flags", |
fmalita | 6519c21 | 2016-09-14 08:05:17 -0700 | [diff] [blame] | 1201 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1202 | ":flags", |
| 1203 | ":gm", |
| 1204 | ":gpu_tool_utils", |
| 1205 | ":skia", |
| 1206 | ":tool_utils", |
| 1207 | "//third_party/jsoncpp", |
| 1208 | ] |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 1209 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 1210 | |
Ravi Mistry | 10d36c5 | 2017-01-31 09:49:18 -0500 | [diff] [blame] | 1211 | test_app("skpinfo") { |
| 1212 | sources = [ |
| 1213 | "tools/skpinfo.cpp", |
| 1214 | ] |
| 1215 | deps = [ |
| 1216 | ":flags", |
| 1217 | ":skia", |
| 1218 | ] |
| 1219 | } |
| 1220 | |
Jim Van Verth | 57a98fc | 2016-10-28 13:35:50 -0400 | [diff] [blame] | 1221 | if (is_linux || is_win || is_mac) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1222 | test_app("SampleApp") { |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1223 | sources = [ |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 1224 | "samplecode/SampleApp.cpp", |
| 1225 | "samplecode/SamplePictFile.cpp", |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1226 | ] |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 1227 | if (is_mac) { |
| 1228 | sources += [ "src/views/mac/skia_mac.mm" ] |
| 1229 | } else if (is_win) { |
| 1230 | sources += [ "src/views/win/skia_win.cpp" ] |
| 1231 | } else if (is_linux) { |
| 1232 | sources += [ "src/views/unix/skia_unix.cpp" ] |
| 1233 | } |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1234 | deps = [ |
| 1235 | ":flags", |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 1236 | ":gm", |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1237 | ":gpu_tool_utils", |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 1238 | ":samples", |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1239 | ":skia", |
| 1240 | ":tool_utils", |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 1241 | ":views", |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1242 | ] |
Mike Klein | c168a3a | 2016-11-14 14:53:13 +0000 | [diff] [blame] | 1243 | if (skia_use_angle) { |
| 1244 | deps += [ "//third_party/angle2" ] |
| 1245 | } |
mtklein | 38925aa | 2016-09-21 10:11:25 -0700 | [diff] [blame] | 1246 | } |
Jim Van Verth | 8f5468f | 2016-10-31 09:52:33 -0400 | [diff] [blame] | 1247 | } |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 1248 | |
Jim Van Verth | 8f5468f | 2016-10-31 09:52:33 -0400 | [diff] [blame] | 1249 | if (skia_enable_gpu) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1250 | test_app("skpbench") { |
Jim Van Verth | 8f5468f | 2016-10-31 09:52:33 -0400 | [diff] [blame] | 1251 | sources = [ |
| 1252 | "tools/skpbench/skpbench.cpp", |
| 1253 | ] |
| 1254 | deps = [ |
| 1255 | ":flags", |
| 1256 | ":gpu_tool_utils", |
| 1257 | ":skia", |
| 1258 | ":tool_utils", |
| 1259 | ] |
Jim Van Verth | b6c5e53 | 2016-10-28 10:38:08 -0400 | [diff] [blame] | 1260 | } |
csmartdalton | 4b5179b | 2016-09-19 11:03:58 -0700 | [diff] [blame] | 1261 | } |
| 1262 | |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1263 | # We can't yet build ICU on iOS or Windows. |
| 1264 | if (!is_ios && !is_win) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1265 | test_app("sktexttopdf-hb") { |
mtklein | 6f5df6a | 2016-08-29 16:01:10 -0700 | [diff] [blame] | 1266 | sources = [ |
| 1267 | "tools/SkShaper_harfbuzz.cpp", |
| 1268 | "tools/using_skia_and_harfbuzz.cpp", |
| 1269 | ] |
| 1270 | deps = [ |
| 1271 | ":skia", |
| 1272 | "//third_party/harfbuzz", |
| 1273 | ] |
mtklein | 6f5df6a | 2016-08-29 16:01:10 -0700 | [diff] [blame] | 1274 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 1275 | } |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1276 | test_app("sktexttopdf") { |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1277 | sources = [ |
| 1278 | "tools/SkShaper_primitive.cpp", |
| 1279 | "tools/using_skia_and_harfbuzz.cpp", |
| 1280 | ] |
| 1281 | deps = [ |
| 1282 | ":skia", |
| 1283 | ] |
halcanary | 3eee9d9 | 2016-09-10 07:01:53 -0700 | [diff] [blame] | 1284 | } |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1285 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1286 | test_app("get_images_from_skps") { |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1287 | sources = [ |
| 1288 | "tools/get_images_from_skps.cpp", |
| 1289 | ] |
| 1290 | deps = [ |
| 1291 | ":flags", |
| 1292 | ":skia", |
| 1293 | "//third_party/jsoncpp", |
| 1294 | ] |
mtklein | 046cb56 | 2016-09-16 10:23:12 -0700 | [diff] [blame] | 1295 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1296 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1297 | test_app("colorspaceinfo") { |
Matt Sarett | 8740d58 | 2016-11-11 13:59:14 -0500 | [diff] [blame] | 1298 | sources = [ |
| 1299 | "tools/colorspaceinfo.cpp", |
| 1300 | ] |
| 1301 | deps = [ |
| 1302 | ":flags", |
| 1303 | ":skia", |
| 1304 | ":tool_utils", |
| 1305 | ] |
Matt Sarett | 8740d58 | 2016-11-11 13:59:14 -0500 | [diff] [blame] | 1306 | } |
| 1307 | |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1308 | if (!is_ios) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1309 | test_app("skiaserve") { |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1310 | sources = [ |
| 1311 | "tools/skiaserve/Request.cpp", |
| 1312 | "tools/skiaserve/Response.cpp", |
| 1313 | "tools/skiaserve/skiaserve.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1314 | "tools/skiaserve/urlhandlers/BreakHandler.cpp", |
| 1315 | "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp", |
| 1316 | "tools/skiaserve/urlhandlers/CmdHandler.cpp", |
| 1317 | "tools/skiaserve/urlhandlers/ColorModeHandler.cpp", |
| 1318 | "tools/skiaserve/urlhandlers/DataHandler.cpp", |
| 1319 | "tools/skiaserve/urlhandlers/DownloadHandler.cpp", |
| 1320 | "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp", |
| 1321 | "tools/skiaserve/urlhandlers/ImgHandler.cpp", |
| 1322 | "tools/skiaserve/urlhandlers/InfoHandler.cpp", |
Brian Salomon | 144a5c5 | 2016-12-20 16:48:59 -0500 | [diff] [blame] | 1323 | "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp", |
| 1324 | "tools/skiaserve/urlhandlers/OpsHandler.cpp", |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1325 | "tools/skiaserve/urlhandlers/OverdrawHandler.cpp", |
| 1326 | "tools/skiaserve/urlhandlers/PostHandler.cpp", |
| 1327 | "tools/skiaserve/urlhandlers/QuitHandler.cpp", |
| 1328 | "tools/skiaserve/urlhandlers/RootHandler.cpp", |
| 1329 | ] |
| 1330 | deps = [ |
| 1331 | ":flags", |
| 1332 | ":gpu_tool_utils", |
| 1333 | ":skia", |
| 1334 | ":tool_utils", |
| 1335 | "//third_party/jsoncpp", |
| 1336 | "//third_party/libmicrohttpd", |
| 1337 | "//third_party/libpng", |
| 1338 | ] |
Mike Klein | 7d30288 | 2016-11-03 14:06:31 -0400 | [diff] [blame] | 1339 | } |
mtklein | ecbc526 | 2016-09-22 11:51:24 -0700 | [diff] [blame] | 1340 | } |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1341 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1342 | test_app("fuzz") { |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1343 | sources = [ |
| 1344 | "fuzz/FilterFuzz.cpp", |
Hal Canary | 24ac42b | 2017-02-14 13:35:14 -0500 | [diff] [blame] | 1345 | "fuzz/FuzzCanvas.cpp", |
Kevin Lubick | fec1dea | 2016-11-22 13:57:18 -0500 | [diff] [blame] | 1346 | "fuzz/FuzzDrawFunctions.cpp", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1347 | "fuzz/FuzzGradients.cpp", |
| 1348 | "fuzz/FuzzParsePath.cpp", |
| 1349 | "fuzz/FuzzPathop.cpp", |
| 1350 | "fuzz/FuzzScaleToSides.cpp", |
| 1351 | "fuzz/fuzz.cpp", |
| 1352 | ] |
| 1353 | deps = [ |
| 1354 | ":flags", |
Hal Canary | 44801ca | 2017-03-15 11:39:06 -0400 | [diff] [blame] | 1355 | ":gpu_tool_utils", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1356 | ":skia", |
Hal Canary | db68301 | 2016-11-23 08:55:18 -0700 | [diff] [blame] | 1357 | ":tool_utils", |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1358 | ] |
kjlubick | 14f984b | 2016-10-03 11:49:45 -0700 | [diff] [blame] | 1359 | } |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 1360 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1361 | test_app("pathops_unittest") { |
Mike Klein | 6e74412 | 2016-10-27 12:21:40 -0400 | [diff] [blame] | 1362 | sources = pathops_tests_sources + [ |
Mike Klein | 6e55fef | 2016-10-26 11:41:47 -0400 | [diff] [blame] | 1363 | rebase_path("tests/skia_test.cpp"), |
| 1364 | rebase_path("tests/Test.cpp"), |
| 1365 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 1366 | deps = [ |
| 1367 | ":flags", |
| 1368 | ":gpu_tool_utils", |
| 1369 | ":skia", |
| 1370 | ":tool_utils", |
| 1371 | ] |
caryclark | 9feb632 | 2016-10-25 08:58:26 -0700 | [diff] [blame] | 1372 | } |
| 1373 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1374 | test_app("dump_record") { |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 1375 | sources = [ |
| 1376 | "tools/DumpRecord.cpp", |
| 1377 | "tools/dump_record.cpp", |
| 1378 | ] |
| 1379 | deps = [ |
| 1380 | ":flags", |
| 1381 | ":skia", |
| 1382 | ] |
Mike Klein | 3831242 | 2016-10-05 15:41:01 -0400 | [diff] [blame] | 1383 | } |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 1384 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1385 | test_app("skdiff") { |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 1386 | sources = [ |
| 1387 | "tools/skdiff/skdiff.cpp", |
| 1388 | "tools/skdiff/skdiff_html.cpp", |
| 1389 | "tools/skdiff/skdiff_main.cpp", |
| 1390 | "tools/skdiff/skdiff_utils.cpp", |
| 1391 | ] |
| 1392 | deps = [ |
| 1393 | ":skia", |
| 1394 | ":tool_utils", |
| 1395 | ] |
bungeman | fe91727 | 2016-10-13 17:36:40 -0400 | [diff] [blame] | 1396 | } |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 1397 | |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1398 | test_app("skp_parser") { |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 1399 | sources = [ |
| 1400 | "tools/skp_parser.cpp", |
| 1401 | ] |
| 1402 | deps = [ |
| 1403 | ":skia", |
| 1404 | ":tool_utils", |
| 1405 | "//third_party/jsoncpp", |
| 1406 | ] |
halcanary | a73d76a | 2016-10-17 13:19:02 -0700 | [diff] [blame] | 1407 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1408 | |
Mike Klein | a92c383 | 2016-12-08 09:49:39 -0500 | [diff] [blame] | 1409 | if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1410 | test_app("viewer") { |
| 1411 | is_shared_library = is_android |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1412 | sources = [ |
| 1413 | "tools/viewer/GMSlide.cpp", |
| 1414 | "tools/viewer/ImageSlide.cpp", |
| 1415 | "tools/viewer/SKPSlide.cpp", |
| 1416 | "tools/viewer/SampleSlide.cpp", |
| 1417 | "tools/viewer/Viewer.cpp", |
| 1418 | "tools/viewer/sk_app/CommandSet.cpp", |
| 1419 | "tools/viewer/sk_app/GLWindowContext.cpp", |
| 1420 | "tools/viewer/sk_app/Window.cpp", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1421 | ] |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 1422 | libs = [] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1423 | |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1424 | if (is_android) { |
| 1425 | sources += [ |
| 1426 | "tools/viewer/sk_app/android/GLWindowContext_android.cpp", |
| 1427 | "tools/viewer/sk_app/android/RasterWindowContext_android.cpp", |
| 1428 | "tools/viewer/sk_app/android/Window_android.cpp", |
| 1429 | "tools/viewer/sk_app/android/main_android.cpp", |
| 1430 | "tools/viewer/sk_app/android/surface_glue_android.cpp", |
| 1431 | ] |
Brian Osman | 462334e | 2017-02-09 11:22:57 -0500 | [diff] [blame] | 1432 | libs += [ "android" ] |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1433 | } else if (is_linux) { |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 1434 | sources += [ |
| 1435 | "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp", |
| 1436 | "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp", |
| 1437 | "tools/viewer/sk_app/unix/Window_unix.cpp", |
| 1438 | "tools/viewer/sk_app/unix/main_unix.cpp", |
| 1439 | ] |
| 1440 | } else if (is_win) { |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1441 | sources += [ |
| 1442 | "tools/viewer/sk_app/win/GLWindowContext_win.cpp", |
| 1443 | "tools/viewer/sk_app/win/RasterWindowContext_win.cpp", |
| 1444 | "tools/viewer/sk_app/win/Window_win.cpp", |
| 1445 | "tools/viewer/sk_app/win/main_win.cpp", |
| 1446 | ] |
Mike Klein | 43c2526 | 2016-10-20 10:17:47 -0400 | [diff] [blame] | 1447 | } else if (is_mac) { |
| 1448 | sources += [ |
| 1449 | "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp", |
| 1450 | "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp", |
| 1451 | "tools/viewer/sk_app/mac/Window_mac.cpp", |
| 1452 | "tools/viewer/sk_app/mac/main_mac.cpp", |
| 1453 | ] |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1454 | } |
| 1455 | |
| 1456 | if (skia_use_vulkan) { |
| 1457 | sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ] |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1458 | if (is_android) { |
| 1459 | sources += |
| 1460 | [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ] |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1461 | } else if (is_linux) { |
Brian Osman | 2dd9693 | 2016-10-18 15:33:53 -0400 | [diff] [blame] | 1462 | sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ] |
| 1463 | libs += [ "X11-xcb" ] |
| 1464 | } else if (is_win) { |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1465 | sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ] |
| 1466 | } |
| 1467 | } |
| 1468 | |
| 1469 | include_dirs = [] |
| 1470 | deps = [ |
| 1471 | ":flags", |
| 1472 | ":gm", |
| 1473 | ":gpu_tool_utils", |
| 1474 | ":samples", |
| 1475 | ":skia", |
| 1476 | ":tool_utils", |
| 1477 | ":views", |
Brian Osman | 79086b9 | 2017-02-10 13:36:16 -0500 | [diff] [blame] | 1478 | "//third_party/imgui", |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1479 | "//third_party/jsoncpp", |
| 1480 | ] |
Jim Van Verth | 4e56a91 | 2016-10-21 10:58:52 -0400 | [diff] [blame] | 1481 | if (is_android) { |
| 1482 | deps += [ "//third_party/native_app_glue" ] |
| 1483 | } else if (is_mac) { |
Mike Klein | 43c2526 | 2016-10-20 10:17:47 -0400 | [diff] [blame] | 1484 | deps += [ "//third_party/libsdl" ] |
| 1485 | } |
Mike Klein | a92c383 | 2016-12-08 09:49:39 -0500 | [diff] [blame] | 1486 | } |
Brian Osman | 16adfa3 | 2016-10-18 14:42:44 -0400 | [diff] [blame] | 1487 | } |
Ethan Nicholas | 4f3985c | 2016-11-14 11:16:37 -0500 | [diff] [blame] | 1488 | |
Mike Klein | e459afd | 2017-03-03 09:21:30 -0500 | [diff] [blame] | 1489 | if (is_android && defined(ndk) && ndk != "") { |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 1490 | copy("gdbserver") { |
| 1491 | sources = [ |
| 1492 | "$ndk/$ndk_gdbserver", |
| 1493 | ] |
| 1494 | outputs = [ |
| 1495 | "$root_out_dir/gdbserver", |
| 1496 | ] |
| 1497 | } |
Derek Sollenberger | 70120c7 | 2017-01-05 11:39:04 -0500 | [diff] [blame] | 1498 | } |
| 1499 | |
Ethan Nicholas | 4f3985c | 2016-11-14 11:16:37 -0500 | [diff] [blame] | 1500 | if (skia_enable_gpu) { |
Mike Klein | e6682eb | 2017-01-05 10:54:57 -0500 | [diff] [blame] | 1501 | test_app("skslc") { |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 1502 | defines = [ "SKSL_STANDALONE" ] |
Ethan Nicholas | 4f3985c | 2016-11-14 11:16:37 -0500 | [diff] [blame] | 1503 | sources = [ |
| 1504 | "src/sksl/SkSLMain.cpp", |
| 1505 | ] |
Ethan Nicholas | 0df1b04 | 2017-03-31 13:56:23 -0400 | [diff] [blame] | 1506 | sources += skia_sksl_sources |
| 1507 | include_dirs = [ "src/sksl" ] |
Ethan Nicholas | 4f3985c | 2016-11-14 11:16:37 -0500 | [diff] [blame] | 1508 | } |
| 1509 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 1510 | } |