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 | |
| 6 | declare_args() { |
| 7 | } |
| 8 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 9 | skia_public_includes = [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 10 | "include/android", |
mtklein | fa84d94 | 2016-07-28 09:45:14 -0700 | [diff] [blame] | 11 | "include/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 12 | "include/codec", |
| 13 | "include/config", |
| 14 | "include/core", |
| 15 | "include/effects", |
| 16 | "include/gpu", |
| 17 | "include/gpu/gl", |
| 18 | "include/images", |
| 19 | "include/pathops", |
| 20 | "include/ports", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 21 | "include/svg", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 22 | "include/utils", |
| 23 | "include/utils/mac", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 24 | "include/xml", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 25 | ] |
| 26 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 27 | # Skia public API, generally provided by :skia. |
| 28 | config("skia_public") { |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 29 | include_dirs = skia_public_includes |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 30 | defines = [ "SKIA_DLL" ] |
| 31 | } |
| 32 | |
| 33 | # Skia internal APIs, used by Skia itself and a few test tools. |
| 34 | config("skia_private") { |
| 35 | visibility = [ ":*" ] |
| 36 | |
| 37 | include_dirs = [ |
| 38 | "include/private", |
| 39 | "src/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 40 | "src/codec", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 41 | "src/config", |
| 42 | "src/core", |
| 43 | "src/effects", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 44 | "src/effects/gradients", |
| 45 | "src/fonts", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 46 | "src/gpu", |
| 47 | "src/image", |
| 48 | "src/images", |
| 49 | "src/lazy", |
| 50 | "src/opts", |
| 51 | "src/pathops", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 52 | "src/pdf", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 53 | "src/ports", |
| 54 | "src/sfnt", |
| 55 | "src/utils", |
| 56 | "third_party/etc1", |
| 57 | "third_party/ktx", |
| 58 | ] |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 59 | |
| 60 | defines = [ |
mtklein | 9be6866 | 2016-08-01 08:37:48 -0700 | [diff] [blame] | 61 | "SK_GAMMA_SRGB", |
| 62 | "SK_GAMMA_APPLY_TO_A8", |
| 63 | |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 64 | "SK_HAS_GIF_LIBRARY", |
| 65 | "SK_HAS_JPEG_LIBRARY", |
| 66 | "SK_HAS_PNG_LIBRARY", |
| 67 | "SK_HAS_WEBP_LIBRARY", |
mtklein | 7c1ae7a | 2016-08-01 15:50:27 -0700 | [diff] [blame^] | 68 | |
| 69 | "TURBO_HAS_565", |
| 70 | "TURBO_HAS_CROP", |
| 71 | "TURBO_HAS_SKIP", |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 72 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 76 | config("skia_library") { |
| 77 | visibility = [ ":*" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 78 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
| 79 | } |
| 80 | |
| 81 | skia_library_configs = [ |
| 82 | ":skia_public", |
| 83 | ":skia_private", |
| 84 | ":skia_library", |
| 85 | ] |
| 86 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 87 | core_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 88 | [ |
| 89 | rebase_path("gyp/core.gypi"), |
| 90 | "--replace=<(skia_include_path)=include", |
| 91 | "--replace=<(skia_src_path)=src", |
| 92 | ], |
| 93 | "scope", |
| 94 | [ "gyp/core.gypi" ]) |
| 95 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 96 | effects_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 97 | [ |
| 98 | rebase_path("gyp/effects.gypi"), |
| 99 | "--replace=<(skia_include_path)=include", |
| 100 | "--replace=<(skia_src_path)=src", |
| 101 | ], |
| 102 | "scope", |
| 103 | [ "gyp/effects.gypi" ]) |
| 104 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 105 | gpu_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 106 | [ |
| 107 | rebase_path("gyp/gpu.gypi"), |
| 108 | "--replace=<(skia_include_path)=include", |
| 109 | "--replace=<(skia_src_path)=src", |
| 110 | ], |
| 111 | "scope", |
| 112 | [ "gyp/gpu.gypi" ]) |
| 113 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 114 | opts_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 115 | [ |
| 116 | rebase_path("gyp/opts.gypi"), |
| 117 | "--replace=<(skia_include_path)=include", |
| 118 | "--replace=<(skia_src_path)=src", |
| 119 | ], |
| 120 | "scope", |
| 121 | [ "gyp/opts.gypi" ]) |
| 122 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 123 | pdf_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 124 | [ |
| 125 | rebase_path("gyp/pdf.gypi"), |
| 126 | "--replace=<(skia_include_path)=include", |
| 127 | "--replace=<(skia_src_path)=src", |
| 128 | ], |
| 129 | "scope", |
| 130 | [ "gyp/pdf.gypi" ]) |
| 131 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 132 | utils_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 133 | [ |
| 134 | rebase_path("gyp/utils.gypi"), |
| 135 | "--replace=<(skia_include_path)=include", |
| 136 | "--replace=<(skia_src_path)=src", |
| 137 | ], |
| 138 | "scope", |
| 139 | [ "gyp/utils.gypi" ]) |
| 140 | |
| 141 | source_set("opts_ssse3") { |
| 142 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 143 | |
| 144 | sources = opts_gypi.ssse3_sources |
| 145 | cflags = [ "-mssse3" ] |
| 146 | } |
| 147 | |
| 148 | source_set("opts_sse41") { |
| 149 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 150 | |
| 151 | sources = opts_gypi.sse41_sources |
| 152 | cflags = [ "-msse4.1" ] |
| 153 | } |
| 154 | |
| 155 | source_set("opts_avx") { |
| 156 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 157 | |
| 158 | sources = opts_gypi.avx_sources |
| 159 | cflags = [ "-mavx" ] |
| 160 | } |
| 161 | |
| 162 | component("skia") { |
| 163 | public_configs = [ ":skia_public" ] |
| 164 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 165 | |
| 166 | deps = [ |
| 167 | ":opts_avx", |
| 168 | ":opts_sse41", |
| 169 | ":opts_ssse3", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 170 | "//third_party/expat", |
| 171 | "//third_party/giflib", |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 172 | "//third_party/libjpeg_turbo", |
| 173 | "//third_party/libpng", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 174 | "//third_party/libwebp", |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 175 | "//third_party/zlib", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 176 | ] |
| 177 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 178 | libs = [ "pthread" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 179 | |
| 180 | sources = [] |
| 181 | sources += core_gypi.sources |
| 182 | sources += effects_gypi.sources |
| 183 | sources += gpu_gypi.skgpu_sources |
| 184 | sources += opts_gypi.sse2_sources |
| 185 | sources += pdf_gypi.sources |
| 186 | sources += utils_gypi.sources |
| 187 | sources += [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 188 | "src/android/SkBitmapRegionCodec.cpp", |
| 189 | "src/android/SkBitmapRegionDecoder.cpp", |
| 190 | "src/codec/SkAndroidCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 191 | "src/codec/SkBmpCodec.cpp", |
| 192 | "src/codec/SkBmpMaskCodec.cpp", |
| 193 | "src/codec/SkBmpRLECodec.cpp", |
| 194 | "src/codec/SkBmpStandardCodec.cpp", |
| 195 | "src/codec/SkCodec.cpp", |
| 196 | "src/codec/SkCodecImageGenerator.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 197 | "src/codec/SkGifCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 198 | "src/codec/SkIcoCodec.cpp", |
| 199 | "src/codec/SkJpegCodec.cpp", |
| 200 | "src/codec/SkJpegDecoderMgr.cpp", |
| 201 | "src/codec/SkJpegUtility.cpp", |
| 202 | "src/codec/SkMaskSwizzler.cpp", |
| 203 | "src/codec/SkMasks.cpp", |
| 204 | "src/codec/SkPngCodec.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 205 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 206 | "src/codec/SkSampler.cpp", |
| 207 | "src/codec/SkSwizzler.cpp", |
| 208 | "src/codec/SkWbmpCodec.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 209 | "src/codec/SkWebpAdapterCodec.cpp", |
| 210 | "src/codec/SkWebpCodec.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 211 | "src/images/SkImageEncoder.cpp", |
| 212 | "src/images/SkImageEncoder_Factory.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 213 | "src/images/SkJPEGImageEncoder.cpp", |
| 214 | "src/images/SkJPEGWriteUtility.cpp", |
| 215 | "src/images/SkKTXImageEncoder.cpp", |
| 216 | "src/images/SkPNGImageEncoder.cpp", |
| 217 | "src/images/SkWEBPImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 218 | "src/ports/SkDiscardableMemory_none.cpp", |
| 219 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 220 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 221 | "src/ports/SkMemory_malloc.cpp", |
| 222 | "src/ports/SkOSFile_stdio.cpp", |
| 223 | "src/sfnt/SkOTTable_name.cpp", |
| 224 | "src/sfnt/SkOTUtils.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 225 | "src/svg/SkSVGCanvas.cpp", |
| 226 | "src/svg/SkSVGDevice.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 227 | "src/utils/mac/SkStream_mac.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 228 | "src/xml/SkDOM.cpp", |
| 229 | "src/xml/SkXMLParser.cpp", |
| 230 | "src/xml/SkXMLWriter.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 231 | "third_party/etc1/etc1.cpp", |
| 232 | "third_party/ktx/ktx.cpp", |
| 233 | ] |
| 234 | |
| 235 | if (is_win) { |
| 236 | sources += [ |
| 237 | "src/ports/SkDebug_win.cpp", |
| 238 | "src/ports/SkFontHost_win.cpp", |
| 239 | "src/ports/SkFontMgr_win_dw.cpp", |
| 240 | "src/ports/SkFontMgr_win_dw_factory.cpp", |
| 241 | "src/ports/SkImageEncoder_WIC.cpp", |
| 242 | "src/ports/SkImageGeneratorWIC.cpp", |
| 243 | "src/ports/SkOSFile_win.cpp", |
| 244 | "src/ports/SkScalerContext_win_dw.cpp", |
| 245 | "src/ports/SkTLS_win.cpp", |
| 246 | "src/ports/SkTypeface_win_dw.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 247 | "src/xps/SkDocument_XPS.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 248 | ] |
| 249 | } else { |
| 250 | sources += [ |
| 251 | "src/ports/SkDebug_stdio.cpp", |
| 252 | "src/ports/SkOSFile_posix.cpp", |
| 253 | "src/ports/SkTLS_pthread.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 254 | "src/xps/SkDocument_XPS_None.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 255 | ] |
| 256 | } |
| 257 | |
| 258 | if (is_linux) { |
| 259 | deps += [ |
| 260 | "third_party:fontconfig", |
| 261 | "third_party:freetype2", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 262 | ] |
| 263 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 264 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 265 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 266 | "src/ports/SkFontHost_FreeType.cpp", |
| 267 | "src/ports/SkFontHost_FreeType_common.cpp", |
mtklein | 7a34b1c | 2016-08-01 13:08:46 -0700 | [diff] [blame] | 268 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 269 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 270 | ] |
| 271 | } |
| 272 | |
| 273 | if (is_mac) { |
| 274 | sources += [ |
| 275 | "src/ports/SkFontHost_mac.cpp", |
| 276 | "src/ports/SkImageEncoder_CG.cpp", |
| 277 | "src/ports/SkImageGeneratorCG.cpp", |
| 278 | ] |
| 279 | libs += [ "ApplicationServices.framework" ] |
| 280 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 281 | |
| 282 | if (is_fuchsia) { |
mtklein | e817ddf | 2016-07-19 06:03:22 -0700 | [diff] [blame] | 283 | sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 284 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 285 | } |
| 286 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 287 | action("skia.h") { |
| 288 | script = "gn/echo_headers.py" |
| 289 | args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + |
| 290 | rebase_path(skia_public_includes, root_build_dir) |
| 291 | outputs = [ |
| 292 | "$target_gen_dir/skia.h", |
| 293 | ] |
| 294 | } |
| 295 | |
| 296 | executable("fiddle") { |
| 297 | include_dirs = [ "$target_gen_dir" ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 298 | libs = [] |
| 299 | if (is_linux) { |
| 300 | libs += [ "OSMesa" ] |
| 301 | } |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 302 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 303 | sources = [ |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 304 | "tools/fiddle/draw.cpp", |
| 305 | "tools/fiddle/fiddle_main.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 306 | ] |
| 307 | deps = [ |
| 308 | ":skia", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 309 | ":skia.h", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 310 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 311 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 312 | |
| 313 | template("test_lib") { |
| 314 | config(target_name + "_config") { |
| 315 | include_dirs = invoker.public_include_dirs |
| 316 | } |
| 317 | source_set(target_name) { |
| 318 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 319 | public_configs = [ |
| 320 | ":" + target_name + "_config", |
| 321 | ":skia_private", |
| 322 | ] |
| 323 | |
| 324 | if (!defined(deps)) { |
| 325 | deps = [] |
| 326 | } |
| 327 | deps += [ ":skia" ] |
| 328 | testonly = true |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | test_lib("gpu_tool_utils") { |
| 333 | public_include_dirs = [ "tools/gpu" ] |
| 334 | sources = [ |
| 335 | "tools/gpu/GrContextFactory.cpp", |
| 336 | "tools/gpu/GrTest.cpp", |
| 337 | "tools/gpu/TestContext.cpp", |
| 338 | "tools/gpu/gl/GLTestContext.cpp", |
| 339 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", |
| 340 | "tools/gpu/gl/debug/GrBufferObj.cpp", |
| 341 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", |
| 342 | "tools/gpu/gl/debug/GrProgramObj.cpp", |
| 343 | "tools/gpu/gl/debug/GrShaderObj.cpp", |
| 344 | "tools/gpu/gl/debug/GrTextureObj.cpp", |
| 345 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", |
| 346 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 347 | ] |
| 348 | libs = [] |
| 349 | |
| 350 | if (is_linux) { |
| 351 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
| 352 | libs += [ |
| 353 | "GL", |
| 354 | "GLU", |
| 355 | "X11", |
| 356 | ] |
| 357 | } else if (is_mac) { |
| 358 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
| 359 | libs += [ "OpenGL.framework" ] |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | test_lib("flags") { |
| 364 | public_include_dirs = [ "tools/flags" ] |
| 365 | sources = [ |
| 366 | "tools/flags/SkCommandLineFlags.cpp", |
| 367 | "tools/flags/SkCommonFlags.cpp", |
| 368 | "tools/flags/SkCommonFlagsConfig.cpp", |
| 369 | ] |
| 370 | deps = [ |
| 371 | ":gpu_tool_utils", |
| 372 | ] |
| 373 | } |
| 374 | |
| 375 | test_lib("tool_utils") { |
| 376 | public_include_dirs = [ |
| 377 | "tools", |
| 378 | "tools/timer", |
| 379 | ] |
| 380 | sources = [ |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 381 | "src/images/SkForceLinking.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 382 | "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools? |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 383 | "tools/CrashHandler.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 384 | "tools/ProcStats.cpp", |
| 385 | "tools/Resources.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 386 | "tools/ThermalManager.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 387 | "tools/picture_utils.cpp", |
| 388 | "tools/random_parse_path.cpp", |
| 389 | "tools/sk_tool_utils.cpp", |
| 390 | "tools/sk_tool_utils_font.cpp", |
| 391 | "tools/timer/Timer.cpp", |
| 392 | ] |
| 393 | deps = [ |
| 394 | ":flags", |
| 395 | ] |
| 396 | } |
| 397 | |
| 398 | gm_sources = exec_script("gyp/find.py", |
| 399 | [ |
| 400 | rebase_path("gm"), |
| 401 | "*.c*", |
| 402 | ], |
| 403 | "list lines", |
| 404 | []) |
| 405 | test_lib("gm") { |
| 406 | public_include_dirs = [ "gm" ] |
| 407 | sources = gm_sources |
| 408 | deps = [ |
| 409 | ":gpu_tool_utils", |
| 410 | ":skia", |
| 411 | ":tool_utils", |
| 412 | ] |
| 413 | } |
| 414 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 415 | bench_sources = exec_script("gyp/find.py", |
| 416 | [ |
| 417 | rebase_path("bench"), |
| 418 | "*.c*", |
| 419 | ], |
| 420 | "list lines", |
| 421 | []) |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 422 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 423 | test_lib("bench") { |
| 424 | public_include_dirs = [ "bench" ] |
| 425 | sources = bench_sources |
| 426 | sources -= [ |
| 427 | rebase_path("bench/nanobench.cpp"), |
| 428 | rebase_path("bench/nanobenchAndroid.cpp"), |
| 429 | ] |
| 430 | deps = [ |
| 431 | ":flags", |
| 432 | ":gm", |
| 433 | ":gpu_tool_utils", |
| 434 | ":skia", |
| 435 | ":tool_utils", |
| 436 | ] |
| 437 | } |
| 438 | |
| 439 | if (!is_component_build) { # Our test tools use many non-SK_API APIs... |
| 440 | executable("dm") { |
| 441 | sources = [ |
| 442 | "dm/DM.cpp", |
| 443 | "dm/DMJsonWriter.cpp", |
| 444 | "dm/DMSrcSink.cpp", |
| 445 | |
| 446 | # TODO: tests for real |
| 447 | "tests/Test.cpp", |
| 448 | ] |
| 449 | include_dirs = [ "tests" ] |
| 450 | deps = [ |
| 451 | ":flags", |
| 452 | ":gm", |
| 453 | ":gpu_tool_utils", |
| 454 | ":skia", |
| 455 | ":tool_utils", |
| 456 | "//third_party/jsoncpp", |
| 457 | "//third_party/libpng", |
| 458 | ] |
| 459 | testonly = true |
| 460 | } |
| 461 | |
| 462 | executable("monobench") { |
| 463 | sources = [ |
| 464 | "tools/monobench.cpp", |
| 465 | ] |
| 466 | deps = [ |
| 467 | ":bench", |
| 468 | ":skia", |
| 469 | ] |
| 470 | testonly = true |
| 471 | } |
| 472 | |
| 473 | executable("nanobench") { |
| 474 | sources = [ |
| 475 | "bench/nanobench.cpp", |
| 476 | ] |
| 477 | deps = [ |
| 478 | ":bench", |
| 479 | ":flags", |
| 480 | ":gm", |
| 481 | ":gpu_tool_utils", |
| 482 | ":skia", |
| 483 | ":tool_utils", |
| 484 | "//third_party/jsoncpp", |
| 485 | ] |
| 486 | testonly = true |
| 487 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 488 | } |