# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("gn/android_framework_defines.gni")
import("gn/shared_sources.gni")

if (!defined(is_skia_standalone)) {
  is_skia_standalone = false
}
is_skia_dev_build = is_skia_standalone && !is_official_build

declare_args() {
  skia_use_angle = false
  skia_use_egl = false
  skia_use_expat = true
  skia_use_fontconfig = is_linux
  skia_use_freetype = is_android || is_fuchsia || is_linux
  skia_use_gdi = false
  skia_use_icu = !is_fuchsia && !is_ios && !is_win  # TODO: Windows
  skia_use_libjpeg_turbo = true
  skia_use_libpng = true
  skia_use_libwebp = !is_fuchsia
  skia_use_lua = false
  skia_use_mesa = false
  skia_use_piex = !is_win
  skia_use_zlib = true

  skia_android_serial = ""
  skia_enable_android_framework_defines = false
  skia_enable_discrete_gpu = true
  skia_enable_effects = true
  skia_enable_gpu = true
  skia_enable_pdf = true
  skia_enable_spirv_validation = is_skia_dev_build && is_debug
  skia_enable_tools = is_skia_dev_build
  skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
  skia_vulkan_sdk = getenv("VULKAN_SDK")
  skia_link_with_vulkan = !is_fuchsia
}
declare_args() {
  skia_use_dng_sdk = !is_fuchsia && skia_use_libjpeg_turbo && skia_use_zlib
  skia_use_sfntly = skia_use_icu

  if (is_android) {
    skia_use_vulkan = defined(ndk_api) && ndk_api >= 24
  } else {
    skia_use_vulkan = skia_vulkan_sdk != ""
  }
  if (is_win) {
    skia_vulkan_headers_path = "$skia_vulkan_sdk/Include"
  } else {
    skia_vulkan_headers_path = "$skia_vulkan_sdk/include"
  }
}

# Our tools require static linking (they use non-exported symbols).
skia_enable_tools = skia_enable_tools && !is_component_build

fontmgr_android_enabled = skia_use_expat && skia_use_freetype

skia_public_includes = [
  "include/android",
  "include/c",
  "include/codec",
  "include/config",
  "include/core",
  "include/effects",
  "include/gpu",
  "include/gpu/gl",
  "include/pathops",
  "include/ports",
  "include/svg",
  "include/utils",
  "include/utils/mac",
  skia_vulkan_headers_path,
]

# Skia public API, generally provided by :skia.
config("skia_public") {
  include_dirs = skia_public_includes
  defines = []
  if (is_component_build) {
    defines += [ "SKIA_DLL" ]
  }
  if (is_fuchsia || is_linux) {
    defines += [ "SK_SAMPLES_FOR_X" ]
  }
  if (skia_enable_android_framework_defines) {
    defines += android_framework_defines
  }
  if (!skia_enable_gpu) {
    defines += [ "SK_SUPPORT_GPU=0" ]
  }
}

# Skia internal APIs, used by Skia itself and a few test tools.
config("skia_private") {
  visibility = [ ":*" ]

  include_dirs = [
    "include/private",
    "src/c",
    "src/codec",
    "src/core",
    "src/effects",
    "src/effects/gradients",
    "src/fonts",
    "src/image",
    "src/images",
    "src/lazy",
    "src/opts",
    "src/pathops",
    "src/pdf",
    "src/ports",
    "src/sfnt",
    "src/sksl",
    "src/utils",
    "src/utils/win",
    "src/xml",
    "third_party/etc1",
    "third_party/gif",
  ]

  defines = [
    "SK_GAMMA_APPLY_TO_A8",
    "SK_INTERNAL",
  ]
  if (is_android) {
    defines += [
      "SK_GAMMA_EXPONENT=1.4",
      "SK_GAMMA_CONTRAST=0.0",
    ]
  }
  if (is_official_build || is_android) {
    # TODO(bsalomon): it'd be nice to make Android normal.
    defines += [ "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0" ]
  }
  libs = []
  lib_dirs = []
  if (skia_use_vulkan) {
    if (skia_vulkan_sdk != "" && !is_android && !is_fuchsia) {
      if (is_win) {
        lib_dirs += [
          "$skia_vulkan_sdk/Bin",
          "$skia_vulkan_sdk/Lib",
        ]
      } else {
        lib_dirs += [ "$skia_vulkan_sdk/lib/" ]
      }
    }

    if (skia_link_with_vulkan) {
      defines += [ "SK_LINK_WITH_VULKAN" ]
      if (is_win) {
        libs += [ "vulkan-1.lib" ]
      } else {
        libs += [ "vulkan" ]
      }
    }
  }
  if (skia_enable_gpu) {
    include_dirs += [ "src/gpu" ]
  }
  if (skia_use_angle) {
    defines += [ "SK_ANGLE" ]
  }
  if (skia_enable_discrete_gpu) {
    defines += [ "SK_ENABLE_DISCRETE_GPU" ]
  }
}

# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
config("skia_library") {
  visibility = [ ":*" ]
  defines = [ "SKIA_IMPLEMENTATION=1" ]
}

skia_library_configs = [
  ":skia_public",
  ":skia_private",
  ":skia_library",
]

