Revert "We can mask load and store with just AVX."
[platform/upstream/libSkiaSharp.git] / BUILD.gn
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 import("gn/android_framework_defines.gni")
7 import("gn/shared_sources.gni")
8
9 if (is_fuchsia) {
10   import("//build/vulkan/config.gni")
11 }
12
13 if (!defined(is_skia_standalone)) {
14   is_skia_standalone = false
15 }
16 is_skia_dev_build = is_skia_standalone && !is_official_build
17
18 declare_args() {
19   skia_use_angle = false
20   skia_use_egl = false
21   skia_use_expat = true
22   skia_use_fontconfig = is_linux
23   skia_use_freetype = is_android || is_fuchsia || is_linux
24   skia_use_gdi = false
25   skia_use_icu = !is_fuchsia && !is_ios && !is_win  # TODO: Windows
26   skia_use_libjpeg_turbo = true
27   skia_use_libpng = true
28   skia_use_libwebp = !is_fuchsia
29   skia_use_lua = false
30   skia_use_mesa = false
31   skia_use_piex = !is_win
32   skia_use_zlib = true
33
34   skia_android_serial = ""
35   skia_enable_android_framework_defines = false
36   skia_enable_discrete_gpu = true
37   skia_enable_effects = true
38   skia_enable_gpu = true
39   skia_enable_pdf = true
40   skia_enable_spirv_validation = is_skia_dev_build && is_debug
41   skia_enable_tools = is_skia_dev_build
42   skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
43   skia_vulkan_sdk = getenv("VULKAN_SDK")
44 }
45 declare_args() {
46   skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
47   skia_use_sfntly = skia_use_icu
48
49   if (is_android) {
50     skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
51   } else if (is_fuchsia) {
52     skia_use_vulkan = fuchsia_use_vulkan
53   } else {
54     skia_use_vulkan = skia_vulkan_sdk != ""
55   }
56 }
57 declare_args() {
58   if (skia_use_vulkan) {
59     if (is_fuchsia) {
60       skia_vulkan_headers = "$fuchsia_vulkan_sdk/include"
61     } else if (is_linux || is_win) {
62       skia_vulkan_headers = "$skia_vulkan_sdk/include"
63     } else {
64       # When buliding on Android we get the header via the NDK
65       skia_vulkan_headers = ""
66     }
67   } else {
68     skia_vulkan_headers = "third_party/vulkan"
69   }
70 }
71
72 # Our tools require static linking (they use non-exported symbols).
73 skia_enable_tools = skia_enable_tools && !is_component_build
74
75 fontmgr_android_enabled = skia_use_expat && skia_use_freetype
76
77 skia_public_includes = [
78   "include/android",
79   "include/c",
80   "include/codec",
81   "include/config",
82   "include/core",
83   "include/effects",
84   "include/encode",
85   "include/gpu",
86   "include/gpu/gl",
87   "include/pathops",
88   "include/ports",
89   "include/svg",
90   "include/utils",
91   "include/utils/mac",
92 ]
93
94 # Skia public API, generally provided by :skia.
95 config("skia_public") {
96   include_dirs = skia_public_includes
97   if (skia_vulkan_headers != "") {
98     include_dirs += [ skia_vulkan_headers ]
99   }
100   defines = []
101   if (is_component_build) {
102     defines += [ "SKIA_DLL" ]
103   }
104   if (is_fuchsia || is_linux) {
105     defines += [ "SK_SAMPLES_FOR_X" ]
106   }
107   if (skia_enable_android_framework_defines) {
108     defines += android_framework_defines
109   }
110   if (!skia_enable_gpu) {
111     defines += [ "SK_SUPPORT_GPU=0" ]
112   }
113 }
114
115 # Skia internal APIs, used by Skia itself and a few test tools.
116 config("skia_private") {
117   visibility = [ ":*" ]
118
119   include_dirs = [
120     "include/private",
121     "src/c",
122     "src/codec",
123     "src/core",
124     "src/effects",
125     "src/effects/gradients",
126     "src/fonts",
127     "src/image",
128     "src/images",
129     "src/lazy",
130     "src/opts",
131     "src/pathops",
132     "src/pdf",
133     "src/ports",
134     "src/sfnt",
135     "src/sksl",
136     "src/utils",
137     "src/utils/win",
138     "src/xml",
139     "third_party/gif",
140   ]
141
142   defines = [ "SK_GAMMA_APPLY_TO_A8" ]
143   if (is_android) {
144     defines += [
145       "SK_GAMMA_EXPONENT=1.4",
146       "SK_GAMMA_CONTRAST=0.0",
147     ]
148   }
149   if (is_official_build || is_android) {
150     # TODO(bsalomon): it'd be nice to make Android normal.
151     defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
152   }
153   libs = []
154   lib_dirs = []
155   if (skia_use_vulkan) {
156     if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) {
157       if (is_win) {
158         lib_dirs += [
159           "$skia_vulkan_sdk/Bin",
160           "$skia_vulkan_sdk/Lib",
161         ]
162       } else {
163         lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
164       }
165     }
166   }
167   if (skia_enable_gpu) {
168     include_dirs += [ "src/gpu" ]
169   }
170   if (skia_use_angle) {
171     defines += [ "SK_ANGLE" ]
172   }
173   if (skia_enable_discrete_gpu) {
174     defines += [ "SK_ENABLE_DISCRETE_GPU" ]
175   }
176 }
177
178 # Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
179 config("skia_library") {
180   visibility = [ ":*" ]
181   defines = [ "SKIA_IMPLEMENTATION=1" ]
182 }
183
184 skia_library_configs = [
185   ":skia_public",
186   ":skia_private",
187   ":skia_library",
188 ]
189
190 # Use for CPU-specific Skia code that needs particular compiler flags.
191 template("opts") {
192   if (invoker.enabled) {
193     source_set(target_name) {
194       forward_variables_from(invoker, "*")
195       configs += skia_library_configs
196     }
197   } else {
198     # If not enabled, a phony empty target that swallows all otherwise unused variables.
199     source_set(target_name) {
200       forward_variables_from(invoker,
201                              "*",
202                              [
203                                "sources",
204                                "cflags",
205                              ])
206     }
207   }
208 }
209
210 is_x86 = current_cpu == "x64" || current_cpu == "x86"
211
212 opts("none") {
213   enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
214   sources = skia_opts.none_sources
215   cflags = []
216 }
217
218 opts("armv7") {
219   enabled = current_cpu == "arm"
220   sources = skia_opts.armv7_sources + skia_opts.neon_sources
221   cflags = []
222 }
223
224 opts("arm64") {
225   enabled = current_cpu == "arm64"
226   sources = skia_opts.arm64_sources
227   cflags = []
228 }
229
230 opts("crc32") {
231   enabled = current_cpu == "arm64"
232   sources = skia_opts.crc32_sources
233   cflags = [ "-march=armv8-a+crc" ]
234 }
235
236 opts("sse2") {
237   enabled = is_x86
238   sources = skia_opts.sse2_sources
239   if (is_win) {
240     defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
241   } else {
242     cflags = [ "-msse2" ]
243   }
244 }
245
246 opts("ssse3") {
247   enabled = is_x86
248   sources = skia_opts.ssse3_sources
249   if (is_win) {
250     defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
251   } else {
252     cflags = [ "-mssse3" ]
253   }
254 }
255
256 opts("sse41") {
257   enabled = is_x86
258   sources = skia_opts.sse41_sources
259   if (is_win) {
260     defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
261   } else {
262     cflags = [ "-msse4.1" ]
263   }
264 }
265
266 opts("sse42") {
267   enabled = is_x86
268   sources = skia_opts.sse42_sources
269   if (is_win) {
270     defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
271   } else {
272     cflags = [ "-msse4.2" ]
273   }
274 }
275
276 opts("avx") {
277   enabled = is_x86
278   sources = skia_opts.avx_sources
279   if (is_win) {
280     cflags = [ "/arch:AVX" ]
281   } else {
282     cflags = [ "-mavx" ]
283   }
284 }
285
286 opts("hsw") {
287   enabled = is_x86
288   sources = skia_opts.hsw_sources
289   if (is_win) {
290     cflags = [ "/arch:AVX2" ]
291   } else {
292     cflags = [
293       "-mavx2",
294       "-mbmi",
295       "-mbmi2",
296       "-mf16c",
297       "-mfma",
298     ]
299   }
300 }
301
302 # Any feature of Skia that requires third-party code should be optional and use this template.
303 template("optional") {
304   if (invoker.enabled) {
305     config(target_name + "_public") {
306       if (defined(invoker.public_defines)) {
307         defines = invoker.public_defines
308       }
309     }
310     source_set(target_name) {
311       forward_variables_from(invoker,
312                              "*",
313                              [
314                                "public_defines",
315                                "sources_when_disabled",
316                                "configs_to_remove",
317                              ])
318       all_dependent_configs = [ ":" + target_name + "_public" ]
319       configs += skia_library_configs
320       if (defined(invoker.configs_to_remove)) {
321         configs -= invoker.configs_to_remove
322       }
323     }
324   } else {
325     source_set(target_name) {
326       forward_variables_from(invoker,
327                              "*",
328                              [
329                                "public_defines",
330                                "deps",
331                                "libs",
332                                "sources",
333                                "sources_when_disabled",
334                                "configs_to_remove",
335                              ])
336       if (defined(invoker.sources_when_disabled)) {
337         sources = invoker.sources_when_disabled
338       }
339       configs += skia_library_configs
340     }
341   }
342 }
343
344 optional("effects") {
345   enabled = skia_enable_effects
346   sources =
347       skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
348   sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
349 }
350
351 optional("fontmgr_android") {
352   enabled = fontmgr_android_enabled
353
354   deps = [
355     ":typeface_freetype",
356     "//third_party/expat",
357   ]
358   sources = [
359     "src/ports/SkFontMgr_android.cpp",
360     "src/ports/SkFontMgr_android_factory.cpp",
361     "src/ports/SkFontMgr_android_parser.cpp",
362   ]
363 }
364
365 optional("fontmgr_custom") {
366   enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
367
368   deps = [
369     ":typeface_freetype",
370   ]
371   sources = [
372     "src/ports/SkFontMgr_custom.cpp",
373     "src/ports/SkFontMgr_custom.h",
374     "src/ports/SkFontMgr_custom_directory.cpp",
375     "src/ports/SkFontMgr_custom_directory_factory.cpp",
376     "src/ports/SkFontMgr_custom_embedded.cpp",
377     "src/ports/SkFontMgr_custom_empty.cpp",
378   ]
379 }
380
381 optional("fontmgr_fontconfig") {
382   enabled = skia_use_freetype && skia_use_fontconfig
383
384   deps = [
385     ":typeface_freetype",
386     "//third_party:fontconfig",
387   ]
388   sources = [
389     "src/ports/SkFontConfigInterface.cpp",
390     "src/ports/SkFontConfigInterface_direct.cpp",
391     "src/ports/SkFontConfigInterface_direct_factory.cpp",
392     "src/ports/SkFontMgr_FontConfigInterface.cpp",
393     "src/ports/SkFontMgr_fontconfig.cpp",
394     "src/ports/SkFontMgr_fontconfig_factory.cpp",
395   ]
396 }
397
398 optional("fontmgr_fuchsia") {
399   enabled = is_fuchsia && skia_use_freetype
400
401   deps = [
402     ":typeface_freetype",
403   ]
404   sources = [
405     "src/ports/SkFontMgr_custom.cpp",
406     "src/ports/SkFontMgr_custom_empty.cpp",
407     "src/ports/SkFontMgr_custom_empty_factory.cpp",
408   ]
409 }
410
411 optional("gpu") {
412   enabled = skia_enable_gpu
413   public_defines = []
414
415   sources = skia_gpu_sources + skia_sksl_sources +
416             [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
417
418   # These paths need to be absolute to match the ones produced by shared_sources.gni.
419   sources -= get_path_info([
420                              "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
421                              "src/gpu/gl/GrGLDefaultInterface_none.cpp",
422                            ],
423                            "abspath")
424   libs = []
425   if (is_android) {
426     sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
427   } else if (skia_use_egl) {
428     sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
429     libs += [ "EGL" ]
430   } else if (is_linux) {
431     sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
432     libs += [
433       "GL",
434       "GLU",
435     ]
436   } else if (is_mac) {
437     sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
438   } else if (is_ios) {
439     sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
440   } else if (is_win) {
441     sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
442     libs += [ "OpenGL32.lib" ]
443   } else {
444     sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
445   }
446
447   if (skia_use_vulkan) {
448     public_defines += [ "SK_VULKAN" ]
449     sources += skia_vk_sources
450     if (skia_enable_vulkan_debug_layers) {
451       public_defines += [ "SK_ENABLE_VK_LAYERS" ]
452     }
453   }
454   if (skia_enable_spirv_validation) {
455     deps = [
456       "//third_party/spirv-tools",
457     ]
458     public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
459   }
460 }
461
462 optional("jpeg") {
463   enabled = skia_use_libjpeg_turbo
464   public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
465
466   deps = [
467     "//third_party/libjpeg-turbo:libjpeg",
468   ]
469   sources = [
470     "src/codec/SkJpegCodec.cpp",
471     "src/codec/SkJpegDecoderMgr.cpp",
472     "src/codec/SkJpegUtility.cpp",
473     "src/images/SkJPEGWriteUtility.cpp",
474     "src/images/SkJpegEncoder.cpp",
475   ]
476 }
477
478 optional("pdf") {
479   enabled = skia_use_zlib && skia_enable_pdf
480   public_defines = [ "SK_SUPPORT_PDF" ]
481
482   deps = [
483     "//third_party/zlib",
484   ]
485   sources = skia_pdf_sources
486   sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
487
488   if (skia_use_sfntly) {
489     deps += [ "//third_party/sfntly" ]
490     public_defines += [ "SK_PDF_USE_SFNTLY" ]
491   }
492 }
493
494 optional("png") {
495   enabled = skia_use_libpng
496   public_defines = [ "SK_HAS_PNG_LIBRARY" ]
497
498   deps = [
499     "//third_party/libpng",
500   ]
501   sources = [
502     "src/codec/SkIcoCodec.cpp",
503     "src/codec/SkPngCodec.cpp",
504     "src/images/SkPngEncoder.cpp",
505   ]
506 }
507
508 optional("raw") {
509   enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
510   public_defines = [ "SK_CODEC_DECODES_RAW" ]
511
512   deps = [
513     "//third_party/dng_sdk",
514     "//third_party/libjpeg-turbo:libjpeg",
515     "//third_party/piex",
516   ]
517
518   # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
519   # Skia.
520   configs_to_remove = [ "//gn:no_exceptions" ]
521
522   sources = [
523     "src/codec/SkRawAdapterCodec.cpp",
524     "src/codec/SkRawCodec.cpp",
525   ]
526 }
527
528 optional("typeface_freetype") {
529   enabled = skia_use_freetype
530
531   deps = [
532     "//third_party/freetype2",
533   ]
534   sources = [
535     "src/ports/SkFontHost_FreeType.cpp",
536     "src/ports/SkFontHost_FreeType_common.cpp",
537   ]
538 }
539
540 optional("webp") {
541   enabled = skia_use_libwebp
542   public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
543
544   deps = [
545     "//third_party/libwebp",
546   ]
547   sources = [
548     "src/codec/SkWebpAdapterCodec.cpp",
549     "src/codec/SkWebpCodec.cpp",
550     "src/images/SkWebpEncoder.cpp",
551   ]
552 }
553
554 optional("xml") {
555   enabled = skia_use_expat
556   public_defines = [ "SK_XML" ]
557
558   deps = [
559     "//third_party/expat",
560   ]
561   sources = [
562     "src/svg/SkSVGCanvas.cpp",
563     "src/svg/SkSVGDevice.cpp",
564     "src/xml/SkDOM.cpp",
565     "src/xml/SkXMLParser.cpp",
566     "src/xml/SkXMLWriter.cpp",
567   ]
568 }
569
570 component("skia") {
571   public_configs = [ ":skia_public" ]
572   configs += skia_library_configs
573
574   deps = [
575     ":arm64",
576     ":armv7",
577     ":avx",
578     ":crc32",
579     ":effects",
580     ":fontmgr_android",
581     ":fontmgr_custom",
582     ":fontmgr_fontconfig",
583     ":fontmgr_fuchsia",
584     ":gpu",
585     ":hsw",
586     ":jpeg",
587     ":none",
588     ":pdf",
589     ":png",
590     ":raw",
591     ":sse2",
592     ":sse41",
593     ":sse42",
594     ":ssse3",
595     ":webp",
596     ":xml",
597   ]
598
599   # This file (and all GN files in Skia) are designed to work with an
600   # empty sources assignment filter; we handle all that explicitly.
601   # We clear the filter here for clients who may have set up a global filter.
602   set_sources_assignment_filter([])
603
604   sources = []
605   sources += skia_core_sources
606   sources += skia_utils_sources
607   sources += skia_xps_sources
608   sources += [
609     "src/android/SkBitmapRegionCodec.cpp",
610     "src/android/SkBitmapRegionDecoder.cpp",
611     "src/codec/SkAndroidCodec.cpp",
612     "src/codec/SkBmpCodec.cpp",
613     "src/codec/SkBmpMaskCodec.cpp",
614     "src/codec/SkBmpRLECodec.cpp",
615     "src/codec/SkBmpStandardCodec.cpp",
616     "src/codec/SkCodec.cpp",
617     "src/codec/SkCodecImageGenerator.cpp",
618     "src/codec/SkGifCodec.cpp",
619     "src/codec/SkMaskSwizzler.cpp",
620     "src/codec/SkMasks.cpp",
621     "src/codec/SkSampledCodec.cpp",
622     "src/codec/SkSampler.cpp",
623     "src/codec/SkStreamBuffer.cpp",
624     "src/codec/SkSwizzler.cpp",
625     "src/codec/SkWbmpCodec.cpp",
626     "src/images/SkImageEncoder.cpp",
627     "src/ports/SkDiscardableMemory_none.cpp",
628     "src/ports/SkImageGenerator_skia.cpp",
629     "src/ports/SkMemory_malloc.cpp",
630     "src/ports/SkOSFile_stdio.cpp",
631     "src/sfnt/SkOTTable_name.cpp",
632     "src/sfnt/SkOTUtils.cpp",
633     "src/utils/mac/SkStream_mac.cpp",
634     "third_party/gif/SkGifImageReader.cpp",
635   ]
636
637   libs = []
638
639   if (is_win) {
640     sources += [
641       "src/fonts/SkFontMgr_indirect.cpp",
642       "src/ports/SkDebug_win.cpp",
643       "src/ports/SkFontHost_win.cpp",
644       "src/ports/SkFontMgr_win_dw.cpp",
645       "src/ports/SkImageEncoder_WIC.cpp",
646       "src/ports/SkImageGeneratorWIC.cpp",
647       "src/ports/SkOSFile_win.cpp",
648       "src/ports/SkOSLibrary_win.cpp",
649       "src/ports/SkScalerContext_win_dw.cpp",
650       "src/ports/SkTLS_win.cpp",
651       "src/ports/SkTypeface_win_dw.cpp",
652     ]
653     if (skia_use_gdi) {
654       sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
655       libs += [
656         "Gdi32.lib",
657         "Usp10.lib",
658       ]
659     } else {
660       sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
661     }
662     sources -=
663         [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
664     libs += [
665       "FontSub.lib",
666       "Ole32.lib",
667       "OleAut32.lib",
668       "User32.lib",
669     ]
670   } else {
671     sources += [
672       "src/ports/SkOSFile_posix.cpp",
673       "src/ports/SkOSLibrary_posix.cpp",
674       "src/ports/SkTLS_pthread.cpp",
675     ]
676   }
677
678   if (is_android) {
679     deps += [ "//third_party/expat" ]
680     if (defined(ndk) && ndk != "") {
681       deps += [ "//third_party/cpu-features" ]
682     }
683     sources += [ "src/ports/SkDebug_android.cpp" ]
684     libs += [
685       "EGL",
686       "GLESv2",
687       "log",
688     ]
689   }
690
691   if (is_linux) {
692     sources += [ "src/ports/SkDebug_stdio.cpp" ]
693   }
694
695   if (is_mac) {
696     sources += [
697       "src/ports/SkDebug_stdio.cpp",
698       "src/ports/SkFontHost_mac.cpp",
699       "src/ports/SkImageEncoder_CG.cpp",
700       "src/ports/SkImageGeneratorCG.cpp",
701     ]
702     libs += [
703       # AppKit symbols NSFontWeightXXX may be dlsym'ed.
704       "AppKit.framework",
705       "ApplicationServices.framework",
706       "OpenGL.framework",
707     ]
708   }
709
710   if (is_ios) {
711     sources += [
712       "src/ports/SkDebug_stdio.cpp",
713       "src/ports/SkFontHost_mac.cpp",
714       "src/ports/SkImageEncoder_CG.cpp",
715       "src/ports/SkImageGeneratorCG.cpp",
716     ]
717     libs += [
718       "CoreFoundation.framework",
719       "CoreGraphics.framework",
720       "CoreText.framework",
721       "ImageIO.framework",
722       "MobileCoreServices.framework",
723
724       # UIKit symbols UIFontWeightXXX may be dlsym'ed.
725       "UIKit.framework",
726     ]
727   }
728
729   if (is_fuchsia) {
730     sources += [ "src/ports/SkDebug_stdio.cpp" ]
731   }
732 }
733
734 # Targets guarded by skia_enable_tools may use //third_party freely.
735 if (skia_enable_tools) {
736   # Used by gn_to_bp.py to list our public include dirs.
737   source_set("public") {
738     configs += [ ":skia_public" ]
739   }
740
741   config("skia.h_config") {
742     include_dirs = [ "$target_gen_dir" ]
743   }
744   action("skia.h") {
745     public_configs = [ ":skia.h_config" ]
746     skia_h = "$target_gen_dir/skia.h"
747     script = "gn/find_headers.py"
748     args = [ rebase_path(skia_h, root_build_dir) ] +
749            rebase_path(skia_public_includes) +
750            [ rebase_path("third_party/vulkan") ]
751     depfile = "$skia_h.deps"
752     outputs = [
753       skia_h,
754     ]
755   }
756
757   if (skia_enable_gpu && target_cpu == "x64") {
758     # Our bots only have 64-bit libOSMesa installed.
759     # TODO: worth fixing?
760     executable("fiddle") {
761       libs = []
762       if (is_linux) {
763         libs += [ "OSMesa" ]
764       }
765
766       sources = [
767         "tools/fiddle/draw.cpp",
768         "tools/fiddle/fiddle_main.cpp",
769       ]
770       testonly = true
771       deps = [
772         ":flags",
773         ":skia",
774         ":skia.h",
775       ]
776     }
777   }
778
779   if (skia_enable_gpu) {
780     source_set("public_headers_warnings_check") {
781       sources = [
782         "tools/public_headers_warnings_check.cpp",
783       ]
784       configs -= [ "//gn:warnings_except_public_headers" ]
785       deps = [
786         ":skia",
787         ":skia.h",
788       ]
789     }
790   }
791
792   template("test_lib") {
793     config(target_name + "_config") {
794       include_dirs = invoker.public_include_dirs
795       if (defined(invoker.public_defines)) {
796         defines = invoker.public_defines
797       }
798     }
799     source_set(target_name) {
800       forward_variables_from(invoker, "*", [ "public_include_dirs" ])
801       public_configs = [
802         ":" + target_name + "_config",
803         ":skia_private",
804       ]
805
806       if (!defined(deps)) {
807         deps = []
808       }
809       deps += [ ":skia" ]
810       testonly = true
811     }
812   }
813
814   template("test_app") {
815     if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
816       shared_library("lib" + target_name) {
817         forward_variables_from(invoker, "*", [ "is_shared_library" ])
818         testonly = true
819       }
820     } else {
821       _executable = target_name
822       executable(_executable) {
823         forward_variables_from(invoker, "*", [ "is_shared_library" ])
824         testonly = true
825       }
826     }
827     if (is_android && skia_android_serial != "" && defined(_executable)) {
828       action("push_" + target_name) {
829         script = "gn/push_to_android.py"
830         deps = [
831           ":" + _executable,
832         ]
833         _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
834         outputs = [
835           _stamp,
836         ]
837         args = [
838           rebase_path("$root_build_dir/$_executable"),
839           skia_android_serial,
840           rebase_path(_stamp),
841         ]
842         testonly = true
843       }
844     }
845   }
846
847   test_lib("gpu_tool_utils") {
848     public_include_dirs = []
849     if (skia_enable_gpu) {
850       public_defines = []
851       public_include_dirs += [ "tools/gpu" ]
852
853       deps = []
854       sources = [
855         "tools/gpu/GrContextFactory.cpp",
856         "tools/gpu/GrTest.cpp",
857         "tools/gpu/TestContext.cpp",
858         "tools/gpu/gl/GLTestContext.cpp",
859         "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
860         "tools/gpu/gl/debug/DebugGLTestContext.cpp",
861         "tools/gpu/gl/debug/GrBufferObj.cpp",
862         "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
863         "tools/gpu/gl/debug/GrProgramObj.cpp",
864         "tools/gpu/gl/debug/GrShaderObj.cpp",
865         "tools/gpu/gl/debug/GrTextureObj.cpp",
866         "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
867         "tools/gpu/gl/null/NullGLTestContext.cpp",
868       ]
869       libs = []
870
871       if (is_android || skia_use_egl) {
872         sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
873       } else if (is_ios) {
874         sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
875         libs += [ "OpenGLES.framework" ]
876       } else if (is_linux) {
877         sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
878         libs += [ "X11" ]
879       } else if (is_mac) {
880         sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
881       } else if (is_win) {
882         sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
883         libs += [
884           "Gdi32.lib",
885           "OpenGL32.lib",
886         ]
887       }
888
889       if (skia_use_angle) {
890         deps += [ "//third_party/angle2" ]
891         sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
892       }
893       if (skia_use_mesa) {
894         public_defines += [ "SK_MESA" ]
895         sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
896         libs += [ "OSMesa" ]
897       }
898       if (skia_use_vulkan) {
899         sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
900         if (is_win) {
901           libs += [ "vulkan-1.lib" ]
902         } else {
903           libs += [ "vulkan" ]
904         }
905       }
906     }
907   }
908
909   test_lib("flags") {
910     public_include_dirs = [ "tools/flags" ]
911     sources = [
912       "tools/flags/SkCommandLineFlags.cpp",
913     ]
914   }
915   test_lib("common_flags") {
916     public_include_dirs = [ "tools/flags" ]
917     sources = [
918       "tools/flags/SkCommonFlags.cpp",
919       "tools/flags/SkCommonFlagsConfig.cpp",
920     ]
921     deps = [
922       ":flags",
923       ":gpu_tool_utils",
924     ]
925   }
926
927   test_lib("tool_utils") {
928     public_include_dirs = [
929       "tools",
930       "tools/debugger",
931       "tools/timer",
932     ]
933     sources = [
934       "tools/AndroidSkDebugToStdOut.cpp",
935       "tools/CrashHandler.cpp",
936       "tools/LsanSuppressions.cpp",
937       "tools/ProcStats.cpp",
938       "tools/Resources.cpp",
939       "tools/ThermalManager.cpp",
940       "tools/UrlDataManager.cpp",
941       "tools/debugger/SkDebugCanvas.cpp",
942       "tools/debugger/SkDrawCommand.cpp",
943       "tools/debugger/SkJsonWriteBuffer.cpp",
944       "tools/debugger/SkObjectParser.cpp",
945       "tools/picture_utils.cpp",
946       "tools/random_parse_path.cpp",
947       "tools/sk_tool_utils.cpp",
948       "tools/sk_tool_utils_font.cpp",
949       "tools/timer/Timer.cpp",
950     ]
951     libs = []
952     if (is_ios) {
953       sources += [ "tools/ios_utils.m" ]
954       libs += [ "Foundation.framework" ]
955     }
956     deps = [
957       ":common_flags",
958       ":flags",
959       "//third_party/libpng",
960     ]
961     public_deps = [
962       "//third_party/jsoncpp",
963     ]
964   }
965
966   import("gn/gm.gni")
967   test_lib("gm") {
968     public_include_dirs = [ "gm" ]
969     sources = gm_sources
970     deps = [
971       ":flags",
972       ":gpu_tool_utils",
973       ":skia",
974       ":tool_utils",
975     ]
976   }
977
978   import("gn/tests.gni")
979   test_lib("tests") {
980     public_include_dirs = [ "tests" ]
981     sources = tests_sources + pathops_tests_sources
982     if (!fontmgr_android_enabled) {
983       sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
984     }
985     deps = [
986       ":experimental_svg_model",
987       ":flags",
988       ":skia",
989       ":tool_utils",
990       "//third_party/libpng",
991       "//third_party/zlib",
992     ]
993     public_deps = [
994       ":gpu_tool_utils",  # Test.h #includes headers from this target.
995     ]
996   }
997
998   import("gn/bench.gni")
999   test_lib("bench") {
1000     public_include_dirs = [ "bench" ]
1001     sources = bench_sources
1002     deps = [
1003       ":flags",
1004       ":gm",
1005       ":gpu_tool_utils",
1006       ":skia",
1007       ":tool_utils",
1008     ]
1009   }
1010
1011   test_lib("experimental_svg_model") {
1012     public_include_dirs = [ "experimental/svg/model" ]
1013     sources = [
1014       "experimental/svg/model/SkSVGAttribute.cpp",
1015       "experimental/svg/model/SkSVGAttributeParser.cpp",
1016       "experimental/svg/model/SkSVGCircle.cpp",
1017       "experimental/svg/model/SkSVGClipPath.cpp",
1018       "experimental/svg/model/SkSVGContainer.cpp",
1019       "experimental/svg/model/SkSVGDOM.cpp",
1020       "experimental/svg/model/SkSVGEllipse.cpp",
1021       "experimental/svg/model/SkSVGLine.cpp",
1022       "experimental/svg/model/SkSVGLinearGradient.cpp",
1023       "experimental/svg/model/SkSVGNode.cpp",
1024       "experimental/svg/model/SkSVGPath.cpp",
1025       "experimental/svg/model/SkSVGPoly.cpp",
1026       "experimental/svg/model/SkSVGRect.cpp",
1027       "experimental/svg/model/SkSVGRenderContext.cpp",
1028       "experimental/svg/model/SkSVGSVG.cpp",
1029       "experimental/svg/model/SkSVGShape.cpp",
1030       "experimental/svg/model/SkSVGStop.cpp",
1031       "experimental/svg/model/SkSVGTransformableNode.cpp",
1032       "experimental/svg/model/SkSVGValue.cpp",
1033     ]
1034     deps = [
1035       ":skia",
1036     ]
1037   }
1038
1039   test_lib("views") {
1040     public_include_dirs = [ "include/views" ]
1041     sources = [
1042       "src/views/SkEvent.cpp",
1043       "src/views/SkEventSink.cpp",
1044       "src/views/SkOSMenu.cpp",
1045       "src/views/SkTagList.cpp",
1046       "src/views/SkTouchGesture.cpp",
1047       "src/views/SkView.cpp",
1048       "src/views/SkViewPriv.cpp",
1049     ]
1050     libs = []
1051     deps = []
1052     if (!is_android) {
1053       sources += [ "src/views/SkWindow.cpp" ]
1054     }
1055     if (is_linux) {
1056       public_include_dirs += [ "src/views/unix" ]
1057       sources += [
1058         "src/views/unix/SkOSWindow_Unix.cpp",
1059         "src/views/unix/keysym2ucs.c",
1060       ]
1061       libs += [
1062         "GL",
1063         "X11",
1064       ]
1065     } else if (is_mac) {
1066       sources += [
1067         "src/views/mac/SkEventNotifier.mm",
1068         "src/views/mac/SkNSView.mm",
1069         "src/views/mac/SkOSWindow_Mac.mm",
1070         "src/views/mac/SkTextFieldCell.m",
1071       ]
1072       libs += [
1073         "QuartzCore.framework",
1074         "Cocoa.framework",
1075         "Foundation.framework",
1076       ]
1077     } else if (is_win) {
1078       sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1079     }
1080     if (skia_use_angle) {
1081       deps += [ "//third_party/angle2" ]
1082     }
1083   }
1084
1085   if (skia_use_lua) {
1086     test_lib("lua") {
1087       public_include_dirs = []
1088       sources = [
1089         "src/utils/SkLua.cpp",
1090         "src/utils/SkLuaCanvas.cpp",
1091       ]
1092       deps = [
1093         "//third_party/lua",
1094       ]
1095     }
1096
1097     test_app("lua_app") {
1098       sources = [
1099         "tools/lua/lua_app.cpp",
1100       ]
1101       deps = [
1102         ":lua",
1103         ":skia",
1104         "//third_party/lua",
1105       ]
1106     }
1107
1108     test_app("lua_pictures") {
1109       sources = [
1110         "tools/lua/lua_pictures.cpp",
1111       ]
1112       deps = [
1113         ":flags",
1114         ":lua",
1115         ":skia",
1116         ":tool_utils",
1117         "//third_party/lua",
1118       ]
1119     }
1120   }
1121
1122   import("gn/samples.gni")
1123   test_lib("samples") {
1124     public_include_dirs = [ "samplecode" ]
1125     include_dirs = [ "experimental" ]
1126     sources = samples_sources + [
1127                 "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
1128                 "experimental/SkSetPoly3To3.cpp",
1129                 "experimental/SkSetPoly3To3_A.cpp",
1130                 "experimental/SkSetPoly3To3_D.cpp",
1131               ]
1132     deps = [
1133       ":experimental_svg_model",
1134       ":flags",
1135       ":gm",
1136       ":tool_utils",
1137       ":views",
1138       ":xml",
1139     ]
1140
1141     if (skia_use_lua) {
1142       sources += [ "samplecode/SampleLua.cpp" ]
1143       deps += [
1144         ":lua",
1145         "//third_party/lua",
1146       ]
1147     }
1148   }
1149
1150   test_app("dm") {
1151     sources = [
1152       "dm/DM.cpp",
1153       "dm/DMJsonWriter.cpp",
1154       "dm/DMSrcSink.cpp",
1155     ]
1156     include_dirs = [ "tests" ]
1157     deps = [
1158       ":common_flags",
1159       ":experimental_svg_model",
1160       ":flags",
1161       ":gm",
1162       ":gpu_tool_utils",
1163       ":skia",
1164       ":tests",
1165       ":tool_utils",
1166       "//third_party/jsoncpp",
1167       "//third_party/libpng",
1168     ]
1169   }
1170
1171   test_app("ok") {
1172     sources = [
1173       "tools/ok.cpp",
1174       "tools/ok_dsts.cpp",
1175       "tools/ok_srcs.cpp",
1176       "tools/ok_test.cpp",
1177       "tools/ok_vias.cpp",
1178     ]
1179     deps = [
1180       ":gm",
1181       ":skia",
1182       ":tests",
1183       ":tool_utils",
1184     ]
1185   }
1186
1187   if (!is_debug) {  # I've benchmarked debug code once too many times...
1188     test_app("monobench") {
1189       sources = [
1190         "tools/monobench.cpp",
1191       ]
1192       deps = [
1193         ":bench",
1194         ":skia",
1195       ]
1196     }
1197   }
1198
1199   test_app("nanobench") {
1200     sources = [
1201       "bench/nanobench.cpp",
1202     ]
1203     deps = [
1204       ":bench",
1205       ":common_flags",
1206       ":experimental_svg_model",
1207       ":flags",
1208       ":gm",
1209       ":gpu_tool_utils",
1210       ":skia",
1211       ":tool_utils",
1212       "//third_party/jsoncpp",
1213     ]
1214   }
1215
1216   test_app("skpinfo") {
1217     sources = [
1218       "tools/skpinfo.cpp",
1219     ]
1220     deps = [
1221       ":flags",
1222       ":skia",
1223     ]
1224   }
1225
1226   if (is_linux || is_win || is_mac) {
1227     test_app("SampleApp") {
1228       sources = [
1229         "samplecode/SampleApp.cpp",
1230         "samplecode/SamplePictFile.cpp",
1231       ]
1232       if (is_mac) {
1233         sources += [ "src/views/mac/skia_mac.mm" ]
1234       } else if (is_win) {
1235         sources += [ "src/views/win/skia_win.cpp" ]
1236       } else if (is_linux) {
1237         sources += [ "src/views/unix/skia_unix.cpp" ]
1238       }
1239       deps = [
1240         ":flags",
1241         ":gm",
1242         ":gpu_tool_utils",
1243         ":samples",
1244         ":skia",
1245         ":tool_utils",
1246         ":views",
1247       ]
1248       if (skia_use_angle) {
1249         deps += [ "//third_party/angle2" ]
1250       }
1251     }
1252   }
1253
1254   if (skia_enable_gpu) {
1255     test_app("skpbench") {
1256       sources = [
1257         "tools/skpbench/skpbench.cpp",
1258       ]
1259       deps = [
1260         ":flags",
1261         ":gpu_tool_utils",
1262         ":skia",
1263         ":tool_utils",
1264       ]
1265     }
1266   }
1267
1268   # We can't yet build ICU on iOS or Windows.
1269   if (!is_ios && !is_win) {
1270     test_app("sktexttopdf-hb") {
1271       sources = [
1272         "tools/SkShaper_harfbuzz.cpp",
1273         "tools/using_skia_and_harfbuzz.cpp",
1274       ]
1275       deps = [
1276         ":skia",
1277         "//third_party/harfbuzz",
1278       ]
1279     }
1280   }
1281   test_app("sktexttopdf") {
1282     sources = [
1283       "tools/SkShaper_primitive.cpp",
1284       "tools/using_skia_and_harfbuzz.cpp",
1285     ]
1286     deps = [
1287       ":skia",
1288     ]
1289   }
1290
1291   test_app("create_flutter_test_images") {
1292     sources = [
1293       "tools/create_flutter_test_images.cpp",
1294     ]
1295     deps = [
1296       ":skia",
1297       ":tool_utils",
1298     ]
1299   }
1300
1301   test_app("get_images_from_skps") {
1302     sources = [
1303       "tools/get_images_from_skps.cpp",
1304     ]
1305     deps = [
1306       ":flags",
1307       ":skia",
1308       "//third_party/jsoncpp",
1309     ]
1310   }
1311
1312   test_app("colorspaceinfo") {
1313     sources = [
1314       "tools/colorspaceinfo.cpp",
1315     ]
1316     deps = [
1317       ":flags",
1318       ":skia",
1319       ":tool_utils",
1320     ]
1321   }
1322
1323   if (!is_ios) {
1324     test_app("skiaserve") {
1325       sources = [
1326         "tools/skiaserve/Request.cpp",
1327         "tools/skiaserve/Response.cpp",
1328         "tools/skiaserve/skiaserve.cpp",
1329         "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1330         "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1331         "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1332         "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1333         "tools/skiaserve/urlhandlers/DataHandler.cpp",
1334         "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1335         "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1336         "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1337         "tools/skiaserve/urlhandlers/InfoHandler.cpp",
1338         "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1339         "tools/skiaserve/urlhandlers/OpsHandler.cpp",
1340         "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1341         "tools/skiaserve/urlhandlers/PostHandler.cpp",
1342         "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1343         "tools/skiaserve/urlhandlers/RootHandler.cpp",
1344       ]
1345       deps = [
1346         ":flags",
1347         ":gpu_tool_utils",
1348         ":skia",
1349         ":tool_utils",
1350         "//third_party/jsoncpp",
1351         "//third_party/libmicrohttpd",
1352         "//third_party/libpng",
1353       ]
1354     }
1355   }
1356
1357   test_app("fuzz") {
1358     sources = [
1359       "fuzz/FilterFuzz.cpp",
1360       "fuzz/FuzzCanvas.cpp",
1361       "fuzz/FuzzDrawFunctions.cpp",
1362       "fuzz/FuzzGradients.cpp",
1363       "fuzz/FuzzParsePath.cpp",
1364       "fuzz/FuzzPathop.cpp",
1365       "fuzz/FuzzScaleToSides.cpp",
1366       "fuzz/fuzz.cpp",
1367     ]
1368     deps = [
1369       ":flags",
1370       ":gpu_tool_utils",
1371       ":skia",
1372       ":tool_utils",
1373     ]
1374   }
1375
1376   test_app("pathops_unittest") {
1377     sources = pathops_tests_sources + [
1378                 rebase_path("tests/skia_test.cpp"),
1379                 rebase_path("tests/Test.cpp"),
1380               ]
1381     deps = [
1382       ":flags",
1383       ":gpu_tool_utils",
1384       ":skia",
1385       ":tool_utils",
1386     ]
1387   }
1388
1389   test_app("dump_record") {
1390     sources = [
1391       "tools/DumpRecord.cpp",
1392       "tools/dump_record.cpp",
1393     ]
1394     deps = [
1395       ":flags",
1396       ":skia",
1397     ]
1398   }
1399
1400   test_app("skdiff") {
1401     sources = [
1402       "tools/skdiff/skdiff.cpp",
1403       "tools/skdiff/skdiff_html.cpp",
1404       "tools/skdiff/skdiff_main.cpp",
1405       "tools/skdiff/skdiff_utils.cpp",
1406     ]
1407     deps = [
1408       ":skia",
1409       ":tool_utils",
1410     ]
1411   }
1412
1413   test_app("skp_parser") {
1414     sources = [
1415       "tools/skp_parser.cpp",
1416     ]
1417     deps = [
1418       ":skia",
1419       ":tool_utils",
1420       "//third_party/jsoncpp",
1421     ]
1422   }
1423
1424   if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
1425     test_app("viewer") {
1426       is_shared_library = is_android
1427       sources = [
1428         "tools/viewer/GMSlide.cpp",
1429         "tools/viewer/ImageSlide.cpp",
1430         "tools/viewer/SKPSlide.cpp",
1431         "tools/viewer/SampleSlide.cpp",
1432         "tools/viewer/Viewer.cpp",
1433         "tools/viewer/sk_app/CommandSet.cpp",
1434         "tools/viewer/sk_app/GLWindowContext.cpp",
1435         "tools/viewer/sk_app/Window.cpp",
1436       ]
1437       libs = []
1438
1439       if (is_android) {
1440         sources += [
1441           "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1442           "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1443           "tools/viewer/sk_app/android/Window_android.cpp",
1444           "tools/viewer/sk_app/android/main_android.cpp",
1445           "tools/viewer/sk_app/android/surface_glue_android.cpp",
1446         ]
1447         libs += [ "android" ]
1448       } else if (is_linux) {
1449         sources += [
1450           "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1451           "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1452           "tools/viewer/sk_app/unix/Window_unix.cpp",
1453           "tools/viewer/sk_app/unix/main_unix.cpp",
1454         ]
1455       } else if (is_win) {
1456         sources += [
1457           "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1458           "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1459           "tools/viewer/sk_app/win/Window_win.cpp",
1460           "tools/viewer/sk_app/win/main_win.cpp",
1461         ]
1462       } else if (is_mac) {
1463         sources += [
1464           "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1465           "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1466           "tools/viewer/sk_app/mac/Window_mac.cpp",
1467           "tools/viewer/sk_app/mac/main_mac.cpp",
1468         ]
1469       }
1470
1471       if (skia_use_vulkan) {
1472         sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
1473         if (is_android) {
1474           sources +=
1475               [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
1476         } else if (is_linux) {
1477           sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1478           libs += [ "X11-xcb" ]
1479         } else if (is_win) {
1480           sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1481         }
1482       }
1483
1484       include_dirs = []
1485       deps = [
1486         ":flags",
1487         ":gm",
1488         ":gpu_tool_utils",
1489         ":samples",
1490         ":skia",
1491         ":tool_utils",
1492         ":views",
1493         "//third_party/imgui",
1494         "//third_party/jsoncpp",
1495       ]
1496       if (is_android) {
1497         deps += [ "//third_party/native_app_glue" ]
1498       } else if (is_mac) {
1499         deps += [ "//third_party/libsdl" ]
1500       }
1501     }
1502   }
1503
1504   if (is_android && defined(ndk) && ndk != "") {
1505     copy("gdbserver") {
1506       sources = [
1507         "$ndk/$ndk_gdbserver",
1508       ]
1509       outputs = [
1510         "$root_out_dir/gdbserver",
1511       ]
1512     }
1513   }
1514
1515   if (skia_enable_gpu) {
1516     test_app("skslc") {
1517       defines = [ "SKSL_STANDALONE" ]
1518       sources = [
1519         "src/sksl/SkSLMain.cpp",
1520       ]
1521       sources += skia_sksl_sources
1522       include_dirs = [ "src/sksl" ]
1523     }
1524   }
1525 }