Debian Codegraph @

lib/meson.build

raw
1
2 file_list_template = '''
3 from glob import glob
4 for f in sorted(glob('*.@0@', recursive=False)):
5 print(f)
6 '''
7
8 list_sources = file_list_template.format('c')
9 list_headers = file_list_template.format('h')
10
11 subdir('data')
12 subdir('fontconfig')
13 subdir('common')
14 subdir('gtk')
15 subdir('json')
16 subdir('ui')
17
18 src_includes = [
19 common_includes,
20 fontconfig_includes,
21 gtk_includes,
22 json_includes,
23 unicode_includes,
24 ]
25
26 includes += [ include_directories('.'), src_includes + data_includes ]
27
28 sources = [
29 common_sources,
30 fontconfig_sources,
31 gtk_sources,
32 json_sources,
33 unicode_sources
34 ]
35
36 headers = [
37 common_headers,
38 fontconfig_headers,
39 gtk_headers,
40 json_headers,
41 unicode_headers
42 ]
43
44 header = join_paths(meson.current_build_dir(), 'font-manager.h')
45
46 write_header = '''
47 from glob import glob
48 from os.path import basename
49
50 def filelist (ext):
51 for f in sorted(glob('@0@/*/*.{}*'.format(ext), recursive=True)):
52 yield f
53
54 with open('@1@', 'w') as H:
55 H.write('#pragma once\n')
56 for f in filelist('h'):
57 H.write('#include "{}"\n'.format(basename(f)))
58 '''.format(meson.current_source_dir(), header, meson.current_source_dir())
59
60 library_header_file = configure_file(
61 command: [python, '-c', write_header],
62 output: 'font-manager.h'
63 )
64
65 libfontmanager = shared_library('fontmanager',
66 sources: [ sources, headers, gresources ],
67 include_directories: includes,
68 version: meson.project_version(),
69 dependencies: base_deps,
70 install: true,
71 install_dir: pkglib_dir)
72
73 gir = gnome.generate_gir(libfontmanager,
74 sources: [ sources, headers ],
75 namespace: 'FontManager',
76 nsversion: meson.project_version(),
77 dependencies: base_deps,
78 extra_args: [ '--warn-all' ],
79 includes: [ 'Gtk-4.0', 'Json-1.0', 'libxml2-2.0' ]
80 )
81
82 configure_file(
83 input: 'font-manager.metadata',
84 output: 'FontManager-@[email protected]'.format(meson.project_version()),
85 copy: true
86 )
87
88 vapi = gnome.generate_vapi('font-manager',
89 sources: [ gir[0], 'font-manager.vala' ],
90 vapi_dirs: meson.current_build_dir(),
91 metadata_dirs: meson.current_source_dir(),
92 packages: [ 'gtk4', 'json-glib-1.0', 'libxml-2.0', 'sqlite3' ]
93 )
94
95 if get_option('gtk-doc')
96 subdir('docs')
97 endif
98