| # Copyright 2021 The Cobalt Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//cobalt/renderer/rasterizer/skia/skia/skia_sources.gni") |
| import("//cobalt/renderer/rasterizer/skia/skia/skia_template.gni") |
| |
| # skia_opts_none and skia_opts targets contain the platform-specific optimizations for Skia |
| config("skia_opts_none") { |
| include_dirs = [ |
| "//third_party/skia/include/core", |
| "//third_party/skia/include/effects", |
| "//third_party/skia/src/core", |
| "//third_party/skia/src/utils", |
| ] |
| } |
| |
| config("skia_opts") { |
| include_dirs = [ |
| "//third_party/skia/include/core", |
| "//third_party/skia/include/effects", |
| "//third_party/skia/src/core", |
| "//third_party/skia/src/opts", |
| "//third_party/skia/src/utils", |
| ] |
| } |
| |
| # Skia's core code from the Skia repository that should be compiled |
| # without ASAN. This is done to avoid drastic slowdown in debug unit |
| # tests. |
| skia_common("skia_library_no_asan") { |
| sources = skia_effects_imagefilter_sources_no_asan |
| # TODO(b/207398024): If this is a target we need to build, then we'll |
| # need to rework the configuration framework to be able to remove this |
| # flag -fsanitize=address, as it's mostly added in the |
| # platform_configuration config. |
| } |
| |
| # Skia's core code from the Skia repository. |
| config("skia_library_config") { |
| if (is_linux) { |
| cflags = [ "-Wno-deprecated-declarations" ] |
| } |
| } |
| |
| config("skia_library_config_public") { |
| include_dirs = [ |
| #temporary until we can hide SkFontHost |
| "//third_party/skia", |
| "//third_party/skia/src/core", |
| "//third_party/skia/src/utils", |
| "//third_party/skia/include/core", |
| "//third_party/skia/include/effects", |
| "//third_party/skia/include/gpu", |
| "//third_party/skia/include/lazy", |
| "//third_party/skia/include/pathops", |
| "//third_party/skia/include/pipe", |
| "//third_party/skia/include/ports", |
| "//third_party/skia/include/private", |
| "//third_party/skia/include/utils", |
| ] |
| } |
| |
| skia_common("skia_library") { |
| sources = shared_sources + sksl_sources |
| |
| configs = [ |
| ":skia_library_config", |
| ":skia_opts", |
| ] |
| |
| public_configs = [ ":skia_library_config_public" ] |
| |
| deps = [ |
| ":skia_library_no_asan", |
| "//base", |
| "//starboard/common", |
| "//third_party/freetype2", |
| "//third_party/libpng", |
| "//third_party/skia/third_party/skcms", |
| "//third_party/zlib", |
| ] |
| } |
| |
| # This is the target that all Cobalt modules should depend on if they |
| # wish to use Skia. It augments skia_library (Skia's core code) with |
| # Cobalt specific code such as platform-specific implementations of certain functions. |
| skia_common("skia") { |
| sources = [ |
| "config/SkUserConfig.h", |
| "src/google_logging.cc", |
| "src/gpu/gl/GrGLMakeNativeInterface_cobalt.cc", |
| "src/ports/SkFontConfigParser_cobalt.cc", |
| "src/ports/SkFontConfigParser_cobalt.h", |
| "src/ports/SkFontMgr_cobalt.cc", |
| "src/ports/SkFontMgr_cobalt.h", |
| "src/ports/SkFontMgr_cobalt_factory.cc", |
| "src/ports/SkFontStyleSet_cobalt.cc", |
| "src/ports/SkFontStyleSet_cobalt.h", |
| "src/ports/SkFontUtil_cobalt.cc", |
| "src/ports/SkFontUtil_cobalt.h", |
| "src/ports/SkFreeType_cobalt.cc", |
| "src/ports/SkFreeType_cobalt.h", |
| "src/ports/SkOSFile_cobalt.cc", |
| "src/ports/SkOSFile_cobalt.h", |
| "src/ports/SkStream_cobalt.cc", |
| "src/ports/SkStream_cobalt.h", |
| "src/ports/SkTLS_cobalt.cc", |
| "src/ports/SkTime_cobalt.cc", |
| "src/ports/SkTypeface_cobalt.cc", |
| "src/ports/SkTypeface_cobalt.h", |
| ] |
| |
| if (is_starboard) { |
| sources += [ "src/ports/SkMemory_starboard.cc" ] |
| } |
| |
| include_dirs = [ target_gen_dir ] |
| |
| deps = [ |
| "//base", |
| "//cobalt/base", |
| "//cobalt/configuration:configuration", |
| "//starboard:starboard_headers_only", |
| "//starboard/common", |
| "//third_party/freetype2", |
| "//third_party/libxml", |
| ] |
| |
| public_deps = [ ":skia_library" ] |
| } |