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
|
giscanner_files = [
'__init__.py',
'annotationmain.py',
'annotationparser.py',
'ast.py',
'cachestore.py',
'ccompiler.py',
'codegen.py',
'docmain.py',
'docwriter.py',
'dumper.py',
'introspectablepass.py',
'girparser.py',
'girwriter.py',
'gdumpparser.py',
'libtoolimporter.py',
'maintransformer.py',
'message.py',
'msvccompiler.py',
'pkgconfig.py',
'shlibs.py',
'scannermain.py',
'sectionparser.py',
'sourcescanner.py',
'testcodegen.py',
'transformer.py',
'utils.py',
'xmlwriter.py',
]
pkglibdir = join_paths(get_option('libdir'), meson.project_name())
giscannerdir = join_paths(pkglibdir, 'giscanner')
giscanner_built_files = []
giscanner_conf_data = configuration_data()
giscanner_conf_data.set('VERSION', meson.project_version())
giscanner_built_files += configure_file(input: '_version.py.in',
output: '_version.py',
install : true,
install_dir : giscannerdir,
configuration: giscanner_conf_data)
foreach f : giscanner_files
giscanner_built_files += configure_file(input : f, output : f,
install : true,
install_dir : giscannerdir,
configuration : giscanner_conf_data)
endforeach
install_subdir('doctemplates', install_dir: giscannerdir)
flex = find_program('flex', 'win_flex')
bison = find_program('bison', 'win_bison')
scannerparser = custom_target('scannerparser',
input: 'scannerparser.y',
output: ['scannerparser.c', 'scannerparser.h'],
command: [bison, '@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
)
scannerlexer = custom_target('scannerlexer',
input: 'scannerlexer.l',
output: 'scannerlexer.c',
command: [flex, '-o', '@OUTPUT@', '@INPUT@']
)
giscanner_args = []
if not cc.has_header('unistd.h')
giscanner_args += '-DYY_NO_UNISTD_H'
endif
giscanner_lib = static_library('giscanner',
sources: [
'sourcescanner.c',
scannerparser,
scannerlexer,
],
c_args: giscanner_args,
include_directories : configinc,
dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep],
)
giscanner_pymod = python.extension_module('_giscanner', ['giscannermodule.c'],
link_with: giscanner_lib,
c_args: [gi_hidden_visibility_cflags],
include_directories : configinc,
dependencies: [glib_dep, gobject_dep, gio_dep, gmodule_dep,
python.dependency()],
install: true,
install_dir: giscannerdir,
)
|