Debian Codegraph @

subprojects/packagefiles/freetype-2.6.1-meson/meson.build

raw
1 project('freetype2', 'c',
2 version: '2.6.1',
3 license: '(FTL OR GPL-2.0-or-later) AND BSD-3-Clause AND MIT AND MIT-Modern-Variant AND Zlib',
4 license_files: [
5 'docs/LICENSE.TXT',
6 'docs/FTL.TXT',
7 'docs/GPLv2.TXT',
8 ],
9 meson_version: '>=1.1.0')
10
11 # NOTE about FreeType versions
12 # There are 3 versions numbers associated with each releases:
13 # - official release number (eg. 2.6.1) - accessible via
14 # FREETYPE_{MAJOR,MINOR,PATCH} macros from FT_FREETYPE_H
15 # - libtool-specific version number, this is what is returned by
16 # freetype-config --version / pkg-config --modversion (eg. 22.1.16)
17 # - the platform-specific shared object version number (eg. 6.16.1)
18 # See https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/VERSIONS.TXT
19 # for more information
20 release_version = meson.project_version()
21 libtool_version = '18.1.12'
22 so_version = '6.12.1'
23 so_soversion = '6'
24
25 pkgmod = import('pkgconfig')
26
27 cc = meson.get_compiler('c')
28
29 base_sources = [
30 'src/autofit/autofit.c',
31 'src/base/ftbase.c',
32 'src/base/ftbbox.c',
33 'src/base/ftbdf.c',
34 'src/base/ftbitmap.c',
35 'src/base/ftcid.c',
36 'src/base/ftfntfmt.c',
37 'src/base/ftfstype.c',
38 'src/base/ftgasp.c',
39 'src/base/ftglyph.c',
40 'src/base/ftgxval.c',
41 'src/base/ftinit.c',
42 'src/base/ftlcdfil.c',
43 'src/base/ftmm.c',
44 'src/base/ftotval.c',
45 'src/base/ftpatent.c',
46 'src/base/ftpfr.c',
47 'src/base/ftstroke.c',
48 'src/base/ftsynth.c',
49 'src/base/ftsystem.c',
50 'src/base/fttype1.c',
51 'src/base/ftwinfnt.c',
52 'src/bdf/bdf.c',
53 'src/bzip2/ftbzip2.c',
54 'src/cache/ftcache.c',
55 'src/cff/cff.c',
56 'src/cid/type1cid.c',
57 'src/gzip/ftgzip.c',
58 'src/lzw/ftlzw.c',
59 'src/pcf/pcf.c',
60 'src/pfr/pfr.c',
61 'src/psaux/psaux.c',
62 'src/pshinter/pshinter.c',
63 'src/psnames/psnames.c',
64 'src/raster/raster.c',
65 'src/sfnt/sfnt.c',
66 'src/smooth/smooth.c',
67 'src/truetype/truetype.c',
68 'src/type1/type1.c',
69 'src/type42/type42.c',
70 'src/winfonts/winfnt.c',
71 ]
72
73 ft2build_h = [
74 'include/ft2build.h',
75 ]
76
77 ft_headers = [
78 'include/freetype/freetype.h',
79 'include/freetype/ftadvanc.h',
80 'include/freetype/ftautoh.h',
81 'include/freetype/ftbbox.h',
82 'include/freetype/ftbdf.h',
83 'include/freetype/ftbitmap.h',
84 'include/freetype/ftbzip2.h',
85 'include/freetype/ftcache.h',
86 'include/freetype/ftcffdrv.h',
87 'include/freetype/ftchapters.h',
88 'include/freetype/ftcid.h',
89 'include/freetype/fterrdef.h',
90 'include/freetype/fterrors.h',
91 'include/freetype/ftfntfmt.h',
92 'include/freetype/ftgasp.h',
93 'include/freetype/ftglyph.h',
94 'include/freetype/ftgxval.h',
95 'include/freetype/ftgzip.h',
96 'include/freetype/ftimage.h',
97 'include/freetype/ftincrem.h',
98 'include/freetype/ftlcdfil.h',
99 'include/freetype/ftlist.h',
100 'include/freetype/ftlzw.h',
101 'include/freetype/ftmac.h',
102 'include/freetype/ftmm.h',
103 'include/freetype/ftmodapi.h',
104 'include/freetype/ftmoderr.h',
105 'include/freetype/ftotval.h',
106 'include/freetype/ftoutln.h',
107 'include/freetype/ftpfr.h',
108 'include/freetype/ftrender.h',
109 'include/freetype/ftsizes.h',
110 'include/freetype/ftsnames.h',
111 'include/freetype/ftstroke.h',
112 'include/freetype/ftsynth.h',
113 'include/freetype/ftsystem.h',
114 'include/freetype/fttrigon.h',
115 'include/freetype/ftttdrv.h',
116 'include/freetype/fttypes.h',
117 'include/freetype/ftwinfnt.h',
118 'include/freetype/t1tables.h',
119 'include/freetype/ttnameid.h',
120 'include/freetype/tttables.h',
121 'include/freetype/tttags.h',
122 'include/freetype/ttunpat.h',
123 ]
124
125 ft_config_headers = [
126 'include/freetype/config/ftconfig.h',
127 'include/freetype/config/ftheader.h',
128 'include/freetype/config/ftmodule.h',
129 'include/freetype/config/ftoption.h',
130 'include/freetype/config/ftstdlib.h',
131 ]
132
133 if host_machine.system() == 'windows'
134 base_sources += [
135 'builds/windows/ftdebug.c',
136 ]
137 else
138 base_sources += [
139 'src/base/ftdebug.c',
140 ]
141 endif
142
143 c_args = [
144 '-DFT2_BUILD_LIBRARY',
145 '-DFT_CONFIG_CONFIG_H=<ftconfig.h>',
146 '-DFT_CONFIG_OPTIONS_H=<ftoption.h>'
147 ]
148
149 check_headers = []
150
151 if ['linux', 'darwin', 'cygwin'].contains(host_machine.system())
152 check_headers += [
153 ['unistd.h'],
154 ['fcntl.h'],
155 ['stdint.h'],
156 ]
157 ftconfig_h_in = files('builds/unix/ftconfig.h.in')
158 else
159 ftconfig_h_in = files('include/freetype/config/ftconfig.h')
160 endif
161
162 conf = configuration_data()
163 deps = []
164 incbase = include_directories(['include'])
165
166 foreach check : check_headers
167 name = check[0]
168
169 if cc.has_header(name)
170 conf.set('HAVE_@0@'.format(name.to_upper().underscorify()), 1)
171 endif
172 endforeach
173
174 configure_file(input: ftconfig_h_in,
175 output: 'ftconfig.h',
176 configuration: conf)
177
178 ft_config_headers += [configure_file(input: 'include/freetype/config/ftoption.h.in',
179 output: 'ftoption.h',
180 configuration: conf)]
181
182 libfreetype = static_library('freetype', base_sources,
183 include_directories: incbase,
184 dependencies: deps,
185 c_args: c_args,
186 gnu_symbol_visibility: 'inlineshidden',
187 )
188
189 freetype_dep = declare_dependency(
190 link_with: libfreetype,
191 include_directories : incbase,
192 dependencies: deps,
193 )