| # Copyright 2017 The Fuchsia Authors. All rights reserved. |
| # |
| # Redistribution and use in source and binary forms, with or without |
| # modification, are permitted provided that the following conditions are |
| # met: |
| # |
| # * Redistributions of source code must retain the above copyright |
| # notice, this list of conditions and the following disclaimer. |
| # * Redistributions in binary form must reproduce the above |
| # copyright notice, this list of conditions and the following disclaimer |
| # in the documentation and/or other materials provided with the |
| # distribution. |
| # * Neither the name of Google Inc. nor the names of its |
| # contributors may be used to endorse or promote products derived from |
| # this software without specific prior written permission. |
| # |
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| |
| declare_args() { |
| # Set to true to support woff and woff2 fonts. |
| flutter_use_freetype_woff2 = false |
| } |
| |
| config("freetype_config") { |
| include_dirs = [ |
| "include/freetype-flutter-config", |
| "include", |
| ] |
| |
| cflags = [] |
| |
| if (is_clang) { |
| cflags += [ |
| "-Wno-unused-function", |
| "-Wno-unused-variable", |
| ] |
| } |
| } |
| target(default_library_type, "freetype2") { |
| sources = [ |
| "src/autofit/autofit.c", |
| "src/base/ftbase.c", |
| "src/base/ftbbox.c", |
| "src/base/ftbdf.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/base/ftsynth.c", |
| "src/gzip/ftgzip.c", |
| "src/lzw/ftlzw.c", |
| "src/psaux/psaux.c", |
| "src/pshinter/pshinter.c", |
| "src/psnames/psnames.c", |
| "src/sfnt/sfnt.c", |
| "src/smooth/smooth.c", |
| |
| # Font Drivers. Drivers need to be enabled in ftmodule.h explicitly. |
| "src/cff/cff.c", # OpenType, (.cff, .cef) |
| "src/truetype/truetype.c", # TrueType |
| ] |
| |
| defines = [ |
| "FT2_BUILD_LIBRARY", |
| "DARWIN_NO_CARBON", |
| # Long directory name to avoid accidentally using wrong headers. |
| "FT_CONFIG_MODULES_H=<freetype-flutter-config/ftmodule.h>", |
| "FT_CONFIG_OPTIONS_H=<freetype-flutter-config/ftoption.h>", |
| ] |
| |
| public_configs = [ ":freetype_config" ] |
| |
| deps = [ |
| "//third_party/libpng", |
| "//third_party/zlib", |
| ] |
| |
| if (flutter_use_freetype_woff2) { |
| defines += [ "FT_CONFIG_OPTION_USE_BROTLI" ] |
| deps += [ "//third_party/brotli" ] |
| } |
| } |