• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2015 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5# Target for building freetype.
6{
7  'targets': [
8    {
9      'target_name': 'freetype',
10      'type': 'none',
11      'conditions': [
12        [ 'skia_freetype_static',
13          {
14            'dependencies': [
15              'freetype_static'
16            ],
17            'export_dependent_settings': [
18              'freetype_static'
19            ],
20            'conditions': [
21              [ 'skia_os == "android"',
22                {
23                  'direct_dependent_settings': {
24                    'defines': [
25                      # Android provides at least FreeType 2.4.0
26                      'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
27                      'SK_CAN_USE_DLOPEN=0',
28                    ],
29                  }
30                }
31              ]
32            ],
33          }, { # (not skia_freetype_static)
34            # dynamic linking depends on the OS:
35            'conditions': [
36              [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "chromeos"]',
37                {
38                  'direct_dependent_settings': {
39                    'include_dirs' : [
40                      '/usr/include/freetype2',
41                    ],
42                    'link_settings': {
43                      'libraries': [
44                        '-lfreetype',
45                      ],
46                    },
47                    'defines': [
48                      # Skia's FreeType port requires at least FreeType 2.3.8
49                      # for building and at runtime.
50                      'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020308',
51                      'SK_CAN_USE_DLOPEN=1',
52                    ],
53                  }
54                },
55              ],
56              [ 'skia_android_framework',
57                {
58                  'direct_dependent_settings': {
59                    'defines': [
60                      # Android provides at least FreeType 2.4.0
61                      'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
62                      'SK_CAN_USE_DLOPEN=0',
63                    ],
64                  },
65                  'include_dirs': [
66                    'external/expat/lib',
67                    'external/freetype/include',
68                  ],
69                  'libraries': [
70                    '-lft2',
71                  ],
72                }
73              ],
74            ],
75          }
76        ],
77      ],
78    },
79    {
80      'target_name': 'freetype_static',
81      'type': 'static_library',
82      'standalone_static_library': 1,
83      'dependencies': [
84        # we are dependent upon PNG for color emoji glyphs
85        'libpng.gyp:libpng',
86      ],
87      'includes': [
88        # TODO: merge this back in here?
89        'freetype.gypi',
90      ],
91      'conditions': [
92        [ 'skia_os == "android"', {
93          # These flags are used by the Android OS.  They are probably overkill
94          # for Skia, but we add them for consistency.
95          'cflags': [
96            '-W',
97            '-Wall',
98            '-fPIC',
99            '-DPIC',
100            '-DDARWIN_NO_CARBON',
101            '-DFT2_BUILD_LIBRARY',
102            '-O2',
103          ],
104        }],
105      ],
106    },
107  ],
108}
109