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

Side by Side Diff: third_party/freetype/BUILD.gn

Issue 2880223002: Reland: Compile FreeType with HarfBuzz support (Closed)
Patch Set: Fix Android build, and update TestExpectations for linux rebaselines 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/chromecast_build.gni") 5 import("//build/config/chromecast_build.gni")
6 import("//build/config/freetype/freetype.gni")
7 import("//third_party/harfbuzz-ng/harfbuzz.gni")
6 8
7 config("freetype_config") { 9 config("freetype_config") {
8 include_dirs = [ 10 include_dirs = [
9 "include", 11 "include",
10 "src/include", 12 "src/include",
11 ] 13 ]
12 } 14 }
13 15
14 config("freetype-warnings") { 16 config("freetype-warnings") {
15 cflags = [] 17 cflags = []
16 18
17 if (is_clang) { 19 if (is_clang) {
18 # The reduction of FreeType files to a minimum triggers -Wunused-function 20 # The reduction of FreeType files to a minimum triggers -Wunused-function
19 # warnings in ftbase.c 21 # warnings in ftbase.c
20 22
21 # "-Wno-int-to-pointer-cast" tracked by 23 # "-Wno-int-to-pointer-cast" tracked by
22 # https://savannah.nongnu.org/bugs/index.php?50560, 24 # https://savannah.nongnu.org/bugs/index.php?50560,
23 # TODO(drott): Remove this once we roll past 7aeee3c50f2656b65f. 25 # TODO(drott): Remove this once we roll past 7aeee3c50f2656b65f.
24 cflags += [ 26 cflags += [
25 "-Wno-unused-function", 27 "-Wno-unused-function",
26 "-Wno-int-to-pointer-cast", 28 "-Wno-int-to-pointer-cast",
27 ] 29 ]
28 } 30 }
29 } 31 }
30 32
33 # This component is used to resolve a cyclic dependency between HarfBuzz and
34 # FreeType. HarfBuzz needs basic FreeType glyph information symbols for its
35 # hb-ft.* functions, FreeType needs HarfBuzz' OpenType parsing functionality in
36 # the autohinting code. We start by building a minimum FreeType here - enough to
37 # satisfy harfbuzz-ng-ft symbol requirements. Then we can build harfbuzz-ng-ft
38 # based on the minimal FreeType and harfbuzz-ng which does not depend on
39 # FreeType itself. Then we build FreeType depending on harfbuzz-ng-ft and
40 # harfbuzz-ng.
41 static_library("bootstrap_freetype_for_harfbuzz") {
42 visibility = [ "//third_party/harfbuzz-ng:harfbuzz-ng-ft", ":freetype" ]
43
44 defines = []
45
46 sources = [
47 "include/freetype-custom-config/ftmodule.h",
48 "include/freetype-custom-config/ftoption.h",
49 "src/src/base/ftbase.c",
50 "src/src/base/ftbitmap.c",
51 "src/src/base/ftsystem.c",
52 ]
53
54 if (is_mac && !is_component_build) {
55 defines += [ "MAC_RESTRICT_VISIBILITY" ]
56 }
57
58 defines += [
59 "FT2_BUILD_LIBRARY",
60 "DARWIN_NO_CARBON",
61
62 # Long directory name to avoid accidentally using wrong headers.
63 # GN currently does not escape '<' and '>' when generating xml based Visual
64 # Studio project files. As a result, use quotes instead of pointy brackets
65 # in these defines.
66 "FT_CONFIG_MODULES_H=\"freetype-custom-config/ftmodule.h\"",
67 "FT_CONFIG_OPTIONS_H=\"freetype-custom-config/ftoption.h\"",
68 ]
69
70 if (is_win && is_component_build) {
71 # Used for managing declspec(dllimport/export) visibility.
72 defines += [ "FT2_BUILD_DLL" ]
73 }
74
75 public_configs = [ ":freetype_config" ]
76 configs -= [ "//build/config/compiler:chromium_code" ]
77 configs += [ "//build/config/compiler:no_chromium_code" ]
78
79 configs += [ ":freetype-warnings" ]
80 }
81
31 component("freetype") { 82 component("freetype") {
32 if (is_linux) { 83 if (is_linux) {
33 output_name = "freetype" 84 output_name = "freetype"
34 output_extension = "so.6" 85 output_extension = "so.6"
35 } 86 }
36 87
37 defines = [] 88 defines = []
38 89
39 sources = [ 90 sources = [
40 "include/freetype-custom-config/ftmodule.h", 91 "include/freetype-custom-config/ftmodule.h",
41 "include/freetype-custom-config/ftoption.h", 92 "include/freetype-custom-config/ftoption.h",
42 "src/src/autofit/autofit.c", 93 "src/src/autofit/autofit.c",
43 "src/src/base/ftbase.c",
44 "src/src/base/ftbbox.c", 94 "src/src/base/ftbbox.c",
45 "src/src/base/ftbitmap.c",
46 "src/src/base/ftfntfmt.c", 95 "src/src/base/ftfntfmt.c",
47 "src/src/base/ftfstype.c", 96 "src/src/base/ftfstype.c",
48 "src/src/base/ftgasp.c", 97 "src/src/base/ftgasp.c",
49 "src/src/base/ftglyph.c", 98 "src/src/base/ftglyph.c",
50 "src/src/base/ftinit.c", 99 "src/src/base/ftinit.c",
51 "src/src/base/ftlcdfil.c", 100 "src/src/base/ftlcdfil.c",
52 "src/src/base/ftmm.c", 101 "src/src/base/ftmm.c",
53 "src/src/base/ftstroke.c", 102 "src/src/base/ftstroke.c",
54 "src/src/base/ftsystem.c",
55 "src/src/base/fttype1.c", 103 "src/src/base/fttype1.c",
56 "src/src/cff/cff.c", 104 "src/src/cff/cff.c",
57 "src/src/gzip/ftgzip.c", 105 "src/src/gzip/ftgzip.c",
58 "src/src/pshinter/pshinter.c", 106 "src/src/pshinter/pshinter.c",
59 "src/src/psnames/psnames.c", 107 "src/src/psnames/psnames.c",
60 "src/src/raster/raster.c", 108 "src/src/raster/raster.c",
61 "src/src/sfnt/sfnt.c", 109 "src/src/sfnt/sfnt.c",
62 "src/src/smooth/smooth.c", 110 "src/src/smooth/smooth.c",
63 "src/src/truetype/truetype.c", 111 "src/src/truetype/truetype.c",
64 ] 112 ]
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 public_configs = [ ":freetype_config" ] 159 public_configs = [ ":freetype_config" ]
112 configs -= [ "//build/config/compiler:chromium_code" ] 160 configs -= [ "//build/config/compiler:chromium_code" ]
113 configs += [ "//build/config/compiler:no_chromium_code" ] 161 configs += [ "//build/config/compiler:no_chromium_code" ]
114 162
115 configs += [ ":freetype-warnings" ] 163 configs += [ ":freetype-warnings" ]
116 164
117 deps = [ 165 deps = [
118 "//third_party/libpng", 166 "//third_party/libpng",
119 "//third_party/zlib", 167 "//third_party/zlib",
120 ] 168 ]
169
170 if (!use_system_freetype) {
171 deps += [
172 ":bootstrap_freetype_for_harfbuzz"
173 ]
174 }
175
176 if (!use_system_harfbuzz) {
177 deps += [
178 "//third_party/harfbuzz-ng:harfbuzz-ng-ft",
179 "//third_party/harfbuzz-ng:harfbuzz-ng-without-freetype",
180 ]
181 } else {
182 deps += [ "//third_party/harfbuzz-ng:harfbuzz-ng" ]
183 }
121 } 184 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698