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