| # Copyright 2021 The Cobalt Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| config("freetype2_config") { |
| cflags = [] |
| if (is_clang) { |
| cflags += [ "-Wno-tautological-compare" ] |
| } |
| |
| if (is_win) { |
| cflags += [ |
| # Level 1 - Formal parameter 'number' is different from declaration. |
| "/wd4028", |
| |
| # Level 1 - Incompatible types conversion. |
| "/wd4133", |
| |
| # Level 2 - Unary minus operator applied to unsigned type; result is |
| # still unsigned. |
| "/wd4146", |
| |
| # Level 1 - Conversion from 'type1' to 'type2' of a greater size. |
| # Typically when 32-bit value is assigned to a 64-bit pointer value. |
| "/wd4312", |
| ] |
| } |
| } |
| |
| config("freetype2_config_public") { |
| include_dirs = [ |
| "include_cobalt", |
| "include", |
| ] |
| |
| defines = [ |
| "FT_CONFIG_OPTION_SYSTEM_ZLIB", |
| "FT_CONFIG_CONFIG_H=\"ftconfig.h\"", |
| "FT_CONFIG_MODULES_H=\"ftmodule.h\"", |
| "FT_CONFIG_OPTIONS_H=\"ftoption.h\"", |
| ] |
| } |
| |
| static_library("freetype2") { |
| sources = [ |
| "src/autofit/autofit.c", |
| "src/base/ftbase.c", |
| "src/base/ftbbox.c", |
| "src/base/ftbitmap.c", |
| "src/base/ftdebug.c", |
| "src/base/ftfstype.c", |
| "src/base/ftgasp.c", |
| "src/base/ftglyph.c", |
| "src/base/ftinit.c", |
| "src/base/ftmm.c", |
| "src/base/ftstroke.c", |
| "src/base/ftsystem.c", |
| "src/base/fttype1.c", |
| "src/cff/cff.c", |
| "src/gzip/ftgzip.c", |
| "src/psaux/psaux.c", |
| "src/pshinter/pshinter.c", |
| "src/psnames/psnames.c", |
| "src/raster/raster.c", |
| "src/sfnt/sfnt.c", |
| "src/smooth/smooth.c", |
| "src/truetype/truetype.c", |
| ] |
| |
| include_dirs = [ "//third_party/brotli/c/include" ] |
| |
| defines = [ "FT2_BUILD_LIBRARY" ] |
| |
| configs += [ ":freetype2_config" ] |
| |
| public_configs = [ ":freetype2_config_public" ] |
| |
| deps = [ |
| "//third_party/libpng", |
| "//third_party/zlib", |
| ] |
| } |