summaryrefslogtreecommitdiff
path: root/giscanner/meson.build
blob: 963fad596c5ed41481289454fc8fb55c6eb864b8 (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
pkglibdir = join_paths(get_option('libdir'), meson.project_name())
giscannerdir = join_paths(pkglibdir, 'giscanner')
install_data([
  '__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',
  'shlibs.py',
  'scannermain.py',
  'sectionparser.py',
  'sourcescanner.py',
  'testcodegen.py',
  'transformer.py',
  'utils.py',
  'xmlwriter.py',
], install_dir: giscannerdir)

install_data([
  'collections/__init__.py',
  'collections/counter.py',
  'collections/ordereddict.py',
], install_dir: join_paths(giscannerdir, 'collections'))

install_subdir('doctemplates', install_dir: giscannerdir)

flex = find_program('flex')
bison = find_program('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,
  dependencies: gio_dep,
)

# TODO: -export-symbols-regex "init_giscanner|PyInit__giscanner"
giscanner_pymod = py3.extension_module('_giscanner', 'giscannermodule.c',
  link_with: giscanner_lib,
  dependencies: [
    gobject_dep,
    dependency('python3'),
  ],
  install: true,
  install_dir: giscannerdir,
)