# 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/shared_sources.gni")

declare_args() {
  skia_enable_tools = !is_fuchsia && !is_component_build

  skia_use_expat = true
  skia_use_fontconfig = is_linux
  skia_use_freetype = is_android || is_fuchsia || is_linux
  skia_use_giflib = !is_fuchsia
  skia_use_libjpeg_turbo = true
  skia_use_libpng = true
  skia_use_libwebp = !is_fuchsia
  skia_use_sfntly = !is_fuchsia
  skia_use_vulkan = false
  skia_use_zlib = true
}

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/images",
  "include/pathops",
  "include/ports",
  "include/svg",
  "include/utils",
  "include/utils/mac",
  "include/xml",
]

# Skia public API, generally provided by :skia.
config("skia_public") {
  include_dirs = skia_public_includes
  defines = [ "SKIA_DLL" ]
  if (is_linux) {
    defines += [ "SK_SAMPLES_FOR_X" ]
  }
}

# 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/config",
    "src/core",
    "src/effects",
    "src/effects/gradients",
    "src/fonts",
    "src/gpu",
    "src/image",
    "src/images",
    "src/lazy",
    "src/opts",
    "src/pathops",
    "src/pdf",
    "src/ports",
    "src/sfnt",
    "src/sksl",
    "src/utils",
    "src/utils/win",
    "third_party/etc1",
    "third_party/ktx",
  ]

  defines = [ "SK_GAMMA_APPLY_TO_A8" ]
  if (is_android) {
    defines += [
      "SK_GAMMA_EXPONENT=1.4",
      "SK_GAMMA_CONTRAST=0.0",
    ]
  }
}

# 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
  cflags = [ "-msse2" ]
}

opts("ssse3") {
  enabled = is_x86
  sources = skia_opts.ssse3_sources
  cflags = [ "-mssse3" ]
}

opts("sse41") {
  enabled = is_x86
  sources = skia_opts.sse41_sources
  cflags = [ "-msse4.1" ]
}

opts("sse42") {
  enabled = is_x86
  sources = skia_opts.sse42_sources
  cflags = [ "-msse4.2" ]
}

opts("avx") {
  enabled = is_x86
  sources = skia_opts.avx_sources
  cflags = [ "-mavx" ]
}

opts("dsp") {
  enabled = current_cpu == "mipsel"
  sources = skia_opts.mips_dsp_sources
  cflags = []
}

# 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",
                             ])
      all_dependent_configs = [ ":" + target_name + "_public" ]
      configs += skia_library_configs
    }
  } else {
    source_set(target_name) {
      forward_variables_from(invoker,
                             "*",
                             [
                               "public_defines",
                               "deps",
                               "libs",
                               "sources",
                               "sources_when_disabled",
                             ])
      if (defined(invoker.sources_when_disabled)) {
        sources = invoker.sources_when_disabled
      }
      configs += skia_library_configs
    }
  }
}

optional("fontmgr_android") {
  enabled = fontmgr_android_enabled

  deps = [
    "//third_party/expat",
    "//third_party/freetype2",
  ]
  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 = [
    "//third_party/freetype2",
  ]
  sources = [
    "src/ports/SkFontMgr_custom.cpp",
    "src/ports/SkFontMgr_custom_directory_factory.cpp",
  ]
}

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

  deps = [
    "//third_party:fontconfig",
    "//third_party/freetype2",
  ]
  sources = [
    "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 = [
    "//third_party/freetype2",
  ]
  sources = [
    "src/ports/SkFontMgr_custom.cpp",
    "src/ports/SkFontMgr_custom_empty_factory.cpp",
  ]
}