# Use for CPU-specific Skia code that needs particular compiler flags.
template("opts") {
  if (invoker.enabled) {
    source_set(target_name) {
      forward_variables_from(invoker, "*")
      configs += skia_library_configs
    }
  } else {
    # If not enabled, a phony empty target that swallows all otherwise unused variables.
    source_set(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "sources",
                               "cflags",
                             ])
    }
  }
}

is_x86 = current_cpu == "x64" || current_cpu == "x86"

opts("none") {
  enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
  sources = skia_opts.none_sources
  cflags = []
}

opts("armv7") {
  enabled = current_cpu == "arm"
  sources = skia_opts.armv7_sources + skia_opts.neon_sources
  cflags = []
}

opts("arm64") {
  enabled = current_cpu == "arm64"
  sources = skia_opts.arm64_sources
  cflags = []
}

opts("crc32") {
  enabled = current_cpu == "arm64"
  sources = skia_opts.crc32_sources
  cflags = [ "-march=armv8-a+crc" ]
}

opts("sse2") {
  enabled = is_x86
  sources = skia_opts.sse2_sources
  if (is_win) {
    defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
  } else {
    cflags = [ "-msse2" ]
  }
}

opts("ssse3") {
  enabled = is_x86
  sources = skia_opts.ssse3_sources
  if (is_win) {
    defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
  } else {
    cflags = [ "-mssse3" ]
  }
}

opts("sse41") {
  enabled = is_x86
  sources = skia_opts.sse41_sources
  if (is_win) {
    defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
  } else {
    cflags = [ "-msse4.1" ]
  }
}

opts("sse42") {
  enabled = is_x86
  sources = skia_opts.sse42_sources
  if (is_win) {
    defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
  } else {
    cflags = [ "-msse4.2" ]
  }
}

opts("avx") {
  enabled = is_x86
  sources = skia_opts.avx_sources
  if (is_win) {
    cflags = [ "/arch:AVX" ]
  } else {
    cflags = [ "-mavx" ]
  }
}

opts("hsw") {
  enabled = is_x86
  sources = skia_opts.hsw_sources
  if (is_win) {
    cflags = [ "/arch:AVX2" ]
  } else {
    cflags = [
      "-mavx2",
      "-mbmi",
      "-mbmi2",
      "-mf16c",
      "-mfma",
    ]
  }
}

# Any feature of Skia that requires third-party code should be optional and use this template.
template("optional") {
  if (invoker.enabled) {
    config(target_name + "_public") {
      if (defined(invoker.public_defines)) {
        defines = invoker.public_defines
      }
    }
    source_set(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "public_defines",
                               "sources_when_disabled",
                               "configs_to_remove",
                             ])
      all_dependent_configs = [ ":" + target_name + "_public" ]
      configs += skia_library_configs
      if (defined(invoker.configs_to_remove)) {
        configs -= invoker.configs_to_remove
      }
    }
  } else {
    source_set(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "public_defines",
                               "deps",
                               "libs",
                               "sources",
                               "sources_when_disabled",
                               "configs_to_remove",
                             ])
      if (defined(invoker.sources_when_disabled)) {
        sources = invoker.sources_when_disabled
      }
      configs += skia_library_configs
    }
  }
}

optional("effects") {
  enabled = skia_enable_effects
  sources =
      skia_effects_sources + [ "src/ports/SkGlobalInitialization_default.cpp" ]
  sources_when_disabled = [ "src/ports/SkGlobalInitialization_none.cpp" ]
}

optional("fontmgr_android") {
  enabled = fontmgr_android_enabled

  deps = [
    ":typeface_freetype",
    "//third_party/expat",
  ]
  sources = [
    "src/ports/SkFontMgr_android.cpp",
    "src/ports/SkFontMgr_android_factory.cpp",
    "src/ports/SkFontMgr_android_parser.cpp",
  ]
}

optional("fontmgr_custom") {
  enabled = is_linux && skia_use_freetype && !skia_use_fontconfig

  deps = [
    ":typeface_freetype",
  ]
  sources = [
    "src/ports/SkFontMgr_custom.cpp",
    "src/ports/SkFontMgr_custom.h",
    "src/ports/SkFontMgr_custom_directory.cpp",
    "src/ports/SkFontMgr_custom_directory_factory.cpp",
    "src/ports/SkFontMgr_custom_embedded.cpp",
    "src/ports/SkFontMgr_custom_empty.cpp",
  ]
}

optional("fontmgr_fontconfig") {
  enabled = skia_use_freetype && skia_use_fontconfig

  deps = [
    ":typeface_freetype",
    "//third_party:fontconfig",
  ]
  sources = [
    "src/ports/SkFontConfigInterface.cpp",
    "src/ports/SkFontConfigInterface_direct.cpp",
    "src/ports/SkFontConfigInterface_direct_factory.cpp",
    "src/ports/SkFontMgr_FontConfigInterface.cpp",
    "src/ports/SkFontMgr_fontconfig.cpp",
    "src/ports/SkFontMgr_fontconfig_factory.cpp",
  ]
}

optional("fontmgr_fuchsia") {
  enabled = is_fuchsia && skia_use_freetype

  deps = [
    ":typeface_freetype",
  ]
  sources = [
    "src/ports/SkFontMgr_custom.cpp",
    "src/ports/SkFontMgr_custom_empty.cpp",
    "src/ports/SkFontMgr_custom_empty_factory.cpp",
  ]
}

