Skip to content

Commit 364e974

Browse files
committed
meson: Modernize the file and subproject handling
Require meson 0.55 to have proper subproject handling.
1 parent a5d24a8 commit 364e974

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

meson.build

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ project('vala-language-server', 'vala', 'c',
44
default_options: [
55
'default_library=static',
66
'c_std=gnu11' # for C subprojects
7-
]
7+
],
8+
meson_version: '>=0.55',
89
)
910

1011
valac = meson.get_compiler('vala')
11-
libvala_version = run_command(valac, '--api-version').stdout().strip()
12+
libvala_version = run_command(valac, '--api-version', check: true).stdout().strip()
1213
if not libvala_version.version_compare('>=0.48' )
1314
error('libvala needs to be 0.48 or above')
1415
endif
@@ -18,13 +19,7 @@ extra_vala_sources = []
1819
libvala = dependency('libvala-@0@'.format(libvala_version), version: '>= 0.48.12')
1920

2021
libgobject_dep = dependency('gobject-2.0')
21-
libjsonrpc_glib_dep = dependency('jsonrpc-glib-1.0', version: '>= 3.28', required: false)
22-
if not libjsonrpc_glib_dep.found()
23-
# don't use introspection with static library as it requires a recent version of GIR
24-
jsonrpc_glib = subproject('jsonrpc-glib', default_options: ['with_introspection=false'])
25-
libjsonrpc_glib_dep = jsonrpc_glib.get_variable('libjsonrpc_glib_dep')
26-
extra_vala_sources += files('vapi/jsonrpc-glib-1.0.vapi')
27-
endif
22+
libjsonrpc_glib_dep = dependency('jsonrpc-glib-1.0', version: '>= 3.28')
2823

2924
deps = [
3025
dependency('glib-2.0'),
@@ -37,6 +32,11 @@ deps = [
3732
valac.find_library('posix'),
3833
]
3934

35+
# Remove this once we can have a subproject using their own .vapi
36+
if libjsonrpc_glib_dep.type_name() == 'internal'
37+
deps += valac.find_library('jsonrpc-glib-1.0', dirs: meson.current_source_dir() / 'vapi')
38+
endif
39+
4040
if libjsonrpc_glib_dep.version() >= '3.30'
4141
add_project_arguments(['--define=WITH_JSONRPC_GLIB_3_30'], language: 'vala')
4242
endif

meson_options.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ option('active_parameter', type: 'boolean', value: false, description: 'Support
22
option('debug_mem', type: 'boolean', value: false, description: 'Debug memory usage')
33
option('builder_abi', type: 'string', value: 'auto', description: 'Builder ABI version. Use a value like \'3.38\'')
44
option('man_pages', type: 'feature', value: 'auto', description: 'Generate and install man pages.')
5-
option('tests', type: 'boolean', value: 'true', description: 'Build tests.')
5+
option('tests', type: 'boolean', value: true, description: 'Build tests.')

0 commit comments

Comments
 (0)