@@ -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
1011valac = 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()
1213if not libvala_version.version_compare(' >=0.48' )
1314 error (' libvala needs to be 0.48 or above' )
1415endif
@@ -18,13 +19,7 @@ extra_vala_sources = []
1819libvala = dependency (' libvala-@0@' .format(libvala_version), version : ' >= 0.48.12' )
1920
2021libgobject_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
2924deps = [
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+
4040if libjsonrpc_glib_dep.version() >= ' 3.30'
4141 add_project_arguments ([' --define=WITH_JSONRPC_GLIB_3_30' ], language : ' vala' )
4242endif
0 commit comments