blob: 19003b35d604dfe24ab6f97ed4624c989f039ab4 [file] [log] [blame]
Bob Badour2af4d572021-02-12 18:00:01 -08001package {
2 default_applicable_licenses: ["external_sfntly_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20 name: "external_sfntly_license",
21 visibility: [":__subpackages__"],
22 license_kinds: [
23 "SPDX-license-identifier-Apache-2.0",
24 "SPDX-license-identifier-Zlib",
25 ],
26 license_text: [
27 "cpp/COPYING.txt",
28 ],
29}
30
Colin Crossf2f4c6f2016-12-01 18:03:32 -080031cc_library_static {
32 name: "libsfntly",
Jerome Gaillard2e0c3712018-07-10 16:08:14 +010033 host_supported: true,
Colin Crossf2f4c6f2016-12-01 18:03:32 -080034 srcs: [
Haibo Huang29d542f2019-05-03 15:19:10 -070035 "cpp/src/sfntly/*.cc",
36 "cpp/src/sfntly/data/*.cc",
37 "cpp/src/sfntly/port/*.cc",
38 "cpp/src/sfntly/table/**/*.cc",
Colin Crossf2f4c6f2016-12-01 18:03:32 -080039 "cpp/src/sample/chromium/font_subsetter.cc",
40 "cpp/src/sample/chromium/subsetter_impl.cc",
41 ],
42
Colin Crossf2f4c6f2016-12-01 18:03:32 -080043 cflags: [
44 "-fstack-protector",
45 "--param=ssp-buffer-size=4",
46 "-Werror",
47 "-fno-exceptions",
48 "-fno-strict-aliasing",
49 "-Wall",
50 "-Wno-unused-parameter",
51 "-Wno-missing-field-initializers",
52 "-fvisibility=hidden",
Colin Crossf2f4c6f2016-12-01 18:03:32 -080053 "-fno-tree-sra",
54 "-Wno-psabi",
55 "-ffunction-sections",
56 "-funwind-tables",
57 "-g",
Colin Crossf2f4c6f2016-12-01 18:03:32 -080058 "-fno-short-enums",
59 "-finline-limit=64",
60 "-Wa,--noexecstack",
61 "-U_FORTIFY_SOURCE",
62 "-Wno-extra",
63 "-Wno-ignored-qualifiers",
64 "-Wno-type-limits",
65 "-Os",
66 "-fno-ident",
67 "-fdata-sections",
68 "-ffunction-sections",
69 "-fomit-frame-pointer",
70
71 "-DANGLE_DX11",
72 "-D_FILE_OFFSET_BITS=64",
73 "-DNO_TCMALLOC",
74 "-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY",
75 "-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE",
76 "-DDISABLE_NACL",
77 "-DCHROMIUM_BUILD",
78 "-DUSE_LIBJPEG_TURBO=1",
79 "-DUSE_PROPRIETARY_CODECS",
80 "-DENABLE_CONFIGURATION_POLICY",
81 "-DENABLE_GPU=1",
82 "-DUSE_OPENSSL=1",
83 "-DENABLE_EGLIMAGE=1",
84 "-DSFNTLY_NO_EXCEPTION",
85 "-DU_USING_ICU_NAMESPACE=0",
86 "-D__STDC_CONSTANT_MACROS",
87 "-D__STDC_FORMAT_MACROS",
88 "-DANDROID",
89 "-D__GNU_SOURCE=1",
90 "-D_STLP_USE_PTR_SPECIALIZATIONS=1",
91 "-DCHROME_BUILD_ID='\"\"'",
92 "-DNDEBUG",
93 "-DNVALGRIND",
94 "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
95 "-D_FORTIFY_SOURCE=2",
96 ],
97
98 cppflags: [
99 "-fno-threadsafe-statics",
100 "-fvisibility-inlines-hidden",
101 "-Wsign-compare",
102 "-Wno-abi",
103 "-Wno-error=c++0x-compat",
104 "-Wno-non-virtual-dtor",
105 "-Wno-sign-promo",
Colin Crossf2f4c6f2016-12-01 18:03:32 -0800106 ],
107
108 debug: {
109 cflags: [
110 "-UNDEBUG",
111 "-UNVALGRIND",
112 "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
113 "-DWTF_USE_DYNAMIC_ANNOTATIONS=1",
114 "-D_DEBUG",
115 ],
116 },
117
118 export_include_dirs: ["cpp/src"],
Jerome Gaillard8b958722019-01-11 17:16:34 +0000119
120 target: {
121 android: {
122 cflags: ["-fPIC"],
Neil Fuller875956a2019-05-07 20:36:44 +0100123 shared_libs: ["libandroidicu"],
124 },
125 host: {
126 shared_libs: [
127 "libicui18n",
128 "libicuuc"
129 ],
Jerome Gaillard8b958722019-01-11 17:16:34 +0000130 },
131 not_windows: {
132 cflags: ["-fPIC"],
133 },
134 windows: {
135 enabled: true,
Jerome Gaillard8f574592019-01-17 15:34:59 +0000136 // "-fstack-protector" is not used by default on Windows, and enabling it
137 // on one library only prevents this library from being linked successfully
138 // when used as a dependency. So we disable it for Windows.
139 cflags: ["-fno-stack-protector"],
Jerome Gaillard8b958722019-01-11 17:16:34 +0000140 },
141 },
Colin Crossf2f4c6f2016-12-01 18:03:32 -0800142}