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() { |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 7 | skia_use_libwebp = !is_fuchsia |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 8 | } |
| 9 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 10 | skia_public_includes = [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 11 | "include/android", |
mtklein | fa84d94 | 2016-07-28 09:45:14 -0700 | [diff] [blame] | 12 | "include/c", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 13 | "include/codec", |
| 14 | "include/config", |
| 15 | "include/core", |
| 16 | "include/effects", |
| 17 | "include/gpu", |
| 18 | "include/gpu/gl", |
| 19 | "include/images", |
| 20 | "include/pathops", |
| 21 | "include/ports", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 22 | "include/svg", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 23 | "include/utils", |
| 24 | "include/utils/mac", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 25 | "include/xml", |
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", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 53 | "src/pdf", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 54 | "src/ports", |
| 55 | "src/sfnt", |
| 56 | "src/utils", |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 57 | "src/utils/win", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 58 | "third_party/etc1", |
| 59 | "third_party/ktx", |
| 60 | ] |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 61 | |
| 62 | defines = [ |
mtklein | 9be6866 | 2016-08-01 08:37:48 -0700 | [diff] [blame] | 63 | "SK_GAMMA_APPLY_TO_A8", |
| 64 | |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 65 | "SK_HAS_GIF_LIBRARY", |
| 66 | "SK_HAS_JPEG_LIBRARY", |
| 67 | "SK_HAS_PNG_LIBRARY", |
mtklein | 7c1ae7a | 2016-08-01 15:50:27 -0700 | [diff] [blame] | 68 | |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 69 | # TODO(halcanary): make this the default; this is the value Android uses. |
| 70 | "SK_SFNTLY_SUBSETTER=\"sample/chromium/font_subsetter.h\"", |
mtklein | 150d113 | 2016-08-01 06:56:40 -0700 | [diff] [blame] | 71 | ] |
mtklein | ee269f4 | 2016-08-04 09:52:11 -0700 | [diff] [blame] | 72 | if (is_linux) { |
| 73 | defines += [ "SK_SAMPLES_FOR_X" ] |
| 74 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | # Any code that's linked into Skia-the-library should use this config via += skia_library_configs. |
| 78 | config("skia_library") { |
| 79 | visibility = [ ":*" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 80 | defines = [ "SKIA_IMPLEMENTATION=1" ] |
| 81 | } |
| 82 | |
| 83 | skia_library_configs = [ |
| 84 | ":skia_public", |
| 85 | ":skia_private", |
| 86 | ":skia_library", |
| 87 | ] |
| 88 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 89 | core_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 90 | [ |
| 91 | rebase_path("gyp/core.gypi"), |
| 92 | "--replace=<(skia_include_path)=include", |
| 93 | "--replace=<(skia_src_path)=src", |
| 94 | ], |
| 95 | "scope", |
| 96 | [ "gyp/core.gypi" ]) |
| 97 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 98 | effects_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 99 | [ |
| 100 | rebase_path("gyp/effects.gypi"), |
| 101 | "--replace=<(skia_include_path)=include", |
| 102 | "--replace=<(skia_src_path)=src", |
| 103 | ], |
| 104 | "scope", |
| 105 | [ "gyp/effects.gypi" ]) |
| 106 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 107 | gpu_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 108 | [ |
| 109 | rebase_path("gyp/gpu.gypi"), |
| 110 | "--replace=<(skia_include_path)=include", |
| 111 | "--replace=<(skia_src_path)=src", |
| 112 | ], |
| 113 | "scope", |
| 114 | [ "gyp/gpu.gypi" ]) |
| 115 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 116 | opts_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 117 | [ |
| 118 | rebase_path("gyp/opts.gypi"), |
| 119 | "--replace=<(skia_include_path)=include", |
| 120 | "--replace=<(skia_src_path)=src", |
| 121 | ], |
| 122 | "scope", |
| 123 | [ "gyp/opts.gypi" ]) |
| 124 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 125 | pdf_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 126 | [ |
| 127 | rebase_path("gyp/pdf.gypi"), |
| 128 | "--replace=<(skia_include_path)=include", |
| 129 | "--replace=<(skia_src_path)=src", |
| 130 | ], |
| 131 | "scope", |
| 132 | [ "gyp/pdf.gypi" ]) |
| 133 | |
mtklein | 7fbfbbe | 2016-07-21 12:25:45 -0700 | [diff] [blame] | 134 | utils_gypi = exec_script("gn/gypi_to_gn.py", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 135 | [ |
| 136 | rebase_path("gyp/utils.gypi"), |
| 137 | "--replace=<(skia_include_path)=include", |
| 138 | "--replace=<(skia_src_path)=src", |
| 139 | ], |
| 140 | "scope", |
| 141 | [ "gyp/utils.gypi" ]) |
| 142 | |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 143 | source_set("opts_none") { |
| 144 | configs += skia_library_configs |
| 145 | sources = opts_gypi.none_sources |
| 146 | } |
| 147 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 148 | is_x86 = current_cpu == "x64" || current_cpu == "x86" |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 149 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 150 | if (is_x86) { |
| 151 | source_set("opts_sse2") { |
| 152 | configs += skia_library_configs |
| 153 | sources = opts_gypi.sse2_sources |
| 154 | cflags = [ "-msse2" ] |
| 155 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 156 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 157 | source_set("opts_ssse3") { |
| 158 | configs += skia_library_configs |
| 159 | sources = opts_gypi.ssse3_sources |
| 160 | cflags = [ "-mssse3" ] |
| 161 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 162 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 163 | source_set("opts_sse41") { |
| 164 | configs += skia_library_configs |
| 165 | sources = opts_gypi.sse41_sources |
| 166 | cflags = [ "-msse4.1" ] |
| 167 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 168 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 169 | source_set("opts_sse42") { |
| 170 | configs += skia_library_configs |
| 171 | sources = opts_gypi.sse42_sources |
| 172 | cflags = [ "-msse4.2" ] |
| 173 | } |
mtklein | 4e97607 | 2016-08-08 09:06:27 -0700 | [diff] [blame] | 174 | |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 175 | source_set("opts_avx") { |
| 176 | configs += skia_library_configs |
| 177 | sources = opts_gypi.avx_sources |
| 178 | cflags = [ "-mavx" ] |
| 179 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 180 | } |
| 181 | |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 182 | if (skia_use_libwebp) { |
| 183 | config("webp_config") { |
| 184 | defines = [ "SK_HAS_WEBP_LIBRARY" ] |
| 185 | } |
| 186 | source_set("webp") { |
| 187 | configs += skia_library_configs |
| 188 | all_dependent_configs = [ ":webp_config" ] |
| 189 | deps = [ |
| 190 | "//third_party/libwebp", |
| 191 | ] |
| 192 | sources = [ |
| 193 | "src/codec/SkWebpAdapterCodec.cpp", |
| 194 | "src/codec/SkWebpCodec.cpp", |
| 195 | "src/images/SkWEBPImageEncoder.cpp", |
| 196 | ] |
| 197 | } |
| 198 | } else { |
| 199 | source_set("webp") { |
| 200 | } |
| 201 | } |
| 202 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 203 | component("skia") { |
| 204 | public_configs = [ ":skia_public" ] |
| 205 | configs += skia_library_configs |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 206 | |
| 207 | deps = [ |
mtklein | eb3c425 | 2016-08-23 07:38:09 -0700 | [diff] [blame] | 208 | ":webp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 209 | "//third_party/expat", |
| 210 | "//third_party/giflib", |
mtklein | 0a8efd7 | 2016-08-22 06:32:39 -0700 | [diff] [blame] | 211 | "//third_party/libjpeg-turbo:libjpeg", |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 212 | "//third_party/libpng", |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 213 | "//third_party/sfntly", |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 214 | "//third_party/zlib", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 215 | ] |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 216 | if (is_x86) { |
| 217 | deps += [ |
| 218 | ":opts_avx", |
| 219 | ":opts_sse2", |
| 220 | ":opts_sse41", |
| 221 | ":opts_sse42", |
| 222 | ":opts_ssse3", |
| 223 | ] |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 224 | } else { |
| 225 | deps += [ ":opts_none" ] |
mtklein | 422310d | 2016-08-16 18:28:43 -0700 | [diff] [blame] | 226 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 227 | |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 228 | if (!is_win) { |
| 229 | libs = [ "pthread" ] |
| 230 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 231 | |
| 232 | sources = [] |
| 233 | sources += core_gypi.sources |
| 234 | sources += effects_gypi.sources |
| 235 | sources += gpu_gypi.skgpu_sources |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 236 | sources += pdf_gypi.sources |
| 237 | sources += utils_gypi.sources |
| 238 | sources += [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 239 | "src/android/SkBitmapRegionCodec.cpp", |
| 240 | "src/android/SkBitmapRegionDecoder.cpp", |
| 241 | "src/codec/SkAndroidCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 242 | "src/codec/SkBmpCodec.cpp", |
| 243 | "src/codec/SkBmpMaskCodec.cpp", |
| 244 | "src/codec/SkBmpRLECodec.cpp", |
| 245 | "src/codec/SkBmpStandardCodec.cpp", |
| 246 | "src/codec/SkCodec.cpp", |
| 247 | "src/codec/SkCodecImageGenerator.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 248 | "src/codec/SkGifCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 249 | "src/codec/SkIcoCodec.cpp", |
| 250 | "src/codec/SkJpegCodec.cpp", |
| 251 | "src/codec/SkJpegDecoderMgr.cpp", |
| 252 | "src/codec/SkJpegUtility.cpp", |
| 253 | "src/codec/SkMaskSwizzler.cpp", |
| 254 | "src/codec/SkMasks.cpp", |
| 255 | "src/codec/SkPngCodec.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 256 | "src/codec/SkSampledCodec.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 257 | "src/codec/SkSampler.cpp", |
| 258 | "src/codec/SkSwizzler.cpp", |
| 259 | "src/codec/SkWbmpCodec.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 260 | "src/images/SkImageEncoder.cpp", |
| 261 | "src/images/SkImageEncoder_Factory.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 262 | "src/images/SkJPEGImageEncoder.cpp", |
| 263 | "src/images/SkJPEGWriteUtility.cpp", |
| 264 | "src/images/SkKTXImageEncoder.cpp", |
| 265 | "src/images/SkPNGImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 266 | "src/ports/SkDiscardableMemory_none.cpp", |
| 267 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 268 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 269 | "src/ports/SkMemory_malloc.cpp", |
| 270 | "src/ports/SkOSFile_stdio.cpp", |
| 271 | "src/sfnt/SkOTTable_name.cpp", |
| 272 | "src/sfnt/SkOTUtils.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 273 | "src/svg/SkSVGCanvas.cpp", |
| 274 | "src/svg/SkSVGDevice.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 275 | "src/utils/mac/SkStream_mac.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 276 | "src/xml/SkDOM.cpp", |
| 277 | "src/xml/SkXMLParser.cpp", |
| 278 | "src/xml/SkXMLWriter.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 279 | "third_party/etc1/etc1.cpp", |
| 280 | "third_party/ktx/ktx.cpp", |
| 281 | ] |
| 282 | |
| 283 | if (is_win) { |
| 284 | sources += [ |
| 285 | "src/ports/SkDebug_win.cpp", |
| 286 | "src/ports/SkFontHost_win.cpp", |
| 287 | "src/ports/SkFontMgr_win_dw.cpp", |
| 288 | "src/ports/SkFontMgr_win_dw_factory.cpp", |
| 289 | "src/ports/SkImageEncoder_WIC.cpp", |
| 290 | "src/ports/SkImageGeneratorWIC.cpp", |
| 291 | "src/ports/SkOSFile_win.cpp", |
| 292 | "src/ports/SkScalerContext_win_dw.cpp", |
| 293 | "src/ports/SkTLS_win.cpp", |
| 294 | "src/ports/SkTypeface_win_dw.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 295 | "src/xps/SkDocument_XPS.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 296 | ] |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 297 | sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 298 | } else { |
| 299 | sources += [ |
| 300 | "src/ports/SkDebug_stdio.cpp", |
| 301 | "src/ports/SkOSFile_posix.cpp", |
| 302 | "src/ports/SkTLS_pthread.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 303 | "src/xps/SkDocument_XPS_None.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 304 | ] |
| 305 | } |
| 306 | |
| 307 | if (is_linux) { |
| 308 | deps += [ |
| 309 | "third_party:fontconfig", |
| 310 | "third_party:freetype2", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 311 | ] |
| 312 | sources += [ |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 313 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 314 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 315 | "src/ports/SkFontHost_FreeType.cpp", |
| 316 | "src/ports/SkFontHost_FreeType_common.cpp", |
bungeman | 7d0e3bc | 2016-08-02 07:07:33 -0700 | [diff] [blame] | 317 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
mtklein | 7a34b1c | 2016-08-01 13:08:46 -0700 | [diff] [blame] | 318 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 319 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 320 | ] |
| 321 | } |
| 322 | |
| 323 | if (is_mac) { |
| 324 | sources += [ |
| 325 | "src/ports/SkFontHost_mac.cpp", |
| 326 | "src/ports/SkImageEncoder_CG.cpp", |
| 327 | "src/ports/SkImageGeneratorCG.cpp", |
| 328 | ] |
| 329 | libs += [ "ApplicationServices.framework" ] |
| 330 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 331 | |
| 332 | if (is_fuchsia) { |
mtklein | e817ddf | 2016-07-19 06:03:22 -0700 | [diff] [blame] | 333 | sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 334 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 335 | } |
| 336 | |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 337 | skia_h_headers = exec_script("gyp/find.py", |
| 338 | [ "*.h" ] + rebase_path(skia_public_includes), |
| 339 | "list lines", |
| 340 | []) - |
| 341 | [ |
| 342 | rebase_path("include/gpu/gl/GrGLConfig_chrome.h"), |
| 343 | rebase_path("include/gpu/vk/GrVkBackendContext.h"), |
| 344 | rebase_path("include/gpu/vk/GrVkDefines.h"), |
| 345 | rebase_path("include/gpu/vk/GrVkInterface.h"), |
| 346 | rebase_path("include/gpu/vk/GrVkTypes.h"), |
| 347 | rebase_path("include/ports/SkFontMgr_fontconfig.h"), |
| 348 | ] |
| 349 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 350 | action("skia.h") { |
| 351 | script = "gn/echo_headers.py" |
| 352 | args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 353 | rebase_path(skia_h_headers, root_build_dir) |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 354 | outputs = [ |
| 355 | "$target_gen_dir/skia.h", |
| 356 | ] |
| 357 | } |
| 358 | |
| 359 | executable("fiddle") { |
| 360 | include_dirs = [ "$target_gen_dir" ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 361 | libs = [] |
| 362 | if (is_linux) { |
| 363 | libs += [ "OSMesa" ] |
| 364 | } |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 365 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 366 | sources = [ |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 367 | "tools/fiddle/draw.cpp", |
| 368 | "tools/fiddle/fiddle_main.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 369 | ] |
| 370 | deps = [ |
| 371 | ":skia", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 372 | ":skia.h", |
mtklein | 5dbd274 | 2016-08-02 11:13:48 -0700 | [diff] [blame] | 373 | ":tool_utils", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 374 | ] |
mtklein | 5dbd274 | 2016-08-02 11:13:48 -0700 | [diff] [blame] | 375 | testonly = true |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 376 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 377 | |
| 378 | template("test_lib") { |
| 379 | config(target_name + "_config") { |
| 380 | include_dirs = invoker.public_include_dirs |
| 381 | } |
| 382 | source_set(target_name) { |
| 383 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 384 | public_configs = [ |
| 385 | ":" + target_name + "_config", |
| 386 | ":skia_private", |
| 387 | ] |
| 388 | |
| 389 | if (!defined(deps)) { |
| 390 | deps = [] |
| 391 | } |
| 392 | deps += [ ":skia" ] |
| 393 | testonly = true |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | test_lib("gpu_tool_utils") { |
| 398 | public_include_dirs = [ "tools/gpu" ] |
| 399 | sources = [ |
| 400 | "tools/gpu/GrContextFactory.cpp", |
| 401 | "tools/gpu/GrTest.cpp", |
| 402 | "tools/gpu/TestContext.cpp", |
| 403 | "tools/gpu/gl/GLTestContext.cpp", |
| 404 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", |
| 405 | "tools/gpu/gl/debug/GrBufferObj.cpp", |
| 406 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", |
| 407 | "tools/gpu/gl/debug/GrProgramObj.cpp", |
| 408 | "tools/gpu/gl/debug/GrShaderObj.cpp", |
| 409 | "tools/gpu/gl/debug/GrTextureObj.cpp", |
| 410 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", |
| 411 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 412 | ] |
| 413 | libs = [] |
| 414 | |
| 415 | if (is_linux) { |
mtklein | 5259da5 | 2016-08-03 08:28:20 -0700 | [diff] [blame] | 416 | sources += [ |
mtklein | 4db3b79 | 2016-08-03 14:18:22 -0700 | [diff] [blame] | 417 | "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp", |
| 418 | "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp", |
mtklein | 5259da5 | 2016-08-03 08:28:20 -0700 | [diff] [blame] | 419 | ] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 420 | libs += [ |
| 421 | "GL", |
| 422 | "GLU", |
| 423 | "X11", |
| 424 | ] |
| 425 | } else if (is_mac) { |
mtklein | 5259da5 | 2016-08-03 08:28:20 -0700 | [diff] [blame] | 426 | sources += [ |
mtklein | 4db3b79 | 2016-08-03 14:18:22 -0700 | [diff] [blame] | 427 | "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp", |
| 428 | "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp", |
mtklein | 5259da5 | 2016-08-03 08:28:20 -0700 | [diff] [blame] | 429 | ] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 430 | libs += [ "OpenGL.framework" ] |
| 431 | } |
| 432 | } |
| 433 | |
| 434 | test_lib("flags") { |
| 435 | public_include_dirs = [ "tools/flags" ] |
| 436 | sources = [ |
| 437 | "tools/flags/SkCommandLineFlags.cpp", |
| 438 | "tools/flags/SkCommonFlags.cpp", |
| 439 | "tools/flags/SkCommonFlagsConfig.cpp", |
| 440 | ] |
| 441 | deps = [ |
| 442 | ":gpu_tool_utils", |
| 443 | ] |
| 444 | } |
| 445 | |
| 446 | test_lib("tool_utils") { |
| 447 | public_include_dirs = [ |
| 448 | "tools", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 449 | "tools/debugger", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 450 | "tools/timer", |
| 451 | ] |
| 452 | sources = [ |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 453 | "src/images/SkForceLinking.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 454 | "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools? |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 455 | "tools/CrashHandler.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 456 | "tools/ProcStats.cpp", |
| 457 | "tools/Resources.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 458 | "tools/ThermalManager.cpp", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 459 | "tools/UrlDataManager.cpp", |
| 460 | "tools/debugger/SkDebugCanvas.cpp", |
| 461 | "tools/debugger/SkDrawCommand.cpp", |
| 462 | "tools/debugger/SkJsonWriteBuffer.cpp", |
| 463 | "tools/debugger/SkObjectParser.cpp", |
| 464 | "tools/debugger/SkOverdrawMode.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 465 | "tools/picture_utils.cpp", |
| 466 | "tools/random_parse_path.cpp", |
| 467 | "tools/sk_tool_utils.cpp", |
| 468 | "tools/sk_tool_utils_font.cpp", |
| 469 | "tools/timer/Timer.cpp", |
| 470 | ] |
| 471 | deps = [ |
| 472 | ":flags", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 473 | "//third_party/libpng", |
| 474 | ] |
| 475 | public_deps = [ |
| 476 | "//third_party/jsoncpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 477 | ] |
| 478 | } |
| 479 | |
| 480 | gm_sources = exec_script("gyp/find.py", |
| 481 | [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 482 | "*.c*", |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 483 | rebase_path("gm"), |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 484 | ], |
| 485 | "list lines", |
| 486 | []) |
| 487 | test_lib("gm") { |
| 488 | public_include_dirs = [ "gm" ] |
| 489 | sources = gm_sources |
| 490 | deps = [ |
| 491 | ":gpu_tool_utils", |
| 492 | ":skia", |
| 493 | ":tool_utils", |
| 494 | ] |
| 495 | } |
| 496 | |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 497 | tests_sources = exec_script("gyp/find.py", |
| 498 | [ |
| 499 | "*.c*", |
| 500 | rebase_path("tests"), |
| 501 | ], |
| 502 | "list lines", |
| 503 | []) |
| 504 | |
| 505 | test_lib("tests") { |
| 506 | public_include_dirs = [ "tests" ] |
| 507 | sources = tests_sources - [ |
| 508 | rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only |
| 509 | rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main |
mtklein | 4db3b79 | 2016-08-03 14:18:22 -0700 | [diff] [blame] | 510 | rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work |
| 511 | rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 512 | rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile |
| 513 | rebase_path("tests/skia_test.cpp"), # alternate main |
| 514 | ] |
| 515 | deps = [ |
| 516 | ":flags", |
| 517 | ":gpu_tool_utils", |
| 518 | ":skia", |
| 519 | ":tool_utils", |
| 520 | "//third_party/libpng", |
| 521 | "//third_party/zlib", |
| 522 | ] |
| 523 | } |
| 524 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 525 | bench_sources = exec_script("gyp/find.py", |
| 526 | [ |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 527 | "*.c*", |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 528 | rebase_path("bench"), |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 529 | ], |
| 530 | "list lines", |
| 531 | []) |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 532 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 533 | test_lib("bench") { |
| 534 | public_include_dirs = [ "bench" ] |
| 535 | sources = bench_sources |
| 536 | sources -= [ |
| 537 | rebase_path("bench/nanobench.cpp"), |
| 538 | rebase_path("bench/nanobenchAndroid.cpp"), |
| 539 | ] |
| 540 | deps = [ |
| 541 | ":flags", |
| 542 | ":gm", |
| 543 | ":gpu_tool_utils", |
| 544 | ":skia", |
| 545 | ":tool_utils", |
| 546 | ] |
| 547 | } |
| 548 | |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 549 | test_lib("experimental_svg_model") { |
| 550 | public_include_dirs = [ "experimental/svg/model" ] |
| 551 | sources = [ |
| 552 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 553 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
fmalita | dc4c2a9 | 2016-08-16 15:38:51 -0700 | [diff] [blame] | 554 | "experimental/svg/model/SkSVGCircle.cpp", |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 555 | "experimental/svg/model/SkSVGContainer.cpp", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 556 | "experimental/svg/model/SkSVGDOM.cpp", |
fmalita | dc4c2a9 | 2016-08-16 15:38:51 -0700 | [diff] [blame] | 557 | "experimental/svg/model/SkSVGEllipse.cpp", |
fmalita | d24ee14 | 2016-08-17 08:38:15 -0700 | [diff] [blame] | 558 | "experimental/svg/model/SkSVGLine.cpp", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 559 | "experimental/svg/model/SkSVGNode.cpp", |
| 560 | "experimental/svg/model/SkSVGPath.cpp", |
fmalita | 5b31f32 | 2016-08-12 12:15:33 -0700 | [diff] [blame] | 561 | "experimental/svg/model/SkSVGPoly.cpp", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 562 | "experimental/svg/model/SkSVGRect.cpp", |
| 563 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 564 | "experimental/svg/model/SkSVGSVG.cpp", |
| 565 | "experimental/svg/model/SkSVGShape.cpp", |
| 566 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 567 | "experimental/svg/model/SkSVGValue.cpp", |
| 568 | ] |
| 569 | deps = [ |
| 570 | ":skia", |
| 571 | ] |
| 572 | } |
| 573 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 574 | if (!is_component_build) { # Our test tools use many non-SK_API APIs... |
| 575 | executable("dm") { |
| 576 | sources = [ |
| 577 | "dm/DM.cpp", |
| 578 | "dm/DMJsonWriter.cpp", |
| 579 | "dm/DMSrcSink.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 580 | ] |
| 581 | include_dirs = [ "tests" ] |
| 582 | deps = [ |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 583 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 584 | ":flags", |
| 585 | ":gm", |
| 586 | ":gpu_tool_utils", |
| 587 | ":skia", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 588 | ":tests", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 589 | ":tool_utils", |
| 590 | "//third_party/jsoncpp", |
| 591 | "//third_party/libpng", |
| 592 | ] |
| 593 | testonly = true |
| 594 | } |
| 595 | |
| 596 | executable("monobench") { |
| 597 | sources = [ |
| 598 | "tools/monobench.cpp", |
| 599 | ] |
| 600 | deps = [ |
| 601 | ":bench", |
| 602 | ":skia", |
| 603 | ] |
| 604 | testonly = true |
| 605 | } |
| 606 | |
| 607 | executable("nanobench") { |
| 608 | sources = [ |
| 609 | "bench/nanobench.cpp", |
| 610 | ] |
| 611 | deps = [ |
| 612 | ":bench", |
| 613 | ":flags", |
| 614 | ":gm", |
| 615 | ":gpu_tool_utils", |
| 616 | ":skia", |
| 617 | ":tool_utils", |
| 618 | "//third_party/jsoncpp", |
| 619 | ] |
| 620 | testonly = true |
| 621 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 622 | |
| 623 | executable("sktexttopdf") { |
| 624 | sources = [ |
| 625 | "tools/SkShaper_harfbuzz.cpp", |
| 626 | "tools/using_skia_and_harfbuzz.cpp", |
| 627 | ] |
| 628 | deps = [ |
| 629 | ":skia", |
| 630 | "//third_party/harfbuzz", |
| 631 | ] |
| 632 | testonly = true |
| 633 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 634 | } |