build: meson: check vapi prerequisites and allow autodetection
Turn the vapi option into a combo that allows autodetection and check whether all prerequisites are satisfied (including introspection support) when vapi is explicitly enabled. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/28
This commit is contained in:
25
meson.build
25
meson.build
@@ -711,11 +711,27 @@ auto_support_src = 'int main() { int a = 0; __auto_type b = a; return b + a; };'
|
|||||||
config_h.set10('_NM_CC_SUPPORT_AUTO_TYPE', cc.compiles(auto_support_src))
|
config_h.set10('_NM_CC_SUPPORT_AUTO_TYPE', cc.compiles(auto_support_src))
|
||||||
|
|
||||||
# Vala bindings
|
# Vala bindings
|
||||||
enable_vapi = get_option('vapi')
|
vapi_opt = get_option('vapi')
|
||||||
if enable_vapi
|
if vapi_opt == 'false'
|
||||||
|
enable_vapi = false
|
||||||
|
else
|
||||||
vala_req_version = '>= 0.17.1.24'
|
vala_req_version = '>= 0.17.1.24'
|
||||||
assert(add_languages('vala', required: false), 'vala is required to build. Use -Dvapi=false to disable it')
|
enable_vapi = true
|
||||||
assert(meson.get_compiler('vala').version().version_compare(vala_req_version), 'vala ' + vala_req_version + ' is required to build. Use -Dvapi=false to disable it')
|
|
||||||
|
if not enable_introspection
|
||||||
|
assert(vapi_opt != 'true', 'vala api require GObject introspection. Use -Dvapi=false to disable it')
|
||||||
|
enable_vapi = false
|
||||||
|
endif
|
||||||
|
|
||||||
|
if enable_vapi and not add_languages('vala', required: false)
|
||||||
|
assert(vapi_opt != 'true', 'vala is required to build. Use -Dvapi=false to disable it')
|
||||||
|
enable_vapi = false
|
||||||
|
endif
|
||||||
|
|
||||||
|
if enable_vapi and not meson.get_compiler('vala').version().version_compare(vala_req_version)
|
||||||
|
assert(vapi_opt != 'true', 'vala ' + vala_req_version + ' is required to build. Use -Dvapi=false to disable it')
|
||||||
|
enable_vapi = false
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Tests, utilities and documentation
|
# Tests, utilities and documentation
|
||||||
@@ -978,4 +994,5 @@ output += ' JSON validation for libnm: ' + enable_json_validation.to_string() +
|
|||||||
output += ' crypto: ' + crypto + ' (have-gnutls: ' + crypto_gnutls_dep.found().to_string() + ', have-nss: ' + crypto_nss_dep.found().to_string() + ')\n'
|
output += ' crypto: ' + crypto + ' (have-gnutls: ' + crypto_gnutls_dep.found().to_string() + ', have-nss: ' + crypto_nss_dep.found().to_string() + ')\n'
|
||||||
output += ' sanitizers: ' + get_option('b_sanitize') + '\n'
|
output += ' sanitizers: ' + get_option('b_sanitize') + '\n'
|
||||||
output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n'
|
output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n'
|
||||||
|
output += ' vapi: ' + enable_vapi.to_string() + '\n'
|
||||||
message(output)
|
message(output)
|
||||||
|
@@ -62,7 +62,7 @@ option('config_dhcp_default', type: 'combo', choices: ['dhcpcanon', 'dhclient',
|
|||||||
|
|
||||||
# miscellaneous
|
# miscellaneous
|
||||||
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
|
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
|
||||||
option('vapi', type: 'boolean', value: true, description: 'build Vala bindings')
|
option('vapi', type : 'combo', choices : ['auto', 'true', 'false'], description: 'build Vala bindings')
|
||||||
option('docs', type: 'boolean', value: false, description: 'use to build documentation')
|
option('docs', type: 'boolean', value: false, description: 'use to build documentation')
|
||||||
option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests')
|
option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests')
|
||||||
option('more_asserts', type: 'string', value: 'all', description: 'Enable more assertions for debugging (0 = none, 100 = all, default: all)')
|
option('more_asserts', type: 'string', value: 'all', description: 'Enable more assertions for debugging (0 = none, 100 = all, default: all)')
|
||||||
|
Reference in New Issue
Block a user