1 # Copyright 2016 Google Inc.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 import("gn/android_framework_defines.gni")
7 import("gn/shared_sources.gni")
10 import("//build/vulkan/config.gni")
13 if (!defined(is_skia_standalone)) {
14 is_skia_standalone = false
16 is_skia_dev_build = is_skia_standalone && !is_official_build
19 skia_use_angle = false
22 skia_use_fontconfig = is_linux
23 skia_use_freetype = is_android || is_fuchsia || is_linux
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
31 skia_use_piex = !is_win
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")
46 skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
47 skia_use_sfntly = skia_use_icu
50 skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
51 } else if (is_fuchsia) {
52 skia_use_vulkan = fuchsia_use_vulkan
54 skia_use_vulkan = skia_vulkan_sdk != ""
58 if (skia_use_vulkan) {
60 skia_vulkan_headers = "$fuchsia_vulkan_sdk/include"
61 } else if (is_linux || is_win) {
62 skia_vulkan_headers = "$skia_vulkan_sdk/include"
64 # When buliding on Android we get the header via the NDK
65 skia_vulkan_headers = ""
68 skia_vulkan_headers = "third_party/vulkan"
72 # Our tools require static linking (they use non-exported symbols).
73 skia_enable_tools = skia_enable_tools && !is_component_build
75 fontmgr_android_enabled = skia_use_expat && skia_use_freetype
77 skia_public_includes = [
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 ]
101 if (is_component_build) {
102 defines += [ "SKIA_DLL" ]
104 if (is_fuchsia || is_linux) {
105 defines += [ "SK_SAMPLES_FOR_X" ]
107 if (skia_enable_android_framework_defines) {
108 defines += android_framework_defines
110 if (!skia_enable_gpu) {
111 defines += [ "SK_SUPPORT_GPU=0" ]
115 # Skia internal APIs, used by Skia itself and a few test tools.
116 config("skia_private") {
117 visibility = [ ":*" ]
125 "src/effects/gradients",
142 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
145 "SK_GAMMA_EXPONENT=1.4",
146 "SK_GAMMA_CONTRAST=0.0",
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" ]
155 if (skia_use_vulkan) {
156 if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) {
159 "$skia_vulkan_sdk/Bin",
160 "$skia_vulkan_sdk/Lib",
163 lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
167 if (skia_enable_gpu) {
168 include_dirs += [ "src/gpu" ]
170 if (skia_use_angle) {
171 defines += [ "SK_ANGLE" ]
173 if (skia_enable_discrete_gpu) {
174 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
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" ]
184 skia_library_configs = [
190 # Use for CPU-specific Skia code that needs particular compiler flags.
192 if (invoker.enabled) {
193 source_set(target_name) {
194 forward_variables_from(invoker, "*")
195 configs += skia_library_configs
198 # If not enabled, a phony empty target that swallows all otherwise unused variables.
199 source_set(target_name) {
200 forward_variables_from(invoker,
210 is_x86 = current_cpu == "x64" || current_cpu == "x86"
213 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
214 sources = skia_opts.none_sources
219 enabled = current_cpu == "arm"
220 sources = skia_opts.armv7_sources
222 sources += skia_opts.neon_sources
228 enabled = current_cpu == "arm64"
229 sources = skia_opts.arm64_sources
234 enabled = current_cpu == "arm64"
235 sources = skia_opts.crc32_sources
236 cflags = [ "-march=armv8-a+crc" ]
241 sources = skia_opts.sse2_sources
243 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
245 cflags = [ "-msse2" ]
251 sources = skia_opts.ssse3_sources
253 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
255 cflags = [ "-mssse3" ]
261 sources = skia_opts.sse41_sources
263 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
265 cflags = [ "-msse4.1" ]
271 sources = skia_opts.sse42_sources
273 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
275 cflags = [ "-msse4.2" ]
281 sources = skia_opts.avx_sources
283 cflags = [ "/arch:AVX" ]
291 sources = skia_opts.hsw_sources
293 cflags = [ "/arch:AVX2" ]
305 # Any feature of Skia that requires third-party code should be optional and use this template.
306 template("optional") {
307 if (invoker.enabled) {
308 config(target_name + "_public") {
309 if (defined(invoker.public_defines)) {
310 defines = invoker.public_defines
313 source_set(target_name) {
314 forward_variables_from(invoker,
318 "sources_when_disabled",
321 all_dependent_configs = [ ":" + target_name + "_public" ]
322 configs += skia_library_configs
323 if (defined(invoker.configs_to_remove)) {
324 configs -= invoker.configs_to_remove
328 source_set(target_name) {
329 forward_variables_from(invoker,
336 "sources_when_disabled",
339 if (defined(invoker.sources_when_disabled)) {
340 sources = invoker.sources_when_disabled
342 configs += skia_library_configs
347 optional("effects") {
348 enabled = skia_enable_effects
350 skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
351 sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
354 optional("fontmgr_android") {
355 enabled = fontmgr_android_enabled
358 ":typeface_freetype",
359 "//third_party/expat",
362 "src/ports/SkFontMgr_android.cpp",
363 "src/ports/SkFontMgr_android_factory.cpp",
364 "src/ports/SkFontMgr_android_parser.cpp",
368 optional("fontmgr_custom") {
369 enabled = is_linux && skia_use_freetype && !skia_use_fontconfig
372 ":typeface_freetype",
375 "src/ports/SkFontMgr_custom.cpp",
376 "src/ports/SkFontMgr_custom.h",
377 "src/ports/SkFontMgr_custom_directory.cpp",
378 "src/ports/SkFontMgr_custom_directory_factory.cpp",
379 "src/ports/SkFontMgr_custom_embedded.cpp",
380 "src/ports/SkFontMgr_custom_empty.cpp",
384 optional("fontmgr_fontconfig") {
385 enabled = skia_use_freetype && skia_use_fontconfig
388 ":typeface_freetype",
389 "//third_party:fontconfig",
392 "src/ports/SkFontConfigInterface.cpp",
393 "src/ports/SkFontConfigInterface_direct.cpp",
394 "src/ports/SkFontConfigInterface_direct_factory.cpp",
395 "src/ports/SkFontMgr_FontConfigInterface.cpp",
396 "src/ports/SkFontMgr_fontconfig.cpp",
397 "src/ports/SkFontMgr_fontconfig_factory.cpp",
401 optional("fontmgr_fuchsia") {
402 enabled = is_fuchsia && skia_use_freetype
405 ":typeface_freetype",
408 "src/ports/SkFontMgr_custom.cpp",
409 "src/ports/SkFontMgr_custom_empty.cpp",
410 "src/ports/SkFontMgr_custom_empty_factory.cpp",
415 enabled = skia_enable_gpu
418 sources = skia_gpu_sources + skia_sksl_sources +
419 [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]
421 # These paths need to be absolute to match the ones produced by shared_sources.gni.
422 sources -= get_path_info([
423 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
424 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
429 sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
430 } else if (skia_use_egl) {
431 sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
433 } else if (is_linux) {
434 sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
435 # GPU is not linked in, but loaded at runtime
442 sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
444 sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
445 } else if (is_win && !is_winrt) {
446 sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
447 libs += [ "OpenGL32.lib" ]
449 sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
452 if (skia_use_vulkan) {
453 public_defines += [ "SK_VULKAN" ]
454 sources += skia_vk_sources
455 if (skia_enable_vulkan_debug_layers) {
456 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
459 if (skia_enable_spirv_validation) {
461 "//third_party/spirv-tools",
463 public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
468 enabled = skia_use_libjpeg_turbo
469 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
472 "//third_party/libjpeg-turbo:libjpeg",
475 "src/codec/SkJpegCodec.cpp",
476 "src/codec/SkJpegDecoderMgr.cpp",
477 "src/codec/SkJpegUtility.cpp",
478 "src/images/SkJPEGWriteUtility.cpp",
479 "src/images/SkJpegEncoder.cpp",
484 enabled = skia_use_zlib && skia_enable_pdf
485 public_defines = [ "SK_SUPPORT_PDF" ]
488 "//third_party/zlib",
490 sources = skia_pdf_sources
491 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
493 if (skia_use_sfntly) {
494 deps += [ "//third_party/sfntly" ]
495 public_defines += [ "SK_PDF_USE_SFNTLY" ]
500 enabled = skia_use_libpng
501 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
504 "//third_party/libpng",
507 "src/codec/SkIcoCodec.cpp",
508 "src/codec/SkPngCodec.cpp",
509 "src/images/SkPngEncoder.cpp",
514 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
515 public_defines = [ "SK_CODEC_DECODES_RAW" ]
518 "//third_party/dng_sdk",
519 "//third_party/libjpeg-turbo:libjpeg",
520 "//third_party/piex",
523 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
525 configs_to_remove = [ "//gn:no_exceptions" ]
528 "src/codec/SkRawAdapterCodec.cpp",
529 "src/codec/SkRawCodec.cpp",
533 optional("typeface_freetype") {
534 enabled = skia_use_freetype
537 "//third_party/freetype2",
540 "src/ports/SkFontHost_FreeType.cpp",
541 "src/ports/SkFontHost_FreeType_common.cpp",
546 enabled = skia_use_libwebp
547 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
550 "//third_party/libwebp",
553 "src/codec/SkWebpAdapterCodec.cpp",
554 "src/codec/SkWebpCodec.cpp",
555 "src/images/SkWebpEncoder.cpp",
560 enabled = skia_use_expat
561 public_defines = [ "SK_XML" ]
564 "//third_party/expat",
567 "src/svg/SkSVGCanvas.cpp",
568 "src/svg/SkSVGDevice.cpp",
570 "src/xml/SkXMLParser.cpp",
571 "src/xml/SkXMLWriter.cpp",
576 public_configs = [ ":skia_public" ]
577 configs += skia_library_configs
587 ":fontmgr_fontconfig",
604 # This file (and all GN files in Skia) are designed to work with an
605 # empty sources assignment filter; we handle all that explicitly.
606 # We clear the filter here for clients who may have set up a global filter.
607 set_sources_assignment_filter([])
610 sources += skia_core_sources
611 sources += skia_utils_sources
612 sources += skia_xps_sources
614 "src/android/SkBitmapRegionCodec.cpp",
615 "src/android/SkBitmapRegionDecoder.cpp",
616 "src/codec/SkAndroidCodec.cpp",
617 "src/codec/SkBmpCodec.cpp",
618 "src/codec/SkBmpMaskCodec.cpp",
619 "src/codec/SkBmpRLECodec.cpp",
620 "src/codec/SkBmpStandardCodec.cpp",
621 "src/codec/SkCodec.cpp",
622 "src/codec/SkCodecImageGenerator.cpp",
623 "src/codec/SkGifCodec.cpp",
624 "src/codec/SkMaskSwizzler.cpp",
625 "src/codec/SkMasks.cpp",
626 "src/codec/SkSampledCodec.cpp",
627 "src/codec/SkSampler.cpp",
628 "src/codec/SkStreamBuffer.cpp",
629 "src/codec/SkSwizzler.cpp",
630 "src/codec/SkWbmpCodec.cpp",
631 "src/images/SkImageEncoder.cpp",
632 "src/ports/SkDiscardableMemory_none.cpp",
633 "src/ports/SkImageGenerator_skia.cpp",
634 "src/ports/SkMemory_malloc.cpp",
635 "src/ports/SkOSFile_stdio.cpp",
636 "src/sfnt/SkOTTable_name.cpp",
637 "src/sfnt/SkOTUtils.cpp",
638 "src/utils/mac/SkStream_mac.cpp",
639 "third_party/gif/SkGifImageReader.cpp",
646 "src/fonts/SkFontMgr_indirect.cpp",
647 "src/ports/SkDebug_win.cpp",
648 "src/ports/SkFontMgr_win_dw.cpp",
649 "src/ports/SkImageEncoder_WIC.cpp",
650 "src/ports/SkImageGeneratorWIC.cpp",
651 "src/ports/SkOSFile_win.cpp",
652 "src/ports/SkOSLibrary_win.cpp",
653 "src/ports/SkScalerContext_win_dw.cpp",
654 "src/ports/SkTLS_win.cpp",
655 "src/ports/SkTypeface_win_dw.cpp",
658 sources += [ "src/ports/SkFontHost_win.cpp" ]
661 sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
667 sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
670 [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
679 "src/ports/SkOSFile_posix.cpp",
680 "src/ports/SkOSLibrary_posix.cpp",
681 "src/ports/SkTLS_pthread.cpp",
687 get_path_info("src/utils/win/SkWGL.h", "abspath"),
688 get_path_info("src/utils/win/SkWGL_win.cpp", "abspath"),
693 deps += [ "//third_party/expat" ]
694 if (defined(ndk) && ndk != "") {
695 deps += [ "//third_party/cpu-features" ]
697 sources += [ "src/ports/SkDebug_android.cpp" ]
706 sources += [ "src/ports/SkDebug_stdio.cpp" ]
711 "src/ports/SkDebug_stdio.cpp",
712 "src/ports/SkFontHost_mac.cpp",
713 "src/ports/SkImageEncoder_CG.cpp",
714 "src/ports/SkImageGeneratorCG.cpp",
717 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
719 "ApplicationServices.framework",
726 "src/ports/SkDebug_stdio.cpp",
727 "src/ports/SkFontHost_mac.cpp",
728 "src/ports/SkImageEncoder_CG.cpp",
729 "src/ports/SkImageGeneratorCG.cpp",
732 "CoreFoundation.framework",
733 "CoreGraphics.framework",
734 "CoreText.framework",
736 "MobileCoreServices.framework",
738 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
744 sources += [ "src/ports/SkDebug_stdio.cpp" ]
748 config("SkiaSharp_public") {
749 include_dirs = skia_public_includes + [ "include/xamarin" ]
750 defines = [ "SKIA_C_DLL" ]
752 defines += [ "SK_SAMPLES_FOR_X" ]
754 if (!skia_enable_gpu) {
755 defines += [ "SK_SUPPORT_GPU=0" ]
759 shared_library("SkiaSharp") {
760 public_configs = [ ":skia_public", ":SkiaSharp_public" ]
761 configs += skia_library_configs + [ ":SkiaSharp_public", "//gn:debug_symbols" ]
767 # clear the sources and add explicitly
768 set_sources_assignment_filter([])
770 "src/xamarin/sk_managedpixelserializer.cpp",
771 "src/xamarin/sk_managedstream.cpp",
772 "src/xamarin/sk_xamarin.cpp",
773 "src/xamarin/SkiaKeeper.c",
774 "src/xamarin/SkManagedPixelSerializer.cpp",
775 "src/xamarin/SkManagedStream.cpp",
776 "src/xamarin/WinRTCompat.cpp",
782 # Targets guarded by skia_enable_tools may use //third_party freely.
783 if (skia_enable_tools) {
784 # Used by gn_to_bp.py to list our public include dirs.
785 source_set("public") {
786 configs += [ ":skia_public" ]
789 config("skia.h_config") {
790 include_dirs = [ "$target_gen_dir" ]
793 public_configs = [ ":skia.h_config" ]
794 skia_h = "$target_gen_dir/skia.h"
795 script = "gn/find_headers.py"
796 args = [ rebase_path(skia_h, root_build_dir) ] +
797 rebase_path(skia_public_includes) +
798 [ rebase_path("third_party/vulkan") ]
799 depfile = "$skia_h.deps"
805 if (skia_enable_gpu && target_cpu == "x64") {
806 # Our bots only have 64-bit libOSMesa installed.
807 # TODO: worth fixing?
808 executable("fiddle") {
815 "tools/fiddle/draw.cpp",
816 "tools/fiddle/fiddle_main.cpp",
827 if (skia_enable_gpu) {
828 source_set("public_headers_warnings_check") {
830 "tools/public_headers_warnings_check.cpp",
832 configs -= [ "//gn:warnings_except_public_headers" ]
840 template("test_lib") {
841 config(target_name + "_config") {
842 include_dirs = invoker.public_include_dirs
843 if (defined(invoker.public_defines)) {
844 defines = invoker.public_defines
847 source_set(target_name) {
848 forward_variables_from(invoker, "*", [ "public_include_dirs" ])
850 ":" + target_name + "_config",
854 if (!defined(deps)) {
862 template("test_app") {
863 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
864 shared_library("lib" + target_name) {
865 forward_variables_from(invoker, "*", [ "is_shared_library" ])
869 _executable = target_name
870 executable(_executable) {
871 forward_variables_from(invoker, "*", [ "is_shared_library" ])
875 if (is_android && skia_android_serial != "" && defined(_executable)) {
876 action("push_" + target_name) {
877 script = "gn/push_to_android.py"
881 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
886 rebase_path("$root_build_dir/$_executable"),
895 test_lib("gpu_tool_utils") {
896 public_include_dirs = []
897 if (skia_enable_gpu) {
899 public_include_dirs += [ "tools/gpu" ]
903 "tools/gpu/GrContextFactory.cpp",
904 "tools/gpu/GrTest.cpp",
905 "tools/gpu/TestContext.cpp",
906 "tools/gpu/gl/GLTestContext.cpp",
907 "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
908 "tools/gpu/gl/debug/DebugGLTestContext.cpp",
909 "tools/gpu/gl/debug/GrBufferObj.cpp",
910 "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
911 "tools/gpu/gl/debug/GrProgramObj.cpp",
912 "tools/gpu/gl/debug/GrShaderObj.cpp",
913 "tools/gpu/gl/debug/GrTextureObj.cpp",
914 "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
915 "tools/gpu/gl/null/NullGLTestContext.cpp",
919 if (is_android || skia_use_egl) {
920 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
922 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
923 libs += [ "OpenGLES.framework" ]
924 } else if (is_linux) {
925 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
928 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
930 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
937 if (skia_use_angle) {
938 deps += [ "//third_party/angle2" ]
939 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
942 public_defines += [ "SK_MESA" ]
943 sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
946 if (skia_use_vulkan) {
947 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
949 libs += [ "vulkan-1.lib" ]
958 public_include_dirs = [ "tools/flags" ]
960 "tools/flags/SkCommandLineFlags.cpp",
963 test_lib("common_flags") {
964 public_include_dirs = [ "tools/flags" ]
966 "tools/flags/SkCommonFlags.cpp",
967 "tools/flags/SkCommonFlagsConfig.cpp",
975 test_lib("tool_utils") {
976 public_include_dirs = [
982 "tools/AndroidSkDebugToStdOut.cpp",
983 "tools/CrashHandler.cpp",
984 "tools/LsanSuppressions.cpp",
985 "tools/ProcStats.cpp",
986 "tools/Resources.cpp",
987 "tools/ThermalManager.cpp",
988 "tools/UrlDataManager.cpp",
989 "tools/debugger/SkDebugCanvas.cpp",
990 "tools/debugger/SkDrawCommand.cpp",
991 "tools/debugger/SkJsonWriteBuffer.cpp",
992 "tools/debugger/SkObjectParser.cpp",
993 "tools/picture_utils.cpp",
994 "tools/random_parse_path.cpp",
995 "tools/sk_tool_utils.cpp",
996 "tools/sk_tool_utils_font.cpp",
997 "tools/timer/Timer.cpp",
1001 sources += [ "tools/ios_utils.m" ]
1002 libs += [ "Foundation.framework" ]
1007 "//third_party/libpng",
1010 "//third_party/jsoncpp",
1016 public_include_dirs = [ "gm" ]
1017 sources = gm_sources
1026 import("gn/tests.gni")
1028 public_include_dirs = [ "tests" ]
1029 sources = tests_sources + pathops_tests_sources
1030 if (!fontmgr_android_enabled) {
1031 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
1034 ":experimental_svg_model",
1038 "//third_party/libpng",
1039 "//third_party/zlib",
1042 ":gpu_tool_utils", # Test.h #includes headers from this target.
1046 import("gn/bench.gni")
1048 public_include_dirs = [ "bench" ]
1049 sources = bench_sources
1059 test_lib("experimental_svg_model") {
1060 public_include_dirs = [ "experimental/svg/model" ]
1062 "experimental/svg/model/SkSVGAttribute.cpp",
1063 "experimental/svg/model/SkSVGAttributeParser.cpp",
1064 "experimental/svg/model/SkSVGCircle.cpp",
1065 "experimental/svg/model/SkSVGClipPath.cpp",
1066 "experimental/svg/model/SkSVGContainer.cpp",
1067 "experimental/svg/model/SkSVGDOM.cpp",
1068 "experimental/svg/model/SkSVGEllipse.cpp",
1069 "experimental/svg/model/SkSVGLine.cpp",
1070 "experimental/svg/model/SkSVGLinearGradient.cpp",
1071 "experimental/svg/model/SkSVGNode.cpp",
1072 "experimental/svg/model/SkSVGPath.cpp",
1073 "experimental/svg/model/SkSVGPoly.cpp",
1074 "experimental/svg/model/SkSVGRect.cpp",
1075 "experimental/svg/model/SkSVGRenderContext.cpp",
1076 "experimental/svg/model/SkSVGSVG.cpp",
1077 "experimental/svg/model/SkSVGShape.cpp",
1078 "experimental/svg/model/SkSVGStop.cpp",
1079 "experimental/svg/model/SkSVGTransformableNode.cpp",
1080 "experimental/svg/model/SkSVGValue.cpp",
1088 public_include_dirs = [ "include/views" ]
1090 "src/views/SkEvent.cpp",
1091 "src/views/SkEventSink.cpp",
1092 "src/views/SkOSMenu.cpp",
1093 "src/views/SkTagList.cpp",
1094 "src/views/SkTouchGesture.cpp",
1095 "src/views/SkView.cpp",
1096 "src/views/SkViewPriv.cpp",
1101 sources += [ "src/views/SkWindow.cpp" ]
1104 public_include_dirs += [ "src/views/unix" ]
1106 "src/views/unix/SkOSWindow_Unix.cpp",
1107 "src/views/unix/keysym2ucs.c",
1113 } else if (is_mac) {
1115 "src/views/mac/SkEventNotifier.mm",
1116 "src/views/mac/SkNSView.mm",
1117 "src/views/mac/SkOSWindow_Mac.mm",
1118 "src/views/mac/SkTextFieldCell.m",
1121 "QuartzCore.framework",
1123 "Foundation.framework",
1125 } else if (is_win) {
1126 sources += [ "src/views/win/SkOSWindow_win.cpp" ]
1128 if (skia_use_angle) {
1129 deps += [ "//third_party/angle2" ]
1135 public_include_dirs = []
1137 "src/utils/SkLua.cpp",
1138 "src/utils/SkLuaCanvas.cpp",
1141 "//third_party/lua",
1145 test_app("lua_app") {
1147 "tools/lua/lua_app.cpp",
1152 "//third_party/lua",
1156 test_app("lua_pictures") {
1158 "tools/lua/lua_pictures.cpp",
1165 "//third_party/lua",
1170 import("gn/samples.gni")
1171 test_lib("samples") {
1172 public_include_dirs = [ "samplecode" ]
1173 include_dirs = [ "experimental" ]
1174 sources = samples_sources + [
1175 "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
1176 "experimental/SkSetPoly3To3.cpp",
1177 "experimental/SkSetPoly3To3_A.cpp",
1178 "experimental/SkSetPoly3To3_D.cpp",
1181 ":experimental_svg_model",
1190 sources += [ "samplecode/SampleLua.cpp" ]
1193 "//third_party/lua",
1201 "dm/DMJsonWriter.cpp",
1204 include_dirs = [ "tests" ]
1207 ":experimental_svg_model",
1214 "//third_party/jsoncpp",
1215 "//third_party/libpng",
1222 "tools/ok_dsts.cpp",
1223 "tools/ok_srcs.cpp",
1224 "tools/ok_test.cpp",
1225 "tools/ok_vias.cpp",
1235 if (!is_debug) { # I've benchmarked debug code once too many times...
1236 test_app("monobench") {
1238 "tools/monobench.cpp",
1247 test_app("nanobench") {
1249 "bench/nanobench.cpp",
1254 ":experimental_svg_model",
1260 "//third_party/jsoncpp",
1264 test_app("skpinfo") {
1266 "tools/skpinfo.cpp",
1274 if (is_linux || is_win || is_mac) {
1275 test_app("SampleApp") {
1277 "samplecode/SampleApp.cpp",
1278 "samplecode/SamplePictFile.cpp",
1281 sources += [ "src/views/mac/skia_mac.mm" ]
1282 } else if (is_win) {
1283 sources += [ "src/views/win/skia_win.cpp" ]
1284 } else if (is_linux) {
1285 sources += [ "src/views/unix/skia_unix.cpp" ]
1296 if (skia_use_angle) {
1297 deps += [ "//third_party/angle2" ]
1302 if (skia_enable_gpu) {
1303 test_app("skpbench") {
1305 "tools/skpbench/skpbench.cpp",
1316 # We can't yet build ICU on iOS or Windows.
1317 if (!is_ios && !is_win) {
1318 test_app("sktexttopdf-hb") {
1320 "tools/SkShaper_harfbuzz.cpp",
1321 "tools/using_skia_and_harfbuzz.cpp",
1325 "//third_party/harfbuzz",
1329 test_app("sktexttopdf") {
1331 "tools/SkShaper_primitive.cpp",
1332 "tools/using_skia_and_harfbuzz.cpp",
1339 test_app("create_flutter_test_images") {
1341 "tools/create_flutter_test_images.cpp",
1349 test_app("get_images_from_skps") {
1351 "tools/get_images_from_skps.cpp",
1356 "//third_party/jsoncpp",
1360 test_app("colorspaceinfo") {
1362 "tools/colorspaceinfo.cpp",
1372 test_app("skiaserve") {
1374 "tools/skiaserve/Request.cpp",
1375 "tools/skiaserve/Response.cpp",
1376 "tools/skiaserve/skiaserve.cpp",
1377 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
1378 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
1379 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
1380 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
1381 "tools/skiaserve/urlhandlers/DataHandler.cpp",
1382 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
1383 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
1384 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
1385 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
1386 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
1387 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
1388 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
1389 "tools/skiaserve/urlhandlers/PostHandler.cpp",
1390 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
1391 "tools/skiaserve/urlhandlers/RootHandler.cpp",
1398 "//third_party/jsoncpp",
1399 "//third_party/libmicrohttpd",
1400 "//third_party/libpng",
1407 "fuzz/FilterFuzz.cpp",
1408 "fuzz/FuzzCanvas.cpp",
1409 "fuzz/FuzzDrawFunctions.cpp",
1410 "fuzz/FuzzGradients.cpp",
1411 "fuzz/FuzzParsePath.cpp",
1412 "fuzz/FuzzPathop.cpp",
1413 "fuzz/FuzzScaleToSides.cpp",
1424 test_app("pathops_unittest") {
1425 sources = pathops_tests_sources + [
1426 rebase_path("tests/skia_test.cpp"),
1427 rebase_path("tests/Test.cpp"),
1437 test_app("dump_record") {
1439 "tools/DumpRecord.cpp",
1440 "tools/dump_record.cpp",
1448 test_app("skdiff") {
1450 "tools/skdiff/skdiff.cpp",
1451 "tools/skdiff/skdiff_html.cpp",
1452 "tools/skdiff/skdiff_main.cpp",
1453 "tools/skdiff/skdiff_utils.cpp",
1461 test_app("skp_parser") {
1463 "tools/skp_parser.cpp",
1468 "//third_party/jsoncpp",
1472 if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
1473 test_app("viewer") {
1474 is_shared_library = is_android
1476 "tools/viewer/GMSlide.cpp",
1477 "tools/viewer/ImageSlide.cpp",
1478 "tools/viewer/SKPSlide.cpp",
1479 "tools/viewer/SampleSlide.cpp",
1480 "tools/viewer/Viewer.cpp",
1481 "tools/viewer/sk_app/CommandSet.cpp",
1482 "tools/viewer/sk_app/GLWindowContext.cpp",
1483 "tools/viewer/sk_app/Window.cpp",
1489 "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
1490 "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
1491 "tools/viewer/sk_app/android/Window_android.cpp",
1492 "tools/viewer/sk_app/android/main_android.cpp",
1493 "tools/viewer/sk_app/android/surface_glue_android.cpp",
1495 libs += [ "android" ]
1496 } else if (is_linux) {
1498 "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
1499 "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
1500 "tools/viewer/sk_app/unix/Window_unix.cpp",
1501 "tools/viewer/sk_app/unix/main_unix.cpp",
1503 } else if (is_win) {
1505 "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
1506 "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
1507 "tools/viewer/sk_app/win/Window_win.cpp",
1508 "tools/viewer/sk_app/win/main_win.cpp",
1510 } else if (is_mac) {
1512 "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
1513 "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
1514 "tools/viewer/sk_app/mac/Window_mac.cpp",
1515 "tools/viewer/sk_app/mac/main_mac.cpp",
1519 if (skia_use_vulkan) {
1520 sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
1523 [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
1524 } else if (is_linux) {
1525 sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
1526 libs += [ "X11-xcb" ]
1527 } else if (is_win) {
1528 sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
1541 "//third_party/imgui",
1542 "//third_party/jsoncpp",
1545 deps += [ "//third_party/native_app_glue" ]
1546 } else if (is_mac) {
1547 deps += [ "//third_party/libsdl" ]
1552 if (is_android && defined(ndk) && ndk != "") {
1555 "$ndk/$ndk_gdbserver",
1558 "$root_out_dir/gdbserver",
1563 if (skia_enable_gpu) {
1565 defines = [ "SKSL_STANDALONE" ]
1567 "src/sksl/SkSLMain.cpp",
1569 sources += skia_sksl_sources
1570 include_dirs = [ "src/sksl" ]