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