• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1cc_library_static {
2    name: "libsfntly",
3    host_supported: true,
4    srcs: [
5        "cpp/src/sfntly/data/byte_array.cc",
6        "cpp/src/sfntly/data/font_data.cc",
7        "cpp/src/sfntly/data/font_input_stream.cc",
8        "cpp/src/sfntly/data/font_output_stream.cc",
9        "cpp/src/sfntly/data/growable_memory_byte_array.cc",
10        "cpp/src/sfntly/data/memory_byte_array.cc",
11        "cpp/src/sfntly/data/readable_font_data.cc",
12        "cpp/src/sfntly/data/writable_font_data.cc",
13        "cpp/src/sfntly/font.cc",
14        "cpp/src/sfntly/font_factory.cc",
15        "cpp/src/sfntly/port/file_input_stream.cc",
16        "cpp/src/sfntly/port/lock.cc",
17        "cpp/src/sfntly/port/memory_input_stream.cc",
18        "cpp/src/sfntly/port/memory_output_stream.cc",
19        "cpp/src/sfntly/table/bitmap/big_glyph_metrics.cc",
20        "cpp/src/sfntly/table/bitmap/bitmap_glyph.cc",
21        "cpp/src/sfntly/table/bitmap/bitmap_glyph_info.cc",
22        "cpp/src/sfntly/table/bitmap/bitmap_size_table.cc",
23        "cpp/src/sfntly/table/bitmap/composite_bitmap_glyph.cc",
24        "cpp/src/sfntly/table/bitmap/ebdt_table.cc",
25        "cpp/src/sfntly/table/bitmap/eblc_table.cc",
26        "cpp/src/sfntly/table/bitmap/ebsc_table.cc",
27        "cpp/src/sfntly/table/bitmap/glyph_metrics.cc",
28        "cpp/src/sfntly/table/bitmap/index_sub_table.cc",
29        "cpp/src/sfntly/table/bitmap/index_sub_table_format1.cc",
30        "cpp/src/sfntly/table/bitmap/index_sub_table_format2.cc",
31        "cpp/src/sfntly/table/bitmap/index_sub_table_format3.cc",
32        "cpp/src/sfntly/table/bitmap/index_sub_table_format4.cc",
33        "cpp/src/sfntly/table/bitmap/index_sub_table_format5.cc",
34        "cpp/src/sfntly/table/bitmap/simple_bitmap_glyph.cc",
35        "cpp/src/sfntly/table/bitmap/small_glyph_metrics.cc",
36        "cpp/src/sfntly/table/byte_array_table_builder.cc",
37        "cpp/src/sfntly/table/core/cmap_table.cc",
38        "cpp/src/sfntly/table/core/font_header_table.cc",
39        "cpp/src/sfntly/table/core/horizontal_device_metrics_table.cc",
40        "cpp/src/sfntly/table/core/horizontal_header_table.cc",
41        "cpp/src/sfntly/table/core/horizontal_metrics_table.cc",
42        "cpp/src/sfntly/table/core/maximum_profile_table.cc",
43        "cpp/src/sfntly/table/core/name_table.cc",
44        "cpp/src/sfntly/table/core/os2_table.cc",
45        "cpp/src/sfntly/table/font_data_table.cc",
46        "cpp/src/sfntly/table/generic_table_builder.cc",
47        "cpp/src/sfntly/table/header.cc",
48        "cpp/src/sfntly/table/subtable.cc",
49        "cpp/src/sfntly/table/table.cc",
50        "cpp/src/sfntly/table/table_based_table_builder.cc",
51        "cpp/src/sfntly/table/truetype/glyph_table.cc",
52        "cpp/src/sfntly/table/truetype/loca_table.cc",
53        "cpp/src/sfntly/tag.cc",
54        "cpp/src/sample/chromium/font_subsetter.cc",
55        "cpp/src/sample/chromium/subsetter_impl.cc",
56    ],
57
58    shared_libs: [
59        "libandroidicu",
60    ],
61
62    cflags: [
63        "-fstack-protector",
64        "--param=ssp-buffer-size=4",
65        "-Werror",
66        "-fno-exceptions",
67        "-fno-strict-aliasing",
68        "-Wall",
69        "-Wno-unused-parameter",
70        "-Wno-missing-field-initializers",
71        "-fvisibility=hidden",
72        "-fno-tree-sra",
73        "-Wno-psabi",
74        "-ffunction-sections",
75        "-funwind-tables",
76        "-g",
77        "-fno-short-enums",
78        "-finline-limit=64",
79        "-Wa,--noexecstack",
80        "-U_FORTIFY_SOURCE",
81        "-Wno-extra",
82        "-Wno-ignored-qualifiers",
83        "-Wno-type-limits",
84        "-Os",
85        "-fno-ident",
86        "-fdata-sections",
87        "-ffunction-sections",
88        "-fomit-frame-pointer",
89
90        "-DANGLE_DX11",
91        "-D_FILE_OFFSET_BITS=64",
92        "-DNO_TCMALLOC",
93        "-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY",
94        "-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE",
95        "-DDISABLE_NACL",
96        "-DCHROMIUM_BUILD",
97        "-DUSE_LIBJPEG_TURBO=1",
98        "-DUSE_PROPRIETARY_CODECS",
99        "-DENABLE_CONFIGURATION_POLICY",
100        "-DENABLE_GPU=1",
101        "-DUSE_OPENSSL=1",
102        "-DENABLE_EGLIMAGE=1",
103        "-DSFNTLY_NO_EXCEPTION",
104        "-DU_USING_ICU_NAMESPACE=0",
105        "-D__STDC_CONSTANT_MACROS",
106        "-D__STDC_FORMAT_MACROS",
107        "-DANDROID",
108        "-D__GNU_SOURCE=1",
109        "-D_STLP_USE_PTR_SPECIALIZATIONS=1",
110        "-DCHROME_BUILD_ID='\"\"'",
111        "-DNDEBUG",
112        "-DNVALGRIND",
113        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
114        "-D_FORTIFY_SOURCE=2",
115    ],
116
117    cppflags: [
118        "-fno-threadsafe-statics",
119        "-fvisibility-inlines-hidden",
120        "-Wsign-compare",
121        "-Wno-abi",
122        "-Wno-error=c++0x-compat",
123        "-Wno-non-virtual-dtor",
124        "-Wno-sign-promo",
125    ],
126
127    debug: {
128        cflags: [
129            "-UNDEBUG",
130            "-UNVALGRIND",
131            "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
132            "-DWTF_USE_DYNAMIC_ANNOTATIONS=1",
133            "-D_DEBUG",
134        ],
135    },
136
137    export_include_dirs: ["cpp/src"],
138
139    target: {
140        android: {
141            cflags: ["-fPIC"],
142        },
143        not_windows: {
144            cflags: ["-fPIC"],
145        },
146        windows: {
147            enabled: true,
148            // "-fstack-protector" is not used by default on Windows, and enabling it
149            // on one library only prevents this library from being linked successfully
150            // when used as a dependency. So we disable it for Windows.
151            cflags: ["-fno-stack-protector"],
152        },
153    },
154}
155