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

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