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