-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathmeson.build
84 lines (68 loc) · 2.57 KB
/
meson.build
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
project('vala-language-server', 'vala', 'c',
version: '0.48.7',
license: 'LGPL2.1+',
default_options: [
'default_library=static',
'c_std=gnu11' # for C subprojects
]
)
valac = meson.get_compiler('vala')
libvala_version = run_command(valac, '--api-version').stdout().strip()
if not libvala_version.version_compare('>=0.48' )
error('libvala needs to be 0.48 or above')
endif
extra_vala_sources = []
libvala = dependency('libvala-@0@'.format(libvala_version), version: '>= 0.48.12')
libgobject_dep = dependency('gobject-2.0')
libjsonrpc_glib_dep = dependency('jsonrpc-glib-1.0', version: '>= 3.28', required: false)
if not libjsonrpc_glib_dep.found()
# don't use introspection with static library as it requires a recent version of GIR
jsonrpc_glib = subproject('jsonrpc-glib', default_options: ['with_introspection=false'])
libjsonrpc_glib_dep = jsonrpc_glib.get_variable('libjsonrpc_glib_dep')
extra_vala_sources += files('vapi/jsonrpc-glib-1.0.vapi')
endif
deps = [
dependency('glib-2.0'),
libgobject_dep,
dependency('gio-2.0'),
dependency('gee-0.8'),
dependency('json-glib-1.0'),
libjsonrpc_glib_dep,
libvala,
valac.find_library('posix'),
]
if libjsonrpc_glib_dep.version() >= '3.30'
add_project_arguments(['--define=WITH_JSONRPC_GLIB_3_30'], language: 'vala')
endif
# let Vala add the appropriate defines for GLIB_X_X
add_project_arguments(['--target-glib=auto'], language: 'vala')
if get_option('debug_mem')
libgobject_list_proj = subproject('gobject-list-prince781')
deps += libgobject_list_proj.get_variable('libgobject_list_dep')
endif
conf = configuration_data()
conf.set('LIBVALA_VERSION', libvala.version())
conf.set('PROJECT_BUGSITE', 'https://github.com/vala-lang/vala-language-server/issues')
conf.set('PROJECT_NAME', meson.project_name())
conf_file = configure_file(input: 'config.vala.in',
output: 'config.vala',
configuration: conf)
version_file = vcs_tag(input: 'version.vala.in',
output: 'version.vala',
command: ['git', 'describe', '--tags', '--dirty'])
add_project_arguments(['--enable-gobject-tracing', '--fatal-warnings'], language: 'vala')
extra_vala_sources += files([
'src/util.vala'
])
if host_machine.system() == 'windows'
deps += dependency('gio-windows-2.0')
extra_vala_sources += files(['src/windows.vapi'])
add_project_arguments(['--define=WINDOWS'], language: 'vala')
else
deps += dependency('gio-unix-2.0')
endif
subdir('data')
subdir('src')
if get_option('tests')
subdir('test')
endif