From 6513de27bb6962547bae859a52ffbb1385c4b018 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Wed, 6 Dec 2017 23:54:24 +0100 Subject: [PATCH] meson: add 'nls' option. Closes T6398 --- meson.build | 26 +++----------------- meson_options.txt | 6 ++++- po/meson.build | 62 +++++++++++++++++++++++++---------------------- 3 files changed, 41 insertions(+), 53 deletions(-) diff --git a/meson.build b/meson.build index 3e05a9bf..6d66ee88 100644 --- a/meson.build +++ b/meson.build @@ -59,26 +59,9 @@ terminology_dependencies = [] edje_cc_path = '' edj_targets = [] edj_files = [] -use_translations = false -intl_lib = cc.find_library('intl', required: false) -if intl_lib.found() - config_data.set('HAVE_GETTEXT', 1) - config_data.set('ENABLE_NLS', 1) - terminology_dependencies += [intl_lib] - use_translations = true -else - gettext_code = ''' - #include - int main(int argc, char *argv[]) { - (void)ngettext("", "", 0); - return 0; - } - ''' - if cc.links(gettext_code) - config_data.set('HAVE_GETTEXT', 1) - config_data.set('ENABLE_NLS', 1) - use_translations = true - endif + +if get_option('nls') == true + subdir('po') endif foreach efl_dep: efl_deps @@ -137,9 +120,6 @@ configure_file(input: join_paths('pkgbuild', 'PKGBUILD.in'), config_dir = include_directories('.') subdir('data') subdir('man') -if use_translations - subdir('po') -endif subdir('src/bin') meson.add_install_script('meson_install_themes.sh', edj_files) diff --git a/meson_options.txt b/meson_options.txt index 6b6b04a0..ad5e3c23 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,4 +4,8 @@ option('edje-cc', option('fuzzing', type: 'boolean', value: false, - description: 'Enable fuzzing on terminology. Binaries are not suited for production.') + description: 'Enable fuzzing on terminology. Binaries are not suited for production. (default=false)') +option('nls', + type: 'boolean', + value: true, + description: 'enable localization: (default=true)') diff --git a/po/meson.build b/po/meson.build index 6cb74692..498bbb18 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,29 +1,33 @@ -i18n = import('i18n') -i18n.gettext('terminology', - languages: [ - 'ca', - 'de', - 'el', - 'eo', - 'es', - 'fi', - 'fr', - 'hi', - 'it', - 'ko', - 'ms', - 'sl', - 'sr', - 'tr', - 'vi' - ], - args: [ - '--keyword=_', - '--keyword=d_:1', - '--keyword=P_:1,2', - '--keyword=dP_:1,2', - '--keyword=N_', - '--keyword=NP_:1,2', - '--from-code=UTF-8', - '--foreign-user' - ]) +if get_option('nls') + i18n = import('i18n') + i18n.gettext('terminology', + languages: [ + 'ca', + 'de', + 'el', + 'eo', + 'es', + 'fi', + 'fr', + 'hi', + 'it', + 'ko', + 'ms', + 'sl', + 'sr', + 'tr', + 'vi' + ], + args: [ + '--keyword=_', + '--keyword=d_:1', + '--keyword=P_:1,2', + '--keyword=dP_:1,2', + '--keyword=N_', + '--keyword=NP_:1,2', + '--from-code=UTF-8', + '--foreign-user' + ]) + config_data.set('HAVE_GETTEXT', '1') + config_data.set('ENABLE_NLS', '1') +endif