optional("gif") {
  enabled = skia_use_giflib
  public_defines = [ "SK_HAS_GIF_LIBRARY" ]

  deps = [
    "//third_party/giflib",
  ]
  sources = [
    "src/codec/SkGifCodec.cpp",
  ]
}

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

  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("typeface_freetype") {
  enabled = skia_use_freetype

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

optional("vulkan") {
  enabled = skia_use_vulkan
  public_defines = [ "SK_VULKAN" ]
  libs = [ "vulkan" ]
  sources = skia_vk_sources
}

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

  deps = [
    "//third_party/expat",
  ]
  sources = [
    "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",
    ":dsp",
    ":fontmgr_android",
    ":fontmgr_custom",
    ":fontmgr_fontconfig",
    ":fontmgr_fuchsia",
    ":gif",
    ":jpeg",
    ":none",
    ":pdf",
    ":png",
    ":sse2",
    ":sse41",
    ":sse42",
    ":ssse3",
    ":typeface_freetype",
    ":vulkan",
    ":webp",
    ":xml",
  ]

  sources = []
  sources += skia_core_sources
  sources += skia_effects_sources
  sources += skia_gpu_sources
  sources += skia_sksl_sources
  sources += skia_utils_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/SkMaskSwizzler.cpp",
    "src/codec/SkMasks.cpp",
    "src/codec/SkSampledCodec.cpp",
    "src/codec/SkSampler.cpp",
    "src/codec/SkSwizzler.cpp",
    "src/codec/SkWbmpCodec.cpp",
    "src/gpu/gl/GrGLDefaultInterface_native.cpp",
    "src/images/SkImageEncoder.cpp",
    "src/images/SkImageEncoder_Factory.cpp",
    "src/images/SkKTXImageEncoder.cpp",
    "src/ports/SkDiscardableMemory_none.cpp",
    "src/ports/SkGlobalInitialization_default.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/svg/SkSVGCanvas.cpp",
    "src/svg/SkSVGDevice.cpp",
    "src/utils/mac/SkStream_mac.cpp",
    "third_party/etc1/etc1.cpp",
    "third_party/ktx/ktx.cpp",
  ]

  # These paths need to be absolute to match the ones produced by
  # shared_sources.gni, but this file may be used from different directory
  # locations.
  sources -= get_path_info([
                             "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
                             "src/gpu/gl/GrGLDefaultInterface_none.cpp",
                           ],
                           "abspath")

  libs = []

  if (is_win) {
    sources += [
      "src/ports/SkDebug_win.cpp",
      "src/ports/SkFontHost_win.cpp",
      "src/ports/SkFontMgr_win_dw.cpp",
      "src/ports/SkFontMgr_win_dw_factory.cpp",
      "src/ports/SkImageEncoder_WIC.cpp",
      "src/ports/SkImageGeneratorWIC.cpp",
      "src/ports/SkOSFile_win.cpp",
      "src/ports/SkScalerContext_win_dw.cpp",
      "src/ports/SkTLS_win.cpp",
      "src/ports/SkTypeface_win_dw.cpp",
      "src/xps/SkDocument_XPS.cpp",
    ]
    sources -= [ "src/utils/SkThreadUtils_pthread.cpp" ]
  } else {
    sources += [
      "src/ports/SkOSFile_posix.cpp",
      "src/ports/SkTLS_pthread.cpp",
      "src/xps/SkDocument_XPS_None.cpp",
    ]
  }

  if (is_android) {
    deps += [
      "//third_party/cpu-features",
      "//third_party/expat",
    ]
    sources += [
      "src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp",
      "src/ports/SkDebug_android.cpp",
    ]
    libs += [
      "EGL",
      "GLESv2",
      "log",
    ]
  }

  if (is_linux) {
    libs += [
      "GL",
      "GLU",
      "X11",
    ]
    sources += [
      "src/gpu/gl/glx/GrGLCreateNativeInterface_glx.cpp",
      "src/ports/SkDebug_stdio.cpp",
    ]
  }

  if (is_mac) {
    sources += [
      "src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp",
      "src/ports/SkDebug_stdio.cpp",
      "src/ports/SkFontHost_mac.cpp",
      "src/ports/SkImageEncoder_CG.cpp",
      "src/ports/SkImageGeneratorCG.cpp",
    ]
    libs += [
      "ApplicationServices.framework",
      "OpenGL.framework",
    ]
  }

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

skia_h_headers = exec_script("gyp/find.py",
                             [ "*.h" ] + rebase_path(skia_public_includes),
                             "list lines",
                             []) -
                 [
                   rebase_path("include/gpu/gl/GrGLConfig_chrome.h"),
                   rebase_path("include/gpu/vk/GrVkBackendContext.h"),
                   rebase_path("include/gpu/vk/GrVkDefines.h"),
                   rebase_path("include/gpu/vk/GrVkInterface.h"),
                   rebase_path("include/gpu/vk/GrVkTypes.h"),
                   rebase_path("include/ports/SkFontMgr_fontconfig.h"),
                 ]

action("skia.h") {
  script = "gn/echo_headers.py"
  args = [ rebase_path("$target_gen_dir/skia.h", root_build_dir) ] +
         rebase_path(skia_h_headers, target_gen_dir)
  outputs = [
    "$target_gen_dir/skia.h",
  ]
}

executable("fiddle") {
  include_dirs = [ "$target_gen_dir" ]
  libs = []
  if (is_linux) {
    libs += [ "OSMesa" ]
  }

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

# Targets guarded by skia_enable_tools may use //third_party freely.
if (skia_enable_tools) {
  template("test_lib") {
    config(target_name + "_config") {
      include_dirs = invoker.public_include_dirs
    }
    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
    }
  }

  test_lib("gpu_tool_utils") {
    public_include_dirs = [ "tools/gpu" ]
    sources = [
      "tools/gpu/GrContextFactory.cpp",
      "tools/gpu/GrTest.cpp",
      "tools/gpu/TestContext.cpp",
      "tools/gpu/gl/GLTestContext.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) {
      sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
    } else if (is_linux) {
      sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
    } else if (is_mac) {
      sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
    }

    if (skia_use_vulkan) {
      sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
    }
  }

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

  test_lib("tool_utils") {
    public_include_dirs = [
      "tools",
      "tools/debugger",
      "tools/timer",
    ]
    sources = [
      "src/images/SkForceLinking.cpp",
      "src/utils/SkMultiPictureDocumentReader.cpp",  # TODO(halcanary): move to tools?
      "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/debugger/SkOverdrawMode.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",
    ]
    deps = [
      ":flags",
      "//third_party/libpng",
    ]
    public_deps = [
      "//third_party/jsoncpp",
    ]
  }

  gm_sources = exec_script("gyp/find.py",
                           [
                             "*.c*",
                             rebase_path("gm"),
                           ],
                           "list lines",
                           [])
  test_lib("gm") {
    public_include_dirs = [ "gm" ]
    sources = gm_sources
    deps = [
      ":gpu_tool_utils",
      ":skia",
      ":tool_utils",
    ]
  }

  tests_sources = exec_script("gyp/find.py",
                              [
                                "*.c*",
                                rebase_path("tests"),
                              ],
                              "list lines",
                              [])

  test_lib("tests") {
    public_include_dirs = [ "tests" ]
    sources = tests_sources - [
                rebase_path("tests/PathOpsSkpClipTest.cpp"),  # alternate main
                rebase_path("tests/SkpSkGrTest.cpp"),  # doesn't compile
                rebase_path("tests/skia_test.cpp"),  # alternate main
              ]
    if (!fontmgr_android_enabled) {
      sources -= [ rebase_path("tests/FontMgrAndroidParserTest.cpp") ]
    }
    deps = [
      ":experimental_svg_model",
      ":flags",
      ":gpu_tool_utils",
      ":skia",
      ":tool_utils",
      "//third_party/libpng",
      "//third_party/zlib",
    ]
  }

  bench_sources = exec_script("gyp/find.py",
                              [
                                "*.c*",
                                rebase_path("bench"),
                              ],
                              "list lines",
                              [])

  test_lib("bench") {
    public_include_dirs = [ "bench" ]
    sources = bench_sources
    sources -= [
      rebase_path("bench/nanobench.cpp"),
      rebase_path("bench/nanobenchAndroid.cpp"),
    ]
    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/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",
    ]
  }

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

  executable("monobench") {
    sources = [
      "tools/monobench.cpp",
    ]
    deps = [
      ":bench",
      ":skia",
    ]
    testonly = true
  }

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

  if (current_cpu != "mipsel") {  # Clang 3.8 crashes while compiling hb-icu.cc for mipsel.
    executable("sktexttopdf-hb") {
      sources = [
        "tools/SkShaper_harfbuzz.cpp",
        "tools/using_skia_and_harfbuzz.cpp",
      ]
      deps = [
        ":skia",
        "//third_party/harfbuzz",
      ]
      testonly = true
    }
  }
  executable("sktexttopdf") {
    sources = [
      "tools/SkShaper_primitive.cpp",
      "tools/using_skia_and_harfbuzz.cpp",
    ]
    deps = [
      ":skia",
    ]
    testonly = true
  }
}
