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