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