diff options
-rw-r--r-- | meson.build | 25 | ||||
-rw-r--r-- | meson_options.txt | 2 |
2 files changed, 22 insertions, 5 deletions
diff --git a/meson.build b/meson.build index 239e6744b6..2850d75a9d 100644 --- a/meson.build +++ b/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)) # Vala bindings -enable_vapi = get_option('vapi') -if enable_vapi +vapi_opt = get_option('vapi') +if vapi_opt == 'false' + enable_vapi = false +else vala_req_version = '>= 0.17.1.24' - assert(add_languages('vala', required: false), 'vala is required to build. Use -Dvapi=false to disable it') - 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') + enable_vapi = true + + 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 # 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 += ' sanitizers: ' + get_option('b_sanitize') + '\n' output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n' +output += ' vapi: ' + enable_vapi.to_string() + '\n' message(output) diff --git a/meson_options.txt b/meson_options.txt index ee205601c3..1e7f886d27 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -62,7 +62,7 @@ option('config_dhcp_default', type: 'combo', choices: ['dhcpcanon', 'dhclient', # miscellaneous 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('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)') |