meson: add 'nls' option to disable translations
authorTim-Philipp Müller <tim@centricular.com>
Sun, 20 May 2018 13:07:15 +0000 (14:07 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 20 May 2018 13:07:39 +0000 (14:07 +0100)
And enable by default. Was implicitly disabled because
ENABLE_NLS was not defined.

meson.build
meson_options.txt

index 0a6cff8..324495d 100644 (file)
@@ -77,6 +77,7 @@ cdata.set_quoted('PLUGINDIR', join_paths(get_option('prefix'), get_option('libdi
 cdata.set_quoted('VERSION', gst_version)
 # FIXME: --with-memory-alignment],[8,N,malloc,pagesize (default is 32)]) option
 cdata.set('MEMORY_ALIGNMENT_MALLOC', 1)
+cdata.set('ENABLE_NLS', get_option('nls'))
 cdata.set_quoted('GST_PLUGIN_SCANNER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-plugin-scanner'))
 cdata.set_quoted('GST_PTP_HELPER_INSTALLED', join_paths(prefix, helpers_install_dir, 'gst-ptp-helper'))
 cdata.set_quoted('GST_PLUGIN_SCANNER_SUBDIR', libexecdir,
@@ -473,7 +474,7 @@ subdir('tests')
 subdir('data')
 
 # xgettext is optional (on Windows for instance)
-if find_program('xgettext', required : false).found()
+if get_option('nls') and find_program('xgettext', required : false).found()
   subdir('po')
 endif
 
index 4dfb5a8..80da408 100644 (file)
@@ -18,6 +18,8 @@ option('gtkdoc', type : 'boolean', value : true, yield : true,
         description : 'Generate API documentation with gtk-doc')
 option('introspection', type : 'boolean', value : true, yield : true,
         description : 'Generate gobject-introspection bindings')
+option('nls', type : 'boolean', value : true, yield: true,
+        description : 'Enable native language support (translations)')
 option('package-name', type : 'string', yield : true,
        description : 'package name to use in plugins')
 option('package-origin', type : 'string', value : 'Unknown package origin', yield : true,