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