blob: eaeb6c1299be1dc8fc7774c543f9d3042c45df1e [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
config("freetype_config") {
include_dirs = [
"include",
"src/include",
]
}
config("freetype-warnings") {
cflags = []
if (is_clang) {
# The reduction of FreeType files to a minimum triggers -Wunused-function
# warnings in ftbase.c
# "-Wno-int-to-pointer-cast" tracked by
# https://savannah.nongnu.org/bugs/index.php?50560,
# TODO(drott): Remove this once we roll past 7aeee3c50f2656b65f.
cflags += [
"-Wno-unused-function",
"-Wno-int-to-pointer-cast",
]
}
}
component("freetype") {
if (is_linux) {
output_name = "freetype"
output_extension = "so.6"
}
sources = [
"src/src/autofit/autofit.c",
"src/src/base/ftbase.c",
"src/src/base/ftbbox.c",
"src/src/base/ftbitmap.c",
"src/src/base/ftfntfmt.c",
"src/src/base/ftfstype.c",
"src/src/base/ftgasp.c",
"src/src/base/ftglyph.c",
"src/src/base/ftinit.c",
"src/src/base/ftlcdfil.c",
"src/src/base/ftmm.c",
"src/src/base/ftstroke.c",
"src/src/base/ftsystem.c",
"src/src/base/fttype1.c",
"src/src/cff/cff.c",
"src/src/gzip/ftgzip.c",
"src/src/pshinter/pshinter.c",
"src/src/psnames/psnames.c",
"src/src/raster/raster.c",
"src/src/sfnt/sfnt.c",
"src/src/smooth/smooth.c",
"src/src/truetype/truetype.c",
]
if (is_linux || is_chromecast) {
# Needed for content_shell on Linux and Chromecast, since fontconfig
# requires FT_Get_BDF_Property.
sources += [ "src/src/base/ftbdf.c" ]
}
if (is_linux || is_chromecast) {
# Needed on Fedora whose libfreetype builds ftsynth.c containing
# FT_GlyphSlot_Embolden, which we need to replace in content_shell if
# we are linking against our own FreeType.
sources += [ "src/src/base/ftsynth.c" ]
}
defines = [
"FT2_BUILD_LIBRARY",
"DARWIN_NO_CARBON",
# Long directory name to avoid accidentally using wrong headers.
"FT_CONFIG_MODULES_H=<freetype-custom-config/ftmodule.h>",
"FT_CONFIG_OPTIONS_H=<freetype-custom-config/ftoption.h>",
]
if (is_win && is_component_build) {
# Used for managing declspec(dllimport/export) visibility.
defines += [ "FT2_BUILD_DLL" ]
}
public_configs = [ ":freetype_config" ]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
configs += [ ":freetype-warnings" ]
deps = [
"//third_party/libpng",
"//third_party/zlib",
]
}