optional("gpu") {
  enabled = skia_enable_gpu
  public_defines = []

  sources = skia_gpu_sources + skia_sksl_sources +
            [ "src/gpu/gl/GrGLDefaultInterface_native.cpp" ]

  # These paths need to be absolute to match the ones produced by shared_sources.gni.
  sources -= get_path_info([
                             "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
                             "src/gpu/gl/GrGLDefaultInterface_none.cpp",
                           ],
                           "abspath")
  libs = []
  if (is_android) {
    sources += [ "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp" ]
  } else if (skia_use_egl) {
    sources += [ "src/gpu/gl/egl/GrGLCreateNativeInterface_egl.cpp" ]
    libs += [ "EGL" ]
  } else if (is_linux) {
    sources += [ "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp" ]
    libs += [
      "GL",
      "GLU",
    ]
  } else if (is_mac) {
    sources += [ "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp" ]
  } else if (is_ios) {
    sources += [ "src/gpu/gl/iOS/GrGLCreateNativeInterface_iOS.cpp" ]
  } else if (is_win) {
    sources += [ "src/gpu/gl/win/GrGLCreateNativeInterface_win.cpp" ]
    libs += [ "OpenGL32.lib" ]
  } else {
    sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
  }

  if (skia_use_vulkan) {
    public_defines += [ "SK_VULKAN" ]
    sources += skia_vk_sources
    if (skia_enable_vulkan_debug_layers) {
      public_defines += [ "SK_ENABLE_VK_LAYERS" ]
    }
  }
  if (skia_enable_spirv_validation) {
    deps = [
      "//third_party/spirv-tools",
    ]
    public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
  }
}

optional("jpeg") {
  enabled = skia_use_libjpeg_turbo
  public_defines = [ "SK_HAS_JPEG_LIBRARY" ]

  deps = [
    "//third_party/libjpeg-turbo:libjpeg",
  ]
  sources = [
    "src/codec/SkJpegCodec.cpp",
    "src/codec/SkJpegDecoderMgr.cpp",
    "src/codec/SkJpegUtility.cpp",
    "src/images/SkJPEGImageEncoder.cpp",
    "src/images/SkJPEGWriteUtility.cpp",
  ]
}

optional("pdf") {
  enabled = skia_use_zlib && skia_enable_pdf
  public_defines = [ "SK_SUPPORT_PDF" ]

  deps = [
    "//third_party/zlib",
  ]
  sources = skia_pdf_sources
  sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]

  if (skia_use_sfntly) {
    deps += [ "//third_party/sfntly" ]
    public_defines += [ "SK_PDF_USE_SFNTLY" ]
  }
}

optional("png") {
  enabled = skia_use_libpng
  public_defines = [ "SK_HAS_PNG_LIBRARY" ]

  deps = [
    "//third_party/libpng",
  ]
  sources = [
    "src/codec/SkIcoCodec.cpp",
    "src/codec/SkPngCodec.cpp",
    "src/images/SkPNGImageEncoder.cpp",
  ]
}

optional("raw") {
  enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo && skia_use_piex
  public_defines = [ "SK_CODEC_DECODES_RAW" ]

  deps = [
    "//third_party/dng_sdk",
    "//third_party/libjpeg-turbo:libjpeg",
    "//third_party/piex",
  ]

  # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
  # Skia.
  configs_to_remove = [ "//gn:no_exceptions" ]

  sources = [
    "src/codec/SkRawAdapterCodec.cpp",
    "src/codec/SkRawCodec.cpp",
  ]
}

optional("typeface_freetype") {
  enabled = skia_use_freetype

  deps = [
    "//third_party/freetype2",
  ]
  sources = [
    "src/ports/SkFontHost_FreeType.cpp",
    "src/ports/SkFontHost_FreeType_common.cpp",
  ]
}

optional("webp") {
  enabled = skia_use_libwebp
  public_defines = [ "SK_HAS_WEBP_LIBRARY" ]

  deps = [
    "//third_party/libwebp",
  ]
  sources = [
    "src/codec/SkWebpAdapterCodec.cpp",
    "src/codec/SkWebpCodec.cpp",
    "src/images/SkWEBPImageEncoder.cpp",
  ]
}

optional("xml") {
  enabled = skia_use_expat
  public_defines = [ "SK_XML" ]

  deps = [
    "//third_party/expat",
  ]
  sources = [
    "src/svg/SkSVGCanvas.cpp",
    "src/svg/SkSVGDevice.cpp",
    "src/xml/SkDOM.cpp",
    "src/xml/SkXMLParser.cpp",
    "src/xml/SkXMLWriter.cpp",
  ]
}

component("skia") {
  public_configs = [ ":skia_public" ]
  configs += skia_library_configs

  deps = [
    ":arm64",
    ":armv7",
    ":avx",
    ":crc32",
    ":effects",
    ":fontmgr_android",
    ":fontmgr_custom",
    ":fontmgr_fontconfig",
    ":fontmgr_fuchsia",
    ":gpu",
    ":hsw",
    ":jpeg",
    ":none",
    ":pdf",
    ":png",
    ":raw",
    ":sse2",
    ":sse41",
    ":sse42",
    ":ssse3",
    ":webp",
    ":xml",
  ]

  # This file (and all GN files in Skia) are designed to work with an
  # empty sources assignment filter; we handle all that explicitly.
  # We clear the filter here for clients who may have set up a global filter.
  set_sources_assignment_filter([])

  sources = []
  sources += skia_core_sources
  sources += skia_utils_sources
  sources += skia_xps_sources
  sources += [
    "src/android/SkBitmapRegionCodec.cpp",
    "src/android/SkBitmapRegionDecoder.cpp",
    "src/codec/SkAndroidCodec.cpp",
    "src/codec/SkBmpCodec.cpp",
    "src/codec/SkBmpMaskCodec.cpp",
    "src/codec/SkBmpRLECodec.cpp",
    "src/codec/SkBmpStandardCodec.cpp",
    "src/codec/SkCodec.cpp",
    "src/codec/SkCodecImageGenerator.cpp",
    "src/codec/SkGifCodec.cpp",
    "src/codec/SkMaskSwizzler.cpp",
    "src/codec/SkMasks.cpp",
    "src/codec/SkSampledCodec.cpp",
    "src/codec/SkSampler.cpp",
    "src/codec/SkStreamBuffer.cpp",
    "src/codec/SkSwizzler.cpp",
    "src/codec/SkWbmpCodec.cpp",
    "src/images/SkImageEncoder.cpp",
    "src/ports/SkDiscardableMemory_none.cpp",
    "src/ports/SkImageGenerator_skia.cpp",
    "src/ports/SkMemory_malloc.cpp",
    "src/ports/SkOSFile_stdio.cpp",
    "src/sfnt/SkOTTable_name.cpp",
    "src/sfnt/SkOTUtils.cpp",
    "src/utils/mac/SkStream_mac.cpp",
    "third_party/etc1/etc1.cpp",
    "third_party/gif/SkGifImageReader.cpp",
  ]

  libs = []

  if (is_win) {
    sources += [
      "src/fonts/SkFontMgr_indirect.cpp",
      "src/ports/SkDebug_win.cpp",
      "src/ports/SkFontHost_win.cpp",
      "src/ports/SkFontMgr_win_dw.cpp",
      "src/ports/SkImageEncoder_WIC.cpp",
      "src/ports/SkImageGeneratorWIC.cpp",
      "src/ports/SkOSFile_win.cpp",
      "src/ports/SkOSLibrary_win.cpp",
      "src/ports/SkScalerContext_win_dw.cpp",
      "src/ports/SkTLS_win.cpp",
      "src/ports/SkTypeface_win_dw.cpp",
    ]
    if (skia_use_gdi) {
      sources += [ "src/ports/SkFontMgr_win_gdi_factory.cpp" ]
      libs += [
        "Gdi32.lib",
        "Usp10.lib",
      ]
    } else {
      sources += [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
    }
    sources -=
        [ get_path_info("src/utils/SkThreadUtils_pthread.cpp", "abspath") ]
    libs += [
      "FontSub.lib",
      "Ole32.lib",
      "OleAut32.lib",
      "User32.lib",
    ]
  } else {
    sources += [
      "src/ports/SkOSFile_posix.cpp",
      "src/ports/SkOSLibrary_posix.cpp",
      "src/ports/SkTLS_pthread.cpp",
    ]
  }

  if (is_android) {
    deps += [ "//third_party/expat" ]
    if (defined(ndk) && ndk != "") {
      deps += [ "//third_party/cpu-features" ]
    }
    sources += [ "src/ports/SkDebug_android.cpp" ]
    libs += [
      "EGL",
      "GLESv2",
      "log",
    ]
  }

  if (is_linux) {
    sources += [ "src/ports/SkDebug_stdio.cpp" ]
  }

  if (is_mac) {
    sources += [
      "src/ports/SkDebug_stdio.cpp",
      "src/ports/SkFontHost_mac.cpp",
      "src/ports/SkImageEncoder_CG.cpp",
      "src/ports/SkImageGeneratorCG.cpp",
    ]
    libs += [
      # AppKit symbols NSFontWeightXXX may be dlsym'ed.
      "AppKit.framework",
      "ApplicationServices.framework",
      "OpenGL.framework",
    ]
  }

  if (is_ios) {
    sources += [
      "src/ports/SkDebug_stdio.cpp",
      "src/ports/SkFontHost_mac.cpp",
      "src/ports/SkImageEncoder_CG.cpp",
      "src/ports/SkImageGeneratorCG.cpp",
    ]
    libs += [
      "CoreFoundation.framework",
      "CoreGraphics.framework",
      "CoreText.framework",
      "ImageIO.framework",
      "MobileCoreServices.framework",

      # UIKit symbols UIFontWeightXXX may be dlsym'ed.
      "UIKit.framework",
    ]
  }

  if (is_fuchsia) {
    sources += [ "src/ports/SkDebug_stdio.cpp" ]
  }
}

# Targets guarded by skia_enable_tools may use //third_party freely.
if (skia_enable_tools) {
  # Used by gn_to_bp.py to list our public include dirs.
  source_set("public") {
    configs += [ ":skia_public" ]
  }

  config("skia.h_config") {
    include_dirs = [ "$target_gen_dir" ]
  }
  action("skia.h") {
    public_configs = [ ":skia.h_config" ]
    skia_h = "$target_gen_dir/skia.h"
    script = "gn/find_headers.py"
    if (skia_use_vulkan) {
      use_vulkan_string = "True"
    } else {
      use_vulkan_string = "False"
    }
    args = [
             rebase_path(skia_h, root_build_dir),
             use_vulkan_string,
           ] + rebase_path(skia_public_includes - [ skia_vulkan_headers_path ])
    depfile = "$skia_h.deps"
    outputs = [
      skia_h,
    ]
  }

  if (skia_enable_gpu && target_cpu == "x64") {
    # Our bots only have 64-bit libOSMesa installed.
    # TODO: worth fixing?
    executable("fiddle") {
      libs = []
      if (is_linux) {
        libs += [ "OSMesa" ]
      }

      sources = [
        "tools/fiddle/draw.cpp",
        "tools/fiddle/fiddle_main.cpp",
      ]
      deps = [
        ":skia",
        ":skia.h",
      ]
    }
  }

  if (skia_enable_gpu) {
    source_set("public_headers_warnings_check") {
      sources = [
        "tools/public_headers_warnings_check.cpp",
      ]
      configs -= [ "//gn:warnings_except_public_headers" ]
      deps = [
        ":skia",
        ":skia.h",
      ]
    }
  }

  template("test_lib") {
    config(target_name + "_config") {
      include_dirs = invoker.public_include_dirs
      if (defined(invoker.public_defines)) {
        defines = invoker.public_defines
      }
    }
    source_set(target_name) {
      forward_variables_from(invoker, "*", [ "public_include_dirs" ])
      public_configs = [
        ":" + target_name + "_config",
        ":skia_private",
      ]

      if (!defined(deps)) {
        deps = []
      }
      deps += [ ":skia" ]
      testonly = true
    }
  }

  template("test_app") {
    if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
      shared_library("lib" + target_name) {
        forward_variables_from(invoker, "*", [ "is_shared_library" ])
        testonly = true
      }
    } else {
      _executable = target_name
      executable(_executable) {
        forward_variables_from(invoker, "*", [ "is_shared_library" ])
        testonly = true
      }
    }
    if (is_android && skia_android_serial != "" && defined(_executable)) {
      action("push_" + target_name) {
        script = "gn/push_to_android.py"
        deps = [
          ":" + _executable,
        ]
        _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
        outputs = [
          _stamp,
        ]
        args = [
          rebase_path("$root_build_dir/$_executable"),
          skia_android_serial,
          rebase_path(_stamp),
        ]
        testonly = true
      }
    }
  }

  test_lib("gpu_tool_utils") {
    public_include_dirs = []
    if (skia_enable_gpu) {
      public_defines = []
      public_include_dirs += [ "tools/gpu" ]

      deps = []
      sources = [
        "tools/gpu/GrContextFactory.cpp",
        "tools/gpu/GrTest.cpp",
        "tools/gpu/TestContext.cpp",
        "tools/gpu/gl/GLTestContext.cpp",
        "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp",
        "tools/gpu/gl/debug/DebugGLTestContext.cpp",
        "tools/gpu/gl/debug/GrBufferObj.cpp",
        "tools/gpu/gl/debug/GrFrameBufferObj.cpp",
        "tools/gpu/gl/debug/GrProgramObj.cpp",
        "tools/gpu/gl/debug/GrShaderObj.cpp",
        "tools/gpu/gl/debug/GrTextureObj.cpp",
        "tools/gpu/gl/debug/GrTextureUnitObj.cpp",
        "tools/gpu/gl/null/NullGLTestContext.cpp",
      ]
      libs = []

      if (is_android || skia_use_egl) {
        sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
      } else if (is_ios) {
        sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
        libs += [ "OpenGLES.framework" ]
      } else if (is_linux) {
        sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
        libs += [ "X11" ]
      } else if (is_mac) {
        sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
      } else if (is_win) {
        sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
        libs += [
          "Gdi32.lib",
          "OpenGL32.lib",
        ]
      }

      if (skia_use_angle) {
        deps += [ "//third_party/angle2" ]
        sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
      }
      if (skia_use_mesa) {
        public_defines += [ "SK_MESA" ]
        sources += [ "tools/gpu/gl/mesa/GLTestContext_mesa.cpp" ]
        libs += [ "OSMesa" ]
      }
      if (skia_use_vulkan) {
        sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
      }
    }
  }

  test_lib("flags") {
    public_include_dirs = [ "tools/flags" ]
    sources = [
      "tools/flags/SkCommandLineFlags.cpp",
    ]
  }
  test_lib("common_flags") {
    public_include_dirs = [ "tools/flags" ]
    sources = [
      "tools/flags/SkCommonFlags.cpp",
      "tools/flags/SkCommonFlagsConfig.cpp",
    ]
    deps = [
      ":flags",
      ":gpu_tool_utils",
    ]
  }

  test_lib("tool_utils") {
    public_include_dirs = [
      "tools",
      "tools/debugger",
      "tools/timer",
    ]
    sources = [
      "tools/AndroidSkDebugToStdOut.cpp",
      "tools/CrashHandler.cpp",
      "tools/LsanSuppressions.cpp",
      "tools/ProcStats.cpp",
      "tools/Resources.cpp",
      "tools/ThermalManager.cpp",
      "tools/UrlDataManager.cpp",
      "tools/debugger/SkDebugCanvas.cpp",
      "tools/debugger/SkDrawCommand.cpp",
      "tools/debugger/SkJsonWriteBuffer.cpp",
      "tools/debugger/SkObjectParser.cpp",
      "tools/picture_utils.cpp",
      "tools/random_parse_path.cpp",
      "tools/sk_tool_utils.cpp",
      "tools/sk_tool_utils_font.cpp",
      "tools/timer/Timer.cpp",
    ]
    libs = []
    if (is_ios) {
      sources += [ "tools/ios_utils.m" ]
      libs += [ "Foundation.framework" ]
    }
    deps = [
      ":common_flags",
      ":flags",
      "//third_party/libpng",
    ]
    public_deps = [
      "//third_party/jsoncpp",
    ]
  }

  import("gn/gm.gni")
  test_lib("gm") {
    public_include_dirs = [ "gm" ]
    sources = gm_sources
    deps = [
      ":flags",
      ":gpu_tool_utils",
      ":skia",
      ":tool_utils",
    ]
  }

  import("gn/tests.gni")
  test_lib("tests") {
    public_include_dirs = [ "tests" ]
    sources = tests_sources + pathops_tests_sources
    if (!fontmgr_android_enabled) {
      sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
    }
    deps = [
      ":experimental_svg_model",
      ":flags",
      ":skia",
      ":tool_utils",
      "//third_party/libpng",
      "//third_party/zlib",
    ]
    public_deps = [
      ":gpu_tool_utils",  # Test.h #includes headers from this target.
    ]
  }

  import("gn/bench.gni")
  test_lib("bench") {
    public_include_dirs = [ "bench" ]
    sources = bench_sources
    deps = [
      ":flags",
      ":gm",
      ":gpu_tool_utils",
      ":skia",
      ":tool_utils",
    ]
  }

  test_lib("experimental_svg_model") {
    public_include_dirs = [ "experimental/svg/model" ]
    sources = [
      "experimental/svg/model/SkSVGAttribute.cpp",
      "experimental/svg/model/SkSVGAttributeParser.cpp",
      "experimental/svg/model/SkSVGCircle.cpp",
      "experimental/svg/model/SkSVGClipPath.cpp",
      "experimental/svg/model/SkSVGContainer.cpp",
      "experimental/svg/model/SkSVGDOM.cpp",
      "experimental/svg/model/SkSVGEllipse.cpp",
      "experimental/svg/model/SkSVGLine.cpp",
      "experimental/svg/model/SkSVGLinearGradient.cpp",
      "experimental/svg/model/SkSVGNode.cpp",
      "experimental/svg/model/SkSVGPath.cpp",
      "experimental/svg/model/SkSVGPoly.cpp",
      "experimental/svg/model/SkSVGRect.cpp",
      "experimental/svg/model/SkSVGRenderContext.cpp",
      "experimental/svg/model/SkSVGSVG.cpp",
      "experimental/svg/model/SkSVGShape.cpp",
      "experimental/svg/model/SkSVGStop.cpp",
      "experimental/svg/model/SkSVGTransformableNode.cpp",
      "experimental/svg/model/SkSVGValue.cpp",
    ]
    deps = [
      ":skia",
    ]
  }

  test_lib("views") {
    public_include_dirs = [ "include/views" ]
    sources = [
      "src/views/SkEvent.cpp",
      "src/views/SkEventSink.cpp",
      "src/views/SkOSMenu.cpp",
      "src/views/SkTagList.cpp",
      "src/views/SkTouchGesture.cpp",
      "src/views/SkView.cpp",
      "src/views/SkViewPriv.cpp",
    ]
    libs = []
    deps = []
    if (!is_android) {
      sources += [ "src/views/SkWindow.cpp" ]
    }
    if (is_linux) {
      public_include_dirs += [ "src/views/unix" ]
      sources += [
        "src/views/unix/SkOSWindow_Unix.cpp",
        "src/views/unix/keysym2ucs.c",
      ]
      libs += [
        "GL",
        "X11",
      ]
    } else if (is_mac) {
      sources += [
        "src/views/mac/SkEventNotifier.mm",
        "src/views/mac/SkNSView.mm",
        "src/views/mac/SkOSWindow_Mac.mm",
        "src/views/mac/SkTextFieldCell.m",
      ]
      libs += [
        "QuartzCore.framework",
        "Cocoa.framework",
        "Foundation.framework",
      ]
    } else if (is_win) {
      sources += [ "src/views/win/SkOSWindow_win.cpp" ]
    }
    if (skia_use_angle) {
      deps += [ "//third_party/angle2" ]
    }
  }

  if (skia_use_lua) {
    test_lib("lua") {
      public_include_dirs = []
      sources = [
        "src/utils/SkLua.cpp",
        "src/utils/SkLuaCanvas.cpp",
      ]
      deps = [
        "//third_party/lua",
      ]
    }

    test_app("lua_app") {
      sources = [
        "tools/lua/lua_app.cpp",
      ]
      deps = [
        ":lua",
        ":skia",
        "//third_party/lua",
      ]
    }

    test_app("lua_pictures") {
      sources = [
        "tools/lua/lua_pictures.cpp",
      ]
      deps = [
        ":flags",
        ":lua",
        ":skia",
        ":tool_utils",
        "//third_party/lua",
      ]
    }
  }

  import("gn/samples.gni")
  test_lib("samples") {
    public_include_dirs = [ "samplecode" ]
    include_dirs = [ "experimental" ]
    sources = samples_sources + [
                "experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp",
                "experimental/SkSetPoly3To3.cpp",
                "experimental/SkSetPoly3To3_A.cpp",
                "experimental/SkSetPoly3To3_D.cpp",
              ]
    deps = [
      ":experimental_svg_model",
      ":flags",
      ":gm",
      ":tool_utils",
      ":views",
      ":xml",
    ]

    if (skia_use_lua) {
      sources += [ "samplecode/SampleLua.cpp" ]
      deps += [
        ":lua",
        "//third_party/lua",
      ]
    }
  }

  test_app("dm") {
    sources = [
      "dm/DM.cpp",
      "dm/DMJsonWriter.cpp",
      "dm/DMSrcSink.cpp",
    ]
    include_dirs = [ "tests" ]
    deps = [
      ":common_flags",
      ":experimental_svg_model",
      ":flags",
      ":gm",
      ":gpu_tool_utils",
      ":skia",
      ":tests",
      ":tool_utils",
      "//third_party/jsoncpp",
      "//third_party/libpng",
    ]
  }

  test_app("ok") {
    sources = [
      "tools/ok.cpp",
      "tools/ok_dsts.cpp",
      "tools/ok_srcs.cpp",
      "tools/ok_test.cpp",
      "tools/ok_vias.cpp",
    ]
    deps = [
      ":gm",
      ":skia",
      ":tests",
    ]
  }

  if (!is_debug) {  # I've benchmarked debug code once too many times...
    test_app("monobench") {
      sources = [
        "tools/monobench.cpp",
      ]
      deps = [
        ":bench",
        ":skia",
      ]
    }
  }

  test_app("nanobench") {
    sources = [
      "bench/nanobench.cpp",
    ]
    deps = [
      ":bench",
      ":common_flags",
      ":experimental_svg_model",
      ":flags",
      ":gm",
      ":gpu_tool_utils",
      ":skia",
      ":tool_utils",
      "//third_party/jsoncpp",
    ]
  }

  test_app("skpinfo") {
    sources = [
      "tools/skpinfo.cpp",
    ]
    deps = [
      ":flags",
      ":skia",
    ]
  }

  if (is_linux || is_win || is_mac) {
    test_app("SampleApp") {
      sources = [
        "samplecode/SampleApp.cpp",
        "samplecode/SamplePictFile.cpp",
      ]
      if (is_mac) {
        sources += [ "src/views/mac/skia_mac.mm" ]
      } else if (is_win) {
        sources += [ "src/views/win/skia_win.cpp" ]
      } else if (is_linux) {
        sources += [ "src/views/unix/skia_unix.cpp" ]
      }
      deps = [
        ":flags",
        ":gm",
        ":gpu_tool_utils",
        ":samples",
        ":skia",
        ":tool_utils",
        ":views",
      ]
      if (skia_use_angle) {
        deps += [ "//third_party/angle2" ]
      }
    }
  }

  if (skia_enable_gpu) {
    test_app("skpbench") {
      sources = [
        "tools/skpbench/skpbench.cpp",
      ]
      deps = [
        ":flags",
        ":gpu_tool_utils",
        ":skia",
        ":tool_utils",
      ]
    }
  }

  # We can't yet build ICU on iOS or Windows.
  if (!is_ios && !is_win) {
    test_app("sktexttopdf-hb") {
      sources = [
        "tools/SkShaper_harfbuzz.cpp",
        "tools/using_skia_and_harfbuzz.cpp",
      ]
      deps = [
        ":skia",
        "//third_party/harfbuzz",
      ]
    }
  }
  test_app("sktexttopdf") {
    sources = [
      "tools/SkShaper_primitive.cpp",
      "tools/using_skia_and_harfbuzz.cpp",
    ]
    deps = [
      ":skia",
    ]
  }

  test_app("get_images_from_skps") {
    sources = [
      "tools/get_images_from_skps.cpp",
    ]
    deps = [
      ":flags",
      ":skia",
      "//third_party/jsoncpp",
    ]
  }

  test_app("colorspaceinfo") {
    sources = [
      "tools/colorspaceinfo.cpp",
    ]
    deps = [
      ":flags",
      ":skia",
      ":tool_utils",
    ]
  }

  if (!is_ios) {
    test_app("skiaserve") {
      sources = [
        "tools/skiaserve/Request.cpp",
        "tools/skiaserve/Response.cpp",
        "tools/skiaserve/skiaserve.cpp",
        "tools/skiaserve/urlhandlers/BreakHandler.cpp",
        "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
        "tools/skiaserve/urlhandlers/CmdHandler.cpp",
        "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
        "tools/skiaserve/urlhandlers/DataHandler.cpp",
        "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
        "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
        "tools/skiaserve/urlhandlers/ImgHandler.cpp",
        "tools/skiaserve/urlhandlers/InfoHandler.cpp",
        "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
        "tools/skiaserve/urlhandlers/OpsHandler.cpp",
        "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
        "tools/skiaserve/urlhandlers/PostHandler.cpp",
        "tools/skiaserve/urlhandlers/QuitHandler.cpp",
        "tools/skiaserve/urlhandlers/RootHandler.cpp",
      ]
      deps = [
        ":flags",
        ":gpu_tool_utils",
        ":skia",
        ":tool_utils",
        "//third_party/jsoncpp",
        "//third_party/libmicrohttpd",
        "//third_party/libpng",
      ]
    }
  }

  test_app("fuzz") {
    sources = [
      "fuzz/FilterFuzz.cpp",
      "fuzz/FuzzCanvas.cpp",
      "fuzz/FuzzDrawFunctions.cpp",
      "fuzz/FuzzGradients.cpp",
      "fuzz/FuzzParsePath.cpp",
      "fuzz/FuzzPathop.cpp",
      "fuzz/FuzzScaleToSides.cpp",
      "fuzz/fuzz.cpp",
    ]
    deps = [
      ":flags",
      ":gpu_tool_utils",
      ":skia",
      ":tool_utils",
    ]
  }

  test_app("pathops_unittest") {
    sources = pathops_tests_sources + [
                rebase_path("tests/skia_test.cpp"),
                rebase_path("tests/Test.cpp"),
              ]
    deps = [
      ":flags",
      ":gpu_tool_utils",
      ":skia",
      ":tool_utils",
    ]
  }

  test_app("dump_record") {
    sources = [
      "tools/DumpRecord.cpp",
      "tools/dump_record.cpp",
    ]
    deps = [
      ":flags",
      ":skia",
    ]
  }

  test_app("skdiff") {
    sources = [
      "tools/skdiff/skdiff.cpp",
      "tools/skdiff/skdiff_html.cpp",
      "tools/skdiff/skdiff_main.cpp",
      "tools/skdiff/skdiff_utils.cpp",
    ]
    deps = [
      ":skia",
      ":tool_utils",
    ]
  }

  test_app("skp_parser") {
    sources = [
      "tools/skp_parser.cpp",
    ]
    deps = [
      ":skia",
      ":tool_utils",
      "//third_party/jsoncpp",
    ]
  }

  if (skia_enable_gpu && (is_android || is_linux || is_win || is_mac)) {
    test_app("viewer") {
      is_shared_library = is_android
      sources = [
        "tools/viewer/GMSlide.cpp",
        "tools/viewer/ImageSlide.cpp",
        "tools/viewer/SKPSlide.cpp",
        "tools/viewer/SampleSlide.cpp",
        "tools/viewer/Viewer.cpp",
        "tools/viewer/sk_app/CommandSet.cpp",
        "tools/viewer/sk_app/GLWindowContext.cpp",
        "tools/viewer/sk_app/Window.cpp",
      ]
      libs = []

      if (is_android) {
        sources += [
          "tools/viewer/sk_app/android/GLWindowContext_android.cpp",
          "tools/viewer/sk_app/android/RasterWindowContext_android.cpp",
          "tools/viewer/sk_app/android/Window_android.cpp",
          "tools/viewer/sk_app/android/main_android.cpp",
          "tools/viewer/sk_app/android/surface_glue_android.cpp",
        ]
        libs += [ "android" ]
      } else if (is_linux) {
        sources += [
          "tools/viewer/sk_app/unix/GLWindowContext_unix.cpp",
          "tools/viewer/sk_app/unix/RasterWindowContext_unix.cpp",
          "tools/viewer/sk_app/unix/Window_unix.cpp",
          "tools/viewer/sk_app/unix/main_unix.cpp",
        ]
      } else if (is_win) {
        sources += [
          "tools/viewer/sk_app/win/GLWindowContext_win.cpp",
          "tools/viewer/sk_app/win/RasterWindowContext_win.cpp",
          "tools/viewer/sk_app/win/Window_win.cpp",
          "tools/viewer/sk_app/win/main_win.cpp",
        ]
      } else if (is_mac) {
        sources += [
          "tools/viewer/sk_app/mac/GLWindowContext_mac.cpp",
          "tools/viewer/sk_app/mac/RasterWindowContext_mac.cpp",
          "tools/viewer/sk_app/mac/Window_mac.cpp",
          "tools/viewer/sk_app/mac/main_mac.cpp",
        ]
      }

      if (skia_use_vulkan) {
        sources += [ "tools/viewer/sk_app/VulkanWindowContext.cpp" ]
        if (is_android) {
          sources +=
              [ "tools/viewer/sk_app/android/VulkanWindowContext_android.cpp" ]
        } else if (is_linux) {
          sources += [ "tools/viewer/sk_app/unix/VulkanWindowContext_unix.cpp" ]
          libs += [ "X11-xcb" ]
        } else if (is_win) {
          sources += [ "tools/viewer/sk_app/win/VulkanWindowContext_win.cpp" ]
        }
      }

      include_dirs = []
      deps = [
        ":flags",
        ":gm",
        ":gpu_tool_utils",
        ":samples",
        ":skia",
        ":tool_utils",
        ":views",
        "//third_party/imgui",
        "//third_party/jsoncpp",
      ]
      if (is_android) {
        deps += [ "//third_party/native_app_glue" ]
      } else if (is_mac) {
        deps += [ "//third_party/libsdl" ]
      }
    }
  }

  if (is_android && defined(ndk) && ndk != "") {
    copy("gdbserver") {
      sources = [
        "$ndk/$ndk_gdbserver",
      ]
      outputs = [
        "$root_out_dir/gdbserver",
      ]
    }
  }

  if (skia_enable_gpu) {
    test_app("skslc") {
      defines = [ "SKSL_STANDALONE" ]
      sources = [
        "src/sksl/SkSLMain.cpp",
      ]
      sources += skia_sksl_sources
      include_dirs = [ "src/sksl" ]
    }
  }
}
