| 1 |
# This file will be copied into //third_party/externals/freetype via the new_local_repository |
| 2 |
# rule in WORKSPACE.bazel, so all files should be relative to that path. |
| 3 |
|
| 4 |
load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 5 |
|
| 6 |
# We define this here because the emscripten toolchain calls the cpu wasm, whereas the |
| 7 |
# bazelbuild/platforms call it wasm32. https://github.com/emscripten-core/emsdk/issues/919 |
| 8 |
config_setting( |
| 9 |
name = "cpu_wasm", |
| 10 |
values = { |
| 11 |
"cpu": "wasm", |
| 12 |
}, |
| 13 |
) |
| 14 |
|
| 15 |
FREETYPE_PUBLIC_DEFINES = [ |
| 16 |
"FT_CONFIG_OPTION_SVG", |
| 17 |
# FT_CONFIG_OPTION_USE_BROTLI TODO(kjlubick) |
| 18 |
"FT_CONFIG_OPTION_USE_ZLIB", |
| 19 |
#FT_CONFIG_OPTION_SYSTEM_ZLIB TODO(bungeman) |
| 20 |
"SK_FREETYPE_MINIMUM_RUNTIME_VERSION_IS_BUILD_VERSION", |
| 21 |
] + select( |
| 22 |
{ |
| 23 |
":cpu_wasm": [ |
| 24 |
# Use a trimmed down set of options to reduce code size. |
| 25 |
"FT_CONFIG_MODULES_H=<no-type1-ftmodule.h>", |
| 26 |
"FT_CONFIG_OPTIONS_H=<no-type1-ftoption.h>", |
| 27 |
], |
| 28 |
"@platforms//os:windows": [ |
| 29 |
# On Windows, the shell doesn't like the angle brackets, so we need |
| 30 |
# to escape them, and we need to escape them twice (meaning that we |
| 31 |
# also escape the escape character, '^') so that they make it |
| 32 |
# through from Bazel to the trampoline script and from the |
| 33 |
# trampoline script to Clang. |
| 34 |
"FT_CONFIG_MODULES_H=^^^<android-ftmodule.h^^^>", |
| 35 |
"FT_CONFIG_OPTIONS_H=^^^<android-ftoption.h^^^>", |
| 36 |
], |
| 37 |
"//conditions:default": [ |
| 38 |
"FT_CONFIG_MODULES_H=<android-ftmodule.h>", |
| 39 |
"FT_CONFIG_OPTIONS_H=<android-ftoption.h>", |
| 40 |
], |
| 41 |
}, |
| 42 |
) |
| 43 |
|
| 44 |
FREETYPE_LOCAL_DEFINES = ["FT2_BUILD_LIBRARY"] |
| 45 |
|
| 46 |
cc_library( |
| 47 |
name = "freetype", |
| 48 |
srcs = [ |
| 49 |
"include/freetype/internal/autohint.h", |
| 50 |
"include/freetype/internal/cffotypes.h", |
| 51 |
"include/freetype/internal/cfftypes.h", |
| 52 |
"include/freetype/internal/compiler-macros.h", |
| 53 |
"include/freetype/internal/ftcalc.h", |
| 54 |
"include/freetype/internal/ftdebug.h", |
| 55 |
"include/freetype/internal/ftdrv.h", |
| 56 |
"include/freetype/internal/ftgloadr.h", |
| 57 |
"include/freetype/internal/fthash.h", |
| 58 |
"include/freetype/internal/ftmemory.h", |
| 59 |
"include/freetype/internal/ftmmtypes.h", |
| 60 |
"include/freetype/internal/ftobjs.h", |
| 61 |
"include/freetype/internal/ftpsprop.h", |
| 62 |
"include/freetype/internal/ftrfork.h", |
| 63 |
"include/freetype/internal/ftserv.h", |
| 64 |
"include/freetype/internal/ftstream.h", |
| 65 |
"include/freetype/internal/fttrace.h", |
| 66 |
"include/freetype/internal/ftvalid.h", |
| 67 |
"include/freetype/internal/psaux.h", |
| 68 |
"include/freetype/internal/pshints.h", |
| 69 |
"include/freetype/internal/services/svbdf.h", |
| 70 |
"include/freetype/internal/services/svcfftl.h", |
| 71 |
"include/freetype/internal/services/svcid.h", |
| 72 |
"include/freetype/internal/services/svfntfmt.h", |
| 73 |
"include/freetype/internal/services/svgldict.h", |
| 74 |
"include/freetype/internal/services/svgxval.h", |
| 75 |
"include/freetype/internal/services/svkern.h", |
| 76 |
"include/freetype/internal/services/svmetric.h", |
| 77 |
"include/freetype/internal/services/svmm.h", |
| 78 |
"include/freetype/internal/services/svotval.h", |
| 79 |
"include/freetype/internal/services/svpfr.h", |
| 80 |
"include/freetype/internal/services/svpostnm.h", |
| 81 |
"include/freetype/internal/services/svprop.h", |
| 82 |
"include/freetype/internal/services/svpscmap.h", |
| 83 |
"include/freetype/internal/services/svpsinfo.h", |
| 84 |
"include/freetype/internal/services/svsfnt.h", |
| 85 |
"include/freetype/internal/services/svttcmap.h", |
| 86 |
"include/freetype/internal/services/svtteng.h", |
| 87 |
"include/freetype/internal/services/svttglyf.h", |
| 88 |
"include/freetype/internal/services/svwinfnt.h", |
| 89 |
"include/freetype/internal/sfnt.h", |
| 90 |
"include/freetype/internal/svginterface.h", |
| 91 |
"include/freetype/internal/t1types.h", |
| 92 |
"include/freetype/internal/tttypes.h", |
| 93 |
"include/freetype/internal/wofftypes.h", |
| 94 |
"include/freetype/otsvg.h", |
| 95 |
"include/freetype/t1tables.h", |
| 96 |
"include/freetype/ttnameid.h", |
| 97 |
"include/freetype/tttables.h", |
| 98 |
"include/freetype/tttags.h", |
| 99 |
"src/autofit/afadjust.h", |
| 100 |
"src/autofit/afblue.h", |
| 101 |
"src/autofit/afcjk.h", |
| 102 |
"src/autofit/afcover.h", |
| 103 |
"src/autofit/afdummy.h", |
| 104 |
"src/autofit/aferrors.h", |
| 105 |
"src/autofit/afglobal.h", |
| 106 |
"src/autofit/afhints.h", |
| 107 |
"src/autofit/afindic.h", |
| 108 |
"src/autofit/aflatin.h", |
| 109 |
"src/autofit/afloader.h", |
| 110 |
"src/autofit/afmodule.h", |
| 111 |
"src/autofit/afranges.h", |
| 112 |
"src/autofit/afscript.h", |
| 113 |
"src/autofit/afshaper.h", |
| 114 |
"src/autofit/afstyles.h", |
| 115 |
"src/autofit/aftypes.h", |
| 116 |
"src/autofit/afws-decl.h", |
| 117 |
"src/autofit/afws-iter.h", |
| 118 |
"src/autofit/autofit.c", |
| 119 |
"src/autofit/ft-hb.c", |
| 120 |
"src/autofit/ft-hb.h", |
| 121 |
"src/autofit/ft-hb-ft.c", |
| 122 |
"src/autofit/ft-hb-ft.h", |
| 123 |
"src/base/ftbase.c", |
| 124 |
"src/base/ftbase.h", |
| 125 |
"src/base/ftbbox.c", |
| 126 |
"src/base/ftbitmap.c", |
| 127 |
"src/base/ftdebug.c", |
| 128 |
"src/base/ftfstype.c", |
| 129 |
"src/base/ftgasp.c", |
| 130 |
"src/base/ftglyph.c", |
| 131 |
"src/base/ftinit.c", |
| 132 |
"src/base/ftmm.c", |
| 133 |
"src/base/ftpatent.c", |
| 134 |
"src/base/ftstroke.c", |
| 135 |
"src/base/ftsynth.c", |
| 136 |
"src/base/ftsystem.c", |
| 137 |
"src/base/fttype1.c", |
| 138 |
"src/base/ftwinfnt.c", |
| 139 |
"src/base/md5.h", |
| 140 |
"src/cff/cff.c", |
| 141 |
"src/cff/cffcmap.h", |
| 142 |
"src/cff/cffdrivr.h", |
| 143 |
"src/cff/cfferrs.h", |
| 144 |
"src/cff/cffgload.h", |
| 145 |
"src/cff/cffload.h", |
| 146 |
"src/cff/cffobjs.h", |
| 147 |
"src/cff/cffparse.h", |
| 148 |
"src/cff/cfftoken.h", |
| 149 |
"src/cid/ciderrs.h", |
| 150 |
"src/cid/cidgload.h", |
| 151 |
"src/cid/cidload.h", |
| 152 |
"src/cid/cidobjs.h", |
| 153 |
"src/cid/cidparse.h", |
| 154 |
"src/cid/cidriver.h", |
| 155 |
"src/cid/cidtoken.h", |
| 156 |
"src/cid/type1cid.c", |
| 157 |
"src/gzip/crc32.h", |
| 158 |
"src/gzip/ftgzip.c", |
| 159 |
"src/gzip/ftzconf.h", |
| 160 |
"src/gzip/inffast.h", |
| 161 |
"src/gzip/inffixed.h", |
| 162 |
"src/gzip/inflate.h", |
| 163 |
"src/gzip/inftrees.h", |
| 164 |
"src/gzip/zlib.h", |
| 165 |
"src/gzip/zutil.h", |
| 166 |
"src/psaux/afmparse.h", |
| 167 |
"src/psaux/cffdecode.h", |
| 168 |
"src/psaux/psarrst.h", |
| 169 |
"src/psaux/psaux.c", |
| 170 |
"src/psaux/psauxerr.h", |
| 171 |
"src/psaux/psauxmod.h", |
| 172 |
"src/psaux/psblues.h", |
| 173 |
"src/psaux/psconv.h", |
| 174 |
"src/psaux/pserror.h", |
| 175 |
"src/psaux/psfixed.h", |
| 176 |
"src/psaux/psfont.h", |
| 177 |
"src/psaux/psft.h", |
| 178 |
"src/psaux/psglue.h", |
| 179 |
"src/psaux/pshints.h", |
| 180 |
"src/psaux/psintrp.h", |
| 181 |
"src/psaux/psobjs.h", |
| 182 |
"src/psaux/psread.h", |
| 183 |
"src/psaux/psstack.h", |
| 184 |
"src/psaux/pstypes.h", |
| 185 |
"src/psaux/t1cmap.h", |
| 186 |
"src/psaux/t1decode.h", |
| 187 |
"src/pshinter/pshalgo.h", |
| 188 |
"src/pshinter/pshglob.h", |
| 189 |
"src/pshinter/pshinter.c", |
| 190 |
"src/pshinter/pshmod.h", |
| 191 |
"src/pshinter/pshnterr.h", |
| 192 |
"src/pshinter/pshrec.h", |
| 193 |
"src/psnames/psmodule.h", |
| 194 |
"src/psnames/psnamerr.h", |
| 195 |
"src/psnames/psnames.c", |
| 196 |
"src/psnames/pstables.h", |
| 197 |
"src/raster/ftmisc.h", |
| 198 |
"src/raster/ftraster.h", |
| 199 |
"src/raster/ftrend1.h", |
| 200 |
"src/raster/raster.c", |
| 201 |
"src/raster/rasterrs.h", |
| 202 |
"src/sfnt/pngshim.h", |
| 203 |
"src/sfnt/sfdriver.h", |
| 204 |
"src/sfnt/sferrors.h", |
| 205 |
"src/sfnt/sfnt.c", |
| 206 |
"src/sfnt/sfobjs.h", |
| 207 |
"src/sfnt/sfwoff.h", |
| 208 |
"src/sfnt/sfwoff2.h", |
| 209 |
"src/sfnt/ttbdf.h", |
| 210 |
"src/sfnt/ttcmap.h", |
| 211 |
"src/sfnt/ttcmapc.h", |
| 212 |
"src/sfnt/ttcolr.h", |
| 213 |
"src/sfnt/ttcpal.h", |
| 214 |
"src/sfnt/ttgpos.h", |
| 215 |
"src/sfnt/ttkern.h", |
| 216 |
"src/sfnt/ttload.h", |
| 217 |
"src/sfnt/ttmtx.h", |
| 218 |
"src/sfnt/ttpost.h", |
| 219 |
"src/sfnt/ttsbit.h", |
| 220 |
"src/sfnt/woff2tags.h", |
| 221 |
"src/smooth/ftgrays.h", |
| 222 |
"src/smooth/ftsmerrs.h", |
| 223 |
"src/smooth/ftsmooth.h", |
| 224 |
"src/smooth/smooth.c", |
| 225 |
"src/svg/ftsvg.h", |
| 226 |
"src/svg/svg.c", |
| 227 |
"src/svg/svgtypes.h", |
| 228 |
"src/truetype/truetype.c", |
| 229 |
"src/truetype/ttdriver.h", |
| 230 |
"src/truetype/tterrors.h", |
| 231 |
"src/truetype/ttgload.h", |
| 232 |
"src/truetype/ttgxvar.h", |
| 233 |
"src/truetype/ttinterp.h", |
| 234 |
"src/truetype/ttobjs.h", |
| 235 |
"src/truetype/ttpload.h", |
| 236 |
"src/type1/t1afm.h", |
| 237 |
"src/type1/t1driver.h", |
| 238 |
"src/type1/t1errors.h", |
| 239 |
"src/type1/t1gload.h", |
| 240 |
"src/type1/t1load.h", |
| 241 |
"src/type1/t1objs.h", |
| 242 |
"src/type1/t1parse.h", |
| 243 |
"src/type1/t1tokens.h", |
| 244 |
"src/type1/type1.c", |
| 245 |
], |
| 246 |
hdrs = [ |
| 247 |
"include/freetype/config/ftconfig.h", |
| 248 |
"include/freetype/config/ftheader.h", |
| 249 |
# Ensure custom modules and options by removing the generic ones. |
| 250 |
#"include/freetype/config/ftmodule.h", |
| 251 |
#"include/freetype/config/ftoption.h", |
| 252 |
"include/freetype/config/ftstdlib.h", |
| 253 |
"include/freetype/config/integer-types.h", |
| 254 |
"include/freetype/config/mac-support.h", |
| 255 |
"include/freetype/config/public-macros.h", |
| 256 |
"include/freetype/freetype.h", |
| 257 |
"include/freetype/ftadvanc.h", |
| 258 |
"include/freetype/ftbbox.h", |
| 259 |
"include/freetype/ftbdf.h", |
| 260 |
"include/freetype/ftbitmap.h", |
| 261 |
"include/freetype/ftbzip2.h", |
| 262 |
"include/freetype/ftcache.h", |
| 263 |
"include/freetype/ftchapters.h", |
| 264 |
"include/freetype/ftcid.h", |
| 265 |
"include/freetype/ftcolor.h", |
| 266 |
"include/freetype/ftdriver.h", |
| 267 |
"include/freetype/fterrdef.h", |
| 268 |
"include/freetype/fterrors.h", |
| 269 |
"include/freetype/ftfntfmt.h", |
| 270 |
"include/freetype/ftgasp.h", |
| 271 |
"include/freetype/ftglyph.h", |
| 272 |
"include/freetype/ftgxval.h", |
| 273 |
"include/freetype/ftgzip.h", |
| 274 |
"include/freetype/ftimage.h", |
| 275 |
"include/freetype/ftincrem.h", |
| 276 |
"include/freetype/ftlcdfil.h", |
| 277 |
"include/freetype/ftlist.h", |
| 278 |
"include/freetype/ftlogging.h", |
| 279 |
"include/freetype/ftlzw.h", |
| 280 |
"include/freetype/ftmac.h", |
| 281 |
"include/freetype/ftmm.h", |
| 282 |
"include/freetype/ftmodapi.h", |
| 283 |
"include/freetype/ftmoderr.h", |
| 284 |
"include/freetype/ftotval.h", |
| 285 |
"include/freetype/ftoutln.h", |
| 286 |
"include/freetype/ftparams.h", |
| 287 |
"include/freetype/ftpfr.h", |
| 288 |
"include/freetype/ftrender.h", |
| 289 |
"include/freetype/ftsizes.h", |
| 290 |
"include/freetype/ftsnames.h", |
| 291 |
"include/freetype/ftstroke.h", |
| 292 |
"include/freetype/ftsynth.h", |
| 293 |
"include/freetype/ftsystem.h", |
| 294 |
"include/freetype/fttrigon.h", |
| 295 |
"include/freetype/fttypes.h", |
| 296 |
"include/freetype/ftwinfnt.h", |
| 297 |
"include/freetype/otsvg.h", |
| 298 |
"include/freetype/t1tables.h", |
| 299 |
"include/freetype/ttnameid.h", |
| 300 |
"include/freetype/tttables.h", |
| 301 |
"include/freetype/tttags.h", |
| 302 |
"include/ft2build.h", |
| 303 |
# We expect this to be copied in via the repository_rule that checks out freetype |
| 304 |
"builds/android-ftmodule.h", |
| 305 |
"builds/android-ftoption.h", |
| 306 |
"builds/no-type1-ftmodule.h", |
| 307 |
"builds/no-type1-ftoption.h", |
| 308 |
], |
| 309 |
copts = [ |
| 310 |
"-Wno-unused-function", |
| 311 |
], |
| 312 |
defines = FREETYPE_PUBLIC_DEFINES, |
| 313 |
includes = [ |
| 314 |
"builds", |
| 315 |
"include", |
| 316 |
], |
| 317 |
local_defines = FREETYPE_LOCAL_DEFINES, |
| 318 |
# Freetype includes a lot of .c files. We need to make those available for inclusion explicitly. |
| 319 |
textual_hdrs = [ |
| 320 |
"src/autofit/afadjust.c", |
| 321 |
"src/autofit/afblue.c", |
| 322 |
"src/autofit/afcjk.c", |
| 323 |
"src/autofit/afdummy.c", |
| 324 |
"src/autofit/afglobal.c", |
| 325 |
"src/autofit/afgsub.c", |
| 326 |
"src/autofit/afhints.c", |
| 327 |
"src/autofit/afindic.c", |
| 328 |
"src/autofit/aflatin.c", |
| 329 |
"src/autofit/afloader.c", |
| 330 |
"src/autofit/afmodule.c", |
| 331 |
"src/autofit/afranges.c", |
| 332 |
"src/autofit/afshaper.c", |
| 333 |
"src/autofit/ft-hb.c", |
| 334 |
"src/autofit/ft-hb-ft.c", |
| 335 |
"src/base/ftadvanc.c", |
| 336 |
"src/base/ftbase.c", |
| 337 |
"src/base/ftcalc.c", |
| 338 |
"src/base/ftcolor.c", |
| 339 |
"src/base/ftdbgmem.c", |
| 340 |
"src/base/fterrors.c", |
| 341 |
"src/base/ftfntfmt.c", |
| 342 |
"src/base/ftgloadr.c", |
| 343 |
"src/base/fthash.c", |
| 344 |
"src/base/ftlcdfil.c", |
| 345 |
"src/base/ftmac.c", |
| 346 |
"src/base/ftobjs.c", |
| 347 |
"src/base/ftoutln.c", |
| 348 |
"src/base/ftpsprop.c", |
| 349 |
"src/base/ftrfork.c", |
| 350 |
"src/base/ftsnames.c", |
| 351 |
"src/base/ftstream.c", |
| 352 |
"src/base/fttrigon.c", |
| 353 |
"src/base/ftutil.c", |
| 354 |
"src/cff/cffcmap.c", |
| 355 |
"src/cff/cffdrivr.c", |
| 356 |
"src/cff/cffgload.c", |
| 357 |
"src/cff/cffload.c", |
| 358 |
"src/cff/cffobjs.c", |
| 359 |
"src/cff/cffparse.c", |
| 360 |
"src/cid/cidgload.c", |
| 361 |
"src/cid/cidload.c", |
| 362 |
"src/cid/cidobjs.c", |
| 363 |
"src/cid/cidparse.c", |
| 364 |
"src/cid/cidriver.c", |
| 365 |
"src/gzip/adler32.c", |
| 366 |
"src/gzip/crc32.c", |
| 367 |
"src/gzip/inffast.c", |
| 368 |
"src/gzip/inflate.c", |
| 369 |
"src/gzip/inftrees.c", |
| 370 |
"src/gzip/zutil.c", |
| 371 |
"src/psaux/afmparse.c", |
| 372 |
"src/psaux/cffdecode.c", |
| 373 |
"src/psaux/psarrst.c", |
| 374 |
"src/psaux/psauxmod.c", |
| 375 |
"src/psaux/psblues.c", |
| 376 |
"src/psaux/psconv.c", |
| 377 |
"src/psaux/pserror.c", |
| 378 |
"src/psaux/psfont.c", |
| 379 |
"src/psaux/psft.c", |
| 380 |
"src/psaux/pshints.c", |
| 381 |
"src/psaux/psintrp.c", |
| 382 |
"src/psaux/psobjs.c", |
| 383 |
"src/psaux/psread.c", |
| 384 |
"src/psaux/psstack.c", |
| 385 |
"src/psaux/t1cmap.c", |
| 386 |
"src/psaux/t1decode.c", |
| 387 |
"src/pshinter/pshalgo.c", |
| 388 |
"src/pshinter/pshglob.c", |
| 389 |
"src/pshinter/pshmod.c", |
| 390 |
"src/pshinter/pshrec.c", |
| 391 |
"src/psnames/psmodule.c", |
| 392 |
"src/raster/ftraster.c", |
| 393 |
"src/raster/ftrend1.c", |
| 394 |
"src/sfnt/pngshim.c", |
| 395 |
"src/sfnt/sfdriver.c", |
| 396 |
"src/sfnt/sfobjs.c", |
| 397 |
"src/sfnt/sfwoff.c", |
| 398 |
"src/sfnt/sfwoff2.c", |
| 399 |
"src/sfnt/ttbdf.c", |
| 400 |
"src/sfnt/ttcmap.c", |
| 401 |
"src/sfnt/ttcolr.c", |
| 402 |
"src/sfnt/ttcpal.c", |
| 403 |
"src/sfnt/ttgpos.c", |
| 404 |
"src/sfnt/ttkern.c", |
| 405 |
"src/sfnt/ttload.c", |
| 406 |
"src/sfnt/ttmtx.c", |
| 407 |
"src/sfnt/ttpost.c", |
| 408 |
"src/sfnt/ttsbit.c", |
| 409 |
"src/sfnt/ttsvg.c", |
| 410 |
"src/sfnt/ttsvg.h", |
| 411 |
"src/sfnt/woff2tags.c", |
| 412 |
"src/smooth/ftgrays.c", |
| 413 |
"src/smooth/ftsmooth.c", |
| 414 |
"src/svg/ftsvg.c", |
| 415 |
"src/truetype/ttdriver.c", |
| 416 |
"src/truetype/ttgload.c", |
| 417 |
"src/truetype/ttgxvar.c", |
| 418 |
"src/truetype/ttinterp.c", |
| 419 |
"src/truetype/ttobjs.c", |
| 420 |
"src/truetype/ttpload.c", |
| 421 |
"src/type1/t1afm.c", |
| 422 |
"src/type1/t1driver.c", |
| 423 |
"src/type1/t1gload.c", |
| 424 |
"src/type1/t1load.c", |
| 425 |
"src/type1/t1objs.c", |
| 426 |
"src/type1/t1parse.c", |
| 427 |
], |
| 428 |
visibility = ["//visibility:public"], |
| 429 |
deps = [ |
| 430 |
"@libpng", # TODO(kjlubick) add brotli option |
| 431 |
], |
| 432 |
) |