| 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 | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 11 | "include/codec", | 
|  | 12 | "include/config", | 
|  | 13 | "include/core", | 
|  | 14 | "include/effects", | 
|  | 15 | "include/gpu", | 
|  | 16 | "include/gpu/gl", | 
|  | 17 | "include/images", | 
|  | 18 | "include/pathops", | 
|  | 19 | "include/ports", | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 20 | "include/svg", | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 21 | "include/utils", | 
|  | 22 | "include/utils/mac", | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 23 | "include/xml", | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 24 |  | 
| mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 25 | "include/c",  # TODO: move back to top, order shouldn't matter | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 26 | ] | 
|  | 27 |  | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 28 | # Skia public API, generally provided by :skia. | 
|  | 29 | config("skia_public") { | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 30 | include_dirs = skia_public_includes | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 31 | defines = [ "SKIA_DLL" ] | 
|  | 32 | } | 
|  | 33 |  | 
|  | 34 | # Skia internal APIs, used by Skia itself and a few test tools. | 
|  | 35 | config("skia_private") { | 
|  | 36 | visibility = [ ":*" ] | 
|  | 37 |  | 
|  | 38 | include_dirs = [ | 
|  | 39 | "include/private", | 
|  | 40 | "src/c", | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 41 | "src/codec", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 42 | "src/config", | 
|  | 43 | "src/core", | 
|  | 44 | "src/effects", | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 45 | "src/effects/gradients", | 
|  | 46 | "src/fonts", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 47 | "src/gpu", | 
|  | 48 | "src/image", | 
|  | 49 | "src/images", | 
|  | 50 | "src/lazy", | 
|  | 51 | "src/opts", | 
|  | 52 | "src/pathops", | 
|  | 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", | 
|  | 206 | "src/ports/SkDiscardableMemory_none.cpp", | 
|  | 207 | "src/ports/SkGlobalInitialization_default.cpp", | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 208 | "src/ports/SkImageGenerator_skia.cpp", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 209 | "src/ports/SkMemory_malloc.cpp", | 
|  | 210 | "src/ports/SkOSFile_stdio.cpp", | 
|  | 211 | "src/sfnt/SkOTTable_name.cpp", | 
|  | 212 | "src/sfnt/SkOTUtils.cpp", | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 213 | "src/svg/SkSVGCanvas.cpp", | 
|  | 214 | "src/svg/SkSVGDevice.cpp", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 215 | "src/utils/mac/SkStream_mac.cpp", | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 216 | "src/xml/SkDOM.cpp", | 
|  | 217 | "src/xml/SkXMLParser.cpp", | 
|  | 218 | "src/xml/SkXMLWriter.cpp", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 219 | "third_party/etc1/etc1.cpp", | 
|  | 220 | "third_party/ktx/ktx.cpp", | 
|  | 221 | ] | 
|  | 222 |  | 
|  | 223 | if (is_win) { | 
|  | 224 | sources += [ | 
|  | 225 | "src/ports/SkDebug_win.cpp", | 
|  | 226 | "src/ports/SkFontHost_win.cpp", | 
|  | 227 | "src/ports/SkFontMgr_win_dw.cpp", | 
|  | 228 | "src/ports/SkFontMgr_win_dw_factory.cpp", | 
|  | 229 | "src/ports/SkImageEncoder_WIC.cpp", | 
|  | 230 | "src/ports/SkImageGeneratorWIC.cpp", | 
|  | 231 | "src/ports/SkOSFile_win.cpp", | 
|  | 232 | "src/ports/SkScalerContext_win_dw.cpp", | 
|  | 233 | "src/ports/SkTLS_win.cpp", | 
|  | 234 | "src/ports/SkTypeface_win_dw.cpp", | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 235 | "src/xps/SkDocument_XPS.cpp", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 236 | ] | 
|  | 237 | } else { | 
|  | 238 | sources += [ | 
|  | 239 | "src/ports/SkDebug_stdio.cpp", | 
|  | 240 | "src/ports/SkOSFile_posix.cpp", | 
|  | 241 | "src/ports/SkTLS_pthread.cpp", | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 242 | "src/xps/SkDocument_XPS_None.cpp", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 243 | ] | 
|  | 244 | } | 
|  | 245 |  | 
|  | 246 | if (is_linux) { | 
|  | 247 | deps += [ | 
|  | 248 | "third_party:fontconfig", | 
|  | 249 | "third_party:freetype2", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 250 | ] | 
|  | 251 | sources += [ | 
|  | 252 | "src/fonts/SkFontMgr_fontconfig.cpp", | 
|  | 253 | "src/images/SkJPEGImageEncoder.cpp", | 
|  | 254 | "src/images/SkJPEGWriteUtility.cpp", | 
|  | 255 | "src/images/SkPNGImageEncoder.cpp", | 
|  | 256 | "src/ports/SkFontConfigInterface_direct.cpp", | 
|  | 257 | "src/ports/SkFontConfigInterface_direct_factory.cpp", | 
|  | 258 | "src/ports/SkFontHost_FreeType.cpp", | 
|  | 259 | "src/ports/SkFontHost_FreeType_common.cpp", | 
|  | 260 | "src/ports/SkFontHost_fontconfig.cpp", | 
|  | 261 | ] | 
|  | 262 | } | 
|  | 263 |  | 
|  | 264 | if (is_mac) { | 
|  | 265 | sources += [ | 
|  | 266 | "src/ports/SkFontHost_mac.cpp", | 
|  | 267 | "src/ports/SkImageEncoder_CG.cpp", | 
|  | 268 | "src/ports/SkImageGeneratorCG.cpp", | 
|  | 269 | ] | 
|  | 270 | libs += [ "ApplicationServices.framework" ] | 
|  | 271 | } | 
| abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 272 |  | 
|  | 273 | if (is_fuchsia) { | 
| mtklein | e817ddf | 2016-07-19 06:03:22 -0700 | [diff] [blame] | 274 | sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ] | 
| abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 275 | } | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 276 | } | 
|  | 277 |  | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 278 | action("skia.h") { | 
|  | 279 | script = "gn/echo_headers.py" | 
|  | 280 | args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + | 
|  | 281 | rebase_path(skia_public_includes, root_build_dir) | 
|  | 282 | outputs = [ | 
|  | 283 | "$target_gen_dir/skia.h", | 
|  | 284 | ] | 
|  | 285 | } | 
|  | 286 |  | 
|  | 287 | executable("fiddle") { | 
|  | 288 | include_dirs = [ "$target_gen_dir" ] | 
| mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 289 | libs = [] | 
|  | 290 | if (is_linux) { | 
|  | 291 | libs += [ "OSMesa" ] | 
|  | 292 | } | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 293 |  | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 294 | sources = [ | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 295 | "tools/fiddle/draw.cpp", | 
|  | 296 | "tools/fiddle/fiddle_main.cpp", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 297 | ] | 
|  | 298 | deps = [ | 
|  | 299 | ":skia", | 
| mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 300 | ":skia.h", | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 301 | ] | 
| mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 302 | } | 
| mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame^] | 303 |  | 
|  | 304 | template("test_lib") { | 
|  | 305 | config(target_name + "_config") { | 
|  | 306 | include_dirs = invoker.public_include_dirs | 
|  | 307 | } | 
|  | 308 | source_set(target_name) { | 
|  | 309 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) | 
|  | 310 | public_configs = [ | 
|  | 311 | ":" + target_name + "_config", | 
|  | 312 | ":skia_private", | 
|  | 313 | ] | 
|  | 314 |  | 
|  | 315 | if (!defined(deps)) { | 
|  | 316 | deps = [] | 
|  | 317 | } | 
|  | 318 | deps += [ ":skia" ] | 
|  | 319 | testonly = true | 
|  | 320 | } | 
|  | 321 | } | 
|  | 322 |  | 
|  | 323 | test_lib("gpu_tool_utils") { | 
|  | 324 | public_include_dirs = [ "tools/gpu" ] | 
|  | 325 | sources = [ | 
|  | 326 | "tools/gpu/GrContextFactory.cpp", | 
|  | 327 | "tools/gpu/GrTest.cpp", | 
|  | 328 | "tools/gpu/TestContext.cpp", | 
|  | 329 | "tools/gpu/gl/GLTestContext.cpp", | 
|  | 330 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", | 
|  | 331 | "tools/gpu/gl/debug/GrBufferObj.cpp", | 
|  | 332 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", | 
|  | 333 | "tools/gpu/gl/debug/GrProgramObj.cpp", | 
|  | 334 | "tools/gpu/gl/debug/GrShaderObj.cpp", | 
|  | 335 | "tools/gpu/gl/debug/GrTextureObj.cpp", | 
|  | 336 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", | 
|  | 337 | "tools/gpu/gl/null/NullGLTestContext.cpp", | 
|  | 338 | ] | 
|  | 339 | libs = [] | 
|  | 340 |  | 
|  | 341 | if (is_linux) { | 
|  | 342 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] | 
|  | 343 | libs += [ | 
|  | 344 | "GL", | 
|  | 345 | "GLU", | 
|  | 346 | "X11", | 
|  | 347 | ] | 
|  | 348 | } else if (is_mac) { | 
|  | 349 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] | 
|  | 350 | libs += [ "OpenGL.framework" ] | 
|  | 351 | } | 
|  | 352 | } | 
|  | 353 |  | 
|  | 354 | test_lib("flags") { | 
|  | 355 | public_include_dirs = [ "tools/flags" ] | 
|  | 356 | sources = [ | 
|  | 357 | "tools/flags/SkCommandLineFlags.cpp", | 
|  | 358 | "tools/flags/SkCommonFlags.cpp", | 
|  | 359 | "tools/flags/SkCommonFlagsConfig.cpp", | 
|  | 360 | ] | 
|  | 361 | deps = [ | 
|  | 362 | ":gpu_tool_utils", | 
|  | 363 | ] | 
|  | 364 | } | 
|  | 365 |  | 
|  | 366 | test_lib("tool_utils") { | 
|  | 367 | public_include_dirs = [ | 
|  | 368 | "tools", | 
|  | 369 | "tools/timer", | 
|  | 370 | ] | 
|  | 371 | sources = [ | 
|  | 372 | "src/utils/SkMultiPictureDocumentReader.cpp",  # TODO(halcanary): move to tools? | 
|  | 373 | "tools/ProcStats.cpp", | 
|  | 374 | "tools/Resources.cpp", | 
|  | 375 | "tools/picture_utils.cpp", | 
|  | 376 | "tools/random_parse_path.cpp", | 
|  | 377 | "tools/sk_tool_utils.cpp", | 
|  | 378 | "tools/sk_tool_utils_font.cpp", | 
|  | 379 | "tools/timer/Timer.cpp", | 
|  | 380 | ] | 
|  | 381 | deps = [ | 
|  | 382 | ":flags", | 
|  | 383 | ] | 
|  | 384 | } | 
|  | 385 |  | 
|  | 386 | gm_sources = exec_script("gyp/find.py", | 
|  | 387 | [ | 
|  | 388 | rebase_path("gm"), | 
|  | 389 | "*.c*", | 
|  | 390 | ], | 
|  | 391 | "list lines", | 
|  | 392 | []) | 
|  | 393 | test_lib("gm") { | 
|  | 394 | public_include_dirs = [ "gm" ] | 
|  | 395 | sources = gm_sources | 
|  | 396 | deps = [ | 
|  | 397 | ":gpu_tool_utils", | 
|  | 398 | ":skia", | 
|  | 399 | ":tool_utils", | 
|  | 400 | ] | 
|  | 401 | } | 
|  | 402 |  | 
|  | 403 | executable("dm") { | 
|  | 404 | sources = [ | 
|  | 405 | "dm/DM.cpp", | 
|  | 406 | "dm/DMJsonWriter.cpp", | 
|  | 407 | "dm/DMSrcSink.cpp", | 
|  | 408 |  | 
|  | 409 | # TODO: tests for real | 
|  | 410 | "tests/Test.cpp", | 
|  | 411 | ] | 
|  | 412 | include_dirs = [ "tests" ] | 
|  | 413 | deps = [ | 
|  | 414 | ":flags", | 
|  | 415 | ":gm", | 
|  | 416 | ":gpu_tool_utils", | 
|  | 417 | ":skia", | 
|  | 418 | ":tool_utils", | 
|  | 419 | "//third_party/jsoncpp", | 
|  | 420 | "//third_party/libpng", | 
|  | 421 | ] | 
|  | 422 | testonly = true | 
|  | 423 | } |