Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: third_party/freetype/BUILD.gn

Issue 2871133004: Build FreeType with HarfBuzz support (Closed)
Patch Set: Rebaseline expectation Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/freetype/BUILD.gn
diff --git a/third_party/freetype/BUILD.gn b/third_party/freetype/BUILD.gn
index facf28f4aade644081be69f0c3a8bc95af0bb575..d230faa856d6844dd87c8ca20fdb8f06e31db1d6 100644
--- a/third_party/freetype/BUILD.gn
+++ b/third_party/freetype/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/chromecast_build.gni")
+import("//third_party/harfbuzz-ng/harfbuzz.gni")
config("freetype_config") {
include_dirs = [
@@ -28,6 +29,58 @@ config("freetype-warnings") {
}
}
+# This component is used to resolve a cyclic dependency between HarfBuzz and
+# FreeType. HarfBuzz needs basic FreeType glyph information symbols for its
+# hb-ft.* functions, FreeType needs HarfBuzz' OpenType parsing functionality in
+# the autohinting code. We start by building a minimum FreeType here - enough to
+# satisfy harfbuzz-ng-ft symbol requirements. Then we can build harfbuzz-ng-ft
+# based on the minimal FreeType and harfbuzz-ng which does not depend on
+# FreeType itself. Then we build FreeType depending on harfbuzz-ng-ft and
+# harfbuzz-ng.
+static_library("bootstrap_freetype_for_harfbuzz") {
+ visibility = [
+ "//third_party/harfbuzz-ng:harfbuzz-ng-ft",
+ ":freetype",
+ ]
+
+ defines = []
+
+ sources = [
+ "include/freetype-custom-config/ftmodule.h",
+ "include/freetype-custom-config/ftoption.h",
+ "src/src/base/ftbase.c",
+ "src/src/base/ftbitmap.c",
+ "src/src/base/ftsystem.c",
+ ]
+
+ if (is_mac && !is_component_build) {
+ defines += [ "MAC_RESTRICT_VISIBILITY" ]
+ }
+
+ defines += [
+ "FT2_BUILD_LIBRARY",
+ "DARWIN_NO_CARBON",
+
+ # Long directory name to avoid accidentally using wrong headers.
+ # GN currently does not escape '<' and '>' when generating xml based Visual
+ # Studio project files. As a result, use quotes instead of pointy brackets
+ # in these defines.
+ "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" ]
+}
+
component("freetype") {
if (is_linux) {
output_name = "freetype"
@@ -40,9 +93,7 @@ component("freetype") {
"include/freetype-custom-config/ftmodule.h",
"include/freetype-custom-config/ftoption.h",
"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",
@@ -51,7 +102,6 @@ component("freetype") {
"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",
@@ -103,6 +153,10 @@ component("freetype") {
"FT_CONFIG_OPTIONS_H=\"freetype-custom-config/ftoption.h\"",
]
+ if (!use_system_harfbuzz) {
+ defines += [ "HAVE_HARFBUZZ_FT" ]
+ }
+
if (is_win && is_component_build) {
# Used for managing declspec(dllimport/export) visibility.
defines += [ "FT2_BUILD_DLL" ]
@@ -118,4 +172,15 @@ component("freetype") {
"//third_party/libpng",
"//third_party/zlib",
]
+
+ public_deps = [
+ ":bootstrap_freetype_for_harfbuzz",
+ ]
+
+ if (!use_system_harfbuzz) {
+ deps += [
+ "//third_party/harfbuzz-ng:harfbuzz-ng",
+ "//third_party/harfbuzz-ng:harfbuzz-ng-ft",
+ ]
+ }
}
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/freetype/include/freetype-custom-config/ftoption.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698