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