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 | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 260 | "src/gpu/gl/GrGLDefaultInterface_native.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 261 | "src/images/SkImageEncoder.cpp", |
| 262 | "src/images/SkImageEncoder_Factory.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 263 | "src/images/SkJPEGImageEncoder.cpp", |
| 264 | "src/images/SkJPEGWriteUtility.cpp", |
| 265 | "src/images/SkKTXImageEncoder.cpp", |
| 266 | "src/images/SkPNGImageEncoder.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 267 | "src/ports/SkDiscardableMemory_none.cpp", |
| 268 | "src/ports/SkGlobalInitialization_default.cpp", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 269 | "src/ports/SkImageGenerator_skia.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 270 | "src/ports/SkMemory_malloc.cpp", |
| 271 | "src/ports/SkOSFile_stdio.cpp", |
| 272 | "src/sfnt/SkOTTable_name.cpp", |
| 273 | "src/sfnt/SkOTUtils.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 274 | "src/svg/SkSVGCanvas.cpp", |
| 275 | "src/svg/SkSVGDevice.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 276 | "src/utils/mac/SkStream_mac.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 277 | "src/xml/SkDOM.cpp", |
| 278 | "src/xml/SkXMLParser.cpp", |
| 279 | "src/xml/SkXMLWriter.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 280 | "third_party/etc1/etc1.cpp", |
| 281 | "third_party/ktx/ktx.cpp", |
| 282 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 283 | sources -= [ |
| 284 | "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", |
| 285 | "src/gpu/gl/GrGLDefaultInterface_none.cpp", |
| 286 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 287 | |
| 288 | if (is_win) { |
| 289 | sources += [ |
| 290 | "src/ports/SkDebug_win.cpp", |
| 291 | "src/ports/SkFontHost_win.cpp", |
| 292 | "src/ports/SkFontMgr_win_dw.cpp", |
| 293 | "src/ports/SkFontMgr_win_dw_factory.cpp", |
| 294 | "src/ports/SkImageEncoder_WIC.cpp", |
| 295 | "src/ports/SkImageGeneratorWIC.cpp", |
| 296 | "src/ports/SkOSFile_win.cpp", |
| 297 | "src/ports/SkScalerContext_win_dw.cpp", |
| 298 | "src/ports/SkTLS_win.cpp", |
| 299 | "src/ports/SkTypeface_win_dw.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 300 | "src/xps/SkDocument_XPS.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 301 | ] |
mtklein | 7a1f45f | 2016-08-04 06:19:33 -0700 | [diff] [blame] | 302 | sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 303 | } else { |
| 304 | sources += [ |
| 305 | "src/ports/SkDebug_stdio.cpp", |
| 306 | "src/ports/SkOSFile_posix.cpp", |
| 307 | "src/ports/SkTLS_pthread.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 308 | "src/xps/SkDocument_XPS_None.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 309 | ] |
| 310 | } |
| 311 | |
| 312 | if (is_linux) { |
| 313 | deps += [ |
| 314 | "third_party:fontconfig", |
| 315 | "third_party:freetype2", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 316 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 317 | libs += [ |
| 318 | "GL", |
| 319 | "GLU", |
| 320 | "X11", |
| 321 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 322 | sources += [ |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 323 | "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 324 | "src/ports/SkFontConfigInterface_direct.cpp", |
| 325 | "src/ports/SkFontConfigInterface_direct_factory.cpp", |
| 326 | "src/ports/SkFontHost_FreeType.cpp", |
| 327 | "src/ports/SkFontHost_FreeType_common.cpp", |
bungeman | 7d0e3bc | 2016-08-02 07:07:33 -0700 | [diff] [blame] | 328 | "src/ports/SkFontMgr_FontConfigInterface.cpp", |
mtklein | 7a34b1c | 2016-08-01 13:08:46 -0700 | [diff] [blame] | 329 | "src/ports/SkFontMgr_fontconfig.cpp", |
| 330 | "src/ports/SkFontMgr_fontconfig_factory.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 331 | ] |
| 332 | } |
| 333 | |
| 334 | if (is_mac) { |
| 335 | sources += [ |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 336 | "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 337 | "src/ports/SkFontHost_mac.cpp", |
| 338 | "src/ports/SkImageEncoder_CG.cpp", |
| 339 | "src/ports/SkImageGeneratorCG.cpp", |
| 340 | ] |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 341 | libs += [ |
| 342 | "ApplicationServices.framework", |
| 343 | "OpenGL.framework", |
| 344 | ] |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 345 | } |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 346 | |
| 347 | if (is_fuchsia) { |
mtklein | e817ddf | 2016-07-19 06:03:22 -0700 | [diff] [blame] | 348 | sources += [ "src/ports/SkFontMgr_empty_factory.cpp" ] |
abarth | 6fc8ff0 | 2016-07-15 15:15:15 -0700 | [diff] [blame] | 349 | } |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 350 | } |
| 351 | |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 352 | skia_h_headers = exec_script("gyp/find.py", |
| 353 | [ "*.h" ] + rebase_path(skia_public_includes), |
| 354 | "list lines", |
| 355 | []) - |
| 356 | [ |
| 357 | rebase_path("include/gpu/gl/GrGLConfig_chrome.h"), |
| 358 | rebase_path("include/gpu/vk/GrVkBackendContext.h"), |
| 359 | rebase_path("include/gpu/vk/GrVkDefines.h"), |
| 360 | rebase_path("include/gpu/vk/GrVkInterface.h"), |
| 361 | rebase_path("include/gpu/vk/GrVkTypes.h"), |
| 362 | rebase_path("include/ports/SkFontMgr_fontconfig.h"), |
| 363 | ] |
| 364 | |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 365 | action("skia.h") { |
| 366 | script = "gn/echo_headers.py" |
| 367 | args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] + |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 368 | rebase_path(skia_h_headers, root_build_dir) |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 369 | outputs = [ |
| 370 | "$target_gen_dir/skia.h", |
| 371 | ] |
| 372 | } |
| 373 | |
| 374 | executable("fiddle") { |
| 375 | include_dirs = [ "$target_gen_dir" ] |
mtklein | 7d10b9f | 2016-07-27 11:17:18 -0700 | [diff] [blame] | 376 | libs = [] |
| 377 | if (is_linux) { |
| 378 | libs += [ "OSMesa" ] |
| 379 | } |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 380 | |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 381 | sources = [ |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 382 | "tools/fiddle/draw.cpp", |
| 383 | "tools/fiddle/fiddle_main.cpp", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 384 | ] |
| 385 | deps = [ |
| 386 | ":skia", |
mtklein | 1211e0c | 2016-07-26 13:55:45 -0700 | [diff] [blame] | 387 | ":skia.h", |
mtklein | 5dbd274 | 2016-08-02 11:13:48 -0700 | [diff] [blame] | 388 | ":tool_utils", |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 389 | ] |
mtklein | 5dbd274 | 2016-08-02 11:13:48 -0700 | [diff] [blame] | 390 | testonly = true |
mtklein | c04ff47 | 2016-06-23 10:29:30 -0700 | [diff] [blame] | 391 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 392 | |
| 393 | template("test_lib") { |
| 394 | config(target_name + "_config") { |
| 395 | include_dirs = invoker.public_include_dirs |
| 396 | } |
| 397 | source_set(target_name) { |
| 398 | forward_variables_from(invoker, "*", [ "public_include_dirs" ]) |
| 399 | public_configs = [ |
| 400 | ":" + target_name + "_config", |
| 401 | ":skia_private", |
| 402 | ] |
| 403 | |
| 404 | if (!defined(deps)) { |
| 405 | deps = [] |
| 406 | } |
| 407 | deps += [ ":skia" ] |
| 408 | testonly = true |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | test_lib("gpu_tool_utils") { |
| 413 | public_include_dirs = [ "tools/gpu" ] |
| 414 | sources = [ |
| 415 | "tools/gpu/GrContextFactory.cpp", |
| 416 | "tools/gpu/GrTest.cpp", |
| 417 | "tools/gpu/TestContext.cpp", |
| 418 | "tools/gpu/gl/GLTestContext.cpp", |
| 419 | "tools/gpu/gl/debug/DebugGLTestContext.cpp", |
| 420 | "tools/gpu/gl/debug/GrBufferObj.cpp", |
| 421 | "tools/gpu/gl/debug/GrFrameBufferObj.cpp", |
| 422 | "tools/gpu/gl/debug/GrProgramObj.cpp", |
| 423 | "tools/gpu/gl/debug/GrShaderObj.cpp", |
| 424 | "tools/gpu/gl/debug/GrTextureObj.cpp", |
| 425 | "tools/gpu/gl/debug/GrTextureUnitObj.cpp", |
| 426 | "tools/gpu/gl/null/NullGLTestContext.cpp", |
| 427 | ] |
| 428 | libs = [] |
| 429 | |
| 430 | if (is_linux) { |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 431 | sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 432 | } else if (is_mac) { |
mtklein | 09e61f7 | 2016-08-23 13:35:28 -0700 | [diff] [blame^] | 433 | sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ] |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 434 | } |
| 435 | } |
| 436 | |
| 437 | test_lib("flags") { |
| 438 | public_include_dirs = [ "tools/flags" ] |
| 439 | sources = [ |
| 440 | "tools/flags/SkCommandLineFlags.cpp", |
| 441 | "tools/flags/SkCommonFlags.cpp", |
| 442 | "tools/flags/SkCommonFlagsConfig.cpp", |
| 443 | ] |
| 444 | deps = [ |
| 445 | ":gpu_tool_utils", |
| 446 | ] |
| 447 | } |
| 448 | |
| 449 | test_lib("tool_utils") { |
| 450 | public_include_dirs = [ |
| 451 | "tools", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 452 | "tools/debugger", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 453 | "tools/timer", |
| 454 | ] |
| 455 | sources = [ |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 456 | "src/images/SkForceLinking.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 457 | "src/utils/SkMultiPictureDocumentReader.cpp", # TODO(halcanary): move to tools? |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 458 | "tools/CrashHandler.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 459 | "tools/ProcStats.cpp", |
| 460 | "tools/Resources.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 461 | "tools/ThermalManager.cpp", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 462 | "tools/UrlDataManager.cpp", |
| 463 | "tools/debugger/SkDebugCanvas.cpp", |
| 464 | "tools/debugger/SkDrawCommand.cpp", |
| 465 | "tools/debugger/SkJsonWriteBuffer.cpp", |
| 466 | "tools/debugger/SkObjectParser.cpp", |
| 467 | "tools/debugger/SkOverdrawMode.cpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 468 | "tools/picture_utils.cpp", |
| 469 | "tools/random_parse_path.cpp", |
| 470 | "tools/sk_tool_utils.cpp", |
| 471 | "tools/sk_tool_utils_font.cpp", |
| 472 | "tools/timer/Timer.cpp", |
| 473 | ] |
| 474 | deps = [ |
| 475 | ":flags", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 476 | "//third_party/libpng", |
| 477 | ] |
| 478 | public_deps = [ |
| 479 | "//third_party/jsoncpp", |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 480 | ] |
| 481 | } |
| 482 | |
| 483 | gm_sources = exec_script("gyp/find.py", |
| 484 | [ |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 485 | "*.c*", |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 486 | rebase_path("gm"), |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 487 | ], |
| 488 | "list lines", |
| 489 | []) |
| 490 | test_lib("gm") { |
| 491 | public_include_dirs = [ "gm" ] |
| 492 | sources = gm_sources |
| 493 | deps = [ |
| 494 | ":gpu_tool_utils", |
| 495 | ":skia", |
| 496 | ":tool_utils", |
| 497 | ] |
| 498 | } |
| 499 | |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 500 | tests_sources = exec_script("gyp/find.py", |
| 501 | [ |
| 502 | "*.c*", |
| 503 | rebase_path("tests"), |
| 504 | ], |
| 505 | "list lines", |
| 506 | []) |
| 507 | |
| 508 | test_lib("tests") { |
| 509 | public_include_dirs = [ "tests" ] |
| 510 | sources = tests_sources - [ |
| 511 | rebase_path("tests/FontMgrAndroidParserTest.cpp"), # Android only |
| 512 | rebase_path("tests/PathOpsSkpClipTest.cpp"), # alternate main |
mtklein | 4db3b79 | 2016-08-03 14:18:22 -0700 | [diff] [blame] | 513 | rebase_path("tests/SkSLErrorTest.cpp"), # TODO: make work |
| 514 | rebase_path("tests/SkSLGLSLTest.cpp"), # TODO: make work |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 515 | rebase_path("tests/SkpSkGrTest.cpp"), # doesn't compile |
| 516 | rebase_path("tests/skia_test.cpp"), # alternate main |
| 517 | ] |
| 518 | deps = [ |
| 519 | ":flags", |
| 520 | ":gpu_tool_utils", |
| 521 | ":skia", |
| 522 | ":tool_utils", |
| 523 | "//third_party/libpng", |
| 524 | "//third_party/zlib", |
| 525 | ] |
| 526 | } |
| 527 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 528 | bench_sources = exec_script("gyp/find.py", |
| 529 | [ |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 530 | "*.c*", |
mtklein | ada5a44 | 2016-08-02 14:28:26 -0700 | [diff] [blame] | 531 | rebase_path("bench"), |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 532 | ], |
| 533 | "list lines", |
| 534 | []) |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 535 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 536 | test_lib("bench") { |
| 537 | public_include_dirs = [ "bench" ] |
| 538 | sources = bench_sources |
| 539 | sources -= [ |
| 540 | rebase_path("bench/nanobench.cpp"), |
| 541 | rebase_path("bench/nanobenchAndroid.cpp"), |
| 542 | ] |
| 543 | deps = [ |
| 544 | ":flags", |
| 545 | ":gm", |
| 546 | ":gpu_tool_utils", |
| 547 | ":skia", |
| 548 | ":tool_utils", |
| 549 | ] |
| 550 | } |
| 551 | |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 552 | test_lib("experimental_svg_model") { |
| 553 | public_include_dirs = [ "experimental/svg/model" ] |
| 554 | sources = [ |
| 555 | "experimental/svg/model/SkSVGAttribute.cpp", |
| 556 | "experimental/svg/model/SkSVGAttributeParser.cpp", |
fmalita | dc4c2a9 | 2016-08-16 15:38:51 -0700 | [diff] [blame] | 557 | "experimental/svg/model/SkSVGCircle.cpp", |
anmittal | a7eaf2e | 2016-08-17 13:57:26 -0700 | [diff] [blame] | 558 | "experimental/svg/model/SkSVGContainer.cpp", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 559 | "experimental/svg/model/SkSVGDOM.cpp", |
fmalita | dc4c2a9 | 2016-08-16 15:38:51 -0700 | [diff] [blame] | 560 | "experimental/svg/model/SkSVGEllipse.cpp", |
fmalita | d24ee14 | 2016-08-17 08:38:15 -0700 | [diff] [blame] | 561 | "experimental/svg/model/SkSVGLine.cpp", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 562 | "experimental/svg/model/SkSVGNode.cpp", |
| 563 | "experimental/svg/model/SkSVGPath.cpp", |
fmalita | 5b31f32 | 2016-08-12 12:15:33 -0700 | [diff] [blame] | 564 | "experimental/svg/model/SkSVGPoly.cpp", |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 565 | "experimental/svg/model/SkSVGRect.cpp", |
| 566 | "experimental/svg/model/SkSVGRenderContext.cpp", |
| 567 | "experimental/svg/model/SkSVGSVG.cpp", |
| 568 | "experimental/svg/model/SkSVGShape.cpp", |
| 569 | "experimental/svg/model/SkSVGTransformableNode.cpp", |
| 570 | "experimental/svg/model/SkSVGValue.cpp", |
| 571 | ] |
| 572 | deps = [ |
| 573 | ":skia", |
| 574 | ] |
| 575 | } |
| 576 | |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 577 | if (!is_component_build) { # Our test tools use many non-SK_API APIs... |
| 578 | executable("dm") { |
| 579 | sources = [ |
| 580 | "dm/DM.cpp", |
| 581 | "dm/DMJsonWriter.cpp", |
| 582 | "dm/DMSrcSink.cpp", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 583 | ] |
| 584 | include_dirs = [ "tests" ] |
| 585 | deps = [ |
fmalita | a2b9fdf | 2016-08-03 19:53:36 -0700 | [diff] [blame] | 586 | ":experimental_svg_model", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 587 | ":flags", |
| 588 | ":gm", |
| 589 | ":gpu_tool_utils", |
| 590 | ":skia", |
mtklein | 2f3416d | 2016-08-02 16:02:05 -0700 | [diff] [blame] | 591 | ":tests", |
mtklein | 2b6870c | 2016-07-28 14:17:33 -0700 | [diff] [blame] | 592 | ":tool_utils", |
| 593 | "//third_party/jsoncpp", |
| 594 | "//third_party/libpng", |
| 595 | ] |
| 596 | testonly = true |
| 597 | } |
| 598 | |
| 599 | executable("monobench") { |
| 600 | sources = [ |
| 601 | "tools/monobench.cpp", |
| 602 | ] |
| 603 | deps = [ |
| 604 | ":bench", |
| 605 | ":skia", |
| 606 | ] |
| 607 | testonly = true |
| 608 | } |
| 609 | |
| 610 | executable("nanobench") { |
| 611 | sources = [ |
| 612 | "bench/nanobench.cpp", |
| 613 | ] |
| 614 | deps = [ |
| 615 | ":bench", |
| 616 | ":flags", |
| 617 | ":gm", |
| 618 | ":gpu_tool_utils", |
| 619 | ":skia", |
| 620 | ":tool_utils", |
| 621 | "//third_party/jsoncpp", |
| 622 | ] |
| 623 | testonly = true |
| 624 | } |
halcanary | 19a9720 | 2016-08-03 15:08:04 -0700 | [diff] [blame] | 625 | |
| 626 | executable("sktexttopdf") { |
| 627 | sources = [ |
| 628 | "tools/SkShaper_harfbuzz.cpp", |
| 629 | "tools/using_skia_and_harfbuzz.cpp", |
| 630 | ] |
| 631 | deps = [ |
| 632 | ":skia", |
| 633 | "//third_party/harfbuzz", |
| 634 | ] |
| 635 | testonly = true |
| 636 | } |
mtklein | 25c81d4 | 2016-07-27 13:55:26 -0700 | [diff] [blame] | 637 | } |