aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp/freetype.gyp
blob: cd71e78dabaf0763922be145a23c2c1af378626a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Target for building freetype.
{
  'targets': [
    {
      'target_name': 'freetype',
      'type': 'none',
      'conditions': [
        [ 'skia_freetype_static',
          {
            'dependencies': [
              'freetype_static'
            ],
            'export_dependent_settings': [
              'freetype_static'
            ],
            'conditions': [
              [ 'skia_os in ["android", "nacl"]',
                {
                  'direct_dependent_settings': {
                    'defines': [
                      # Both Android and NaCl provide at least FreeType 2.4.0
                      'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
                      'SK_CAN_USE_DLOPEN=0',
                    ],
                  }
                }
              ]
            ],
          }, { # (not skia_freetype_static)
            # dynamic linking depends on the OS:
            'conditions': [
              [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]',
                {
                  'direct_dependent_settings': {
                    'include_dirs' : [
                      '/usr/include/freetype2',
                    ],
                    'link_settings': {
                      'libraries': [
                        '-lfreetype',
                      ],
                    },
                    'defines': [
                      # The font host requires at least FreeType 2.3.0
                      # at runtime.
                      'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020300',
                      'SK_CAN_USE_DLOPEN=1',
                    ],
                  }
                },
              ],
              [ 'skia_android_framework',
                {
                  'direct_dependent_settings': {
                    'defines': [
                      # Android provides at least FreeType 2.4.0
                      'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
                      'SK_CAN_USE_DLOPEN=0',
                    ],
                  },
                  'include_dirs': [
                    'external/expat/lib',
                    'external/freetype/include',
                  ],
                  'libraries': [
                    '-lft2',
                  ],
                }
              ],
            ],
          }
        ],
      ],
    },
    {
      'target_name': 'freetype_static',
      'type': 'static_library',
      'standalone_static_library': 1,
      'dependencies': [
        # we are dependent upon PNG for color emoji glyphs
        'libpng.gyp:libpng',
      ],
      'includes': [
        # common freetype sources needed for both the base Skia build and the
        # libpoppler build for testing only
        'freetype.gypi',
      ],
      'include_dirs': [
        '../third_party/freetype/include_overrides',
      ],
      'direct_dependent_settings': {
        'include_dirs': [
          '../third_party/freetype/include_overrides',
        ],
      },
      'conditions': [
        [ 'skia_os == "android"', {
          # These flags are used by the Android OS.  They are probably overkill
          # for Skia, but we add them for consistency.
          'cflags': [
            '-W',
            '-Wall',
            '-fPIC',
            '-DPIC',
            '-DDARWIN_NO_CARBON',
            '-DFT2_BUILD_LIBRARY',
            '-O2',
          ],
        }],
      ],
    },
    {
      'target_name': 'freetype_poppler',
      'type': 'static_library',
      'standalone_static_library': 1,
      'includes': [
        'freetype.gypi',
      ],
      'sources': [
        # additional components used by poppler
        '../third_party/externals/freetype/src/base/ftbdf.c',
        '../third_party/externals/freetype/src/base/ftpfr.c',

        '../third_party/externals/freetype/src/bdf/bdf.c',
        '../third_party/externals/freetype/src/cid/type1cid.c',
        '../third_party/externals/freetype/src/pcf/pcf.c',
        '../third_party/externals/freetype/src/pfr/pfr.c',
        '../third_party/externals/freetype/src/psaux/psaux.c',
        '../third_party/externals/freetype/src/type1/type1.c',
        '../third_party/externals/freetype/src/type42/type42.c',
        '../third_party/externals/freetype/src/winfonts/winfnt.c',

        '../third_party/externals/freetype/src/gzip/ftgzip.c',
        '../third_party/externals/freetype/src/lzw/ftlzw.c',
      ],
    },
  ],
}