############################################################################### ############################################################################### license : 'LGPL-2.0-or-later', meson_version : '>=0.56.0', default_options : ['c_std=c99', 'warning_level=2']) parts = meson.project_version().split('-') parts = parts[0].split('.') GPLUGIN_MAJOR_VERSION = parts[0] version_conf = configuration_data() version_conf.set('GPLUGIN_MAJOR_VERSION', GPLUGIN_MAJOR_VERSION) version_conf.set('GPLUGIN_MINOR_VERSION', parts[1]) version_conf.set('GPLUGIN_MICRO_VERSION', parts[2]) version_conf.set('GPLUGIN_EXTRA_VERSION', extra) version_conf.set('GPLUGIN_VERSION', meson.project_version()) ############################################################################### ############################################################################### pkgconfig = import('pkgconfig') if get_option('help2man') help2man = find_program('help2man') GLIB = dependency('glib-2.0', version : '>=2.70.0') GOBJECT = dependency('gobject-2.0') # we separate gmodule out so our test aren't linked to it GMODULE = dependency('gmodule-2.0') '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_70', '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_70', ############################################################################### # This sets up the meson devenv stuff. See # https://mesonbuild.com/Commands.html#devenv for more information. ############################################################################### if meson.version().version_compare('>=0.58.0') config_home = get_option('devenv-config-dir') config_home = meson.project_build_root() / 'config' devenv.set('XDG_CONFIG_HOME', config_home) ############################################################################### ############################################################################### GETTEXT_PACKAGE = 'gplugin' LOCALE_DIR = get_option('prefix') / get_option('localedir') add_project_arguments('-DLOCALEDIR="@0@"'.format(LOCALE_DIR), language : 'c') add_project_arguments('-DGETTEXT_PACKAGE="@0@"'.format(GETTEXT_PACKAGE), ############################################################################### ############################################################################### compiler = meson.get_compiler('c') '-DPREFIX="@0@"'.format(get_option('prefix')), '-DLIBDIR="@0@"'.format(get_option('libdir')), '-DGPLUGIN_WEBSITE="https://keep.imfreedom.org/gplugin/gplugin"', if compiler.has_argument('-Wformat') add_project_arguments('-Wformat', language : 'c') if compiler.has_multi_arguments(['-Wformat', '-Werror=format-security']) add_project_arguments('-Werror=format-security', language : 'c') toplevel_inc = include_directories('.') ############################################################################### ############################################################################### if get_option('doc') and not get_option('introspection') error('Documentation requires GObject Introspection.') gidocgen_dep = dependency( 'gi-docgen', version: '>= 2021.1', fallback: ['gi-docgen', 'dummy_dep'], required: get_option('doc') gidocgen = find_program('gi-docgen', required : get_option('doc')) docs_dir = get_option('prefix') / get_option('datadir') / 'doc' ############################################################################### ############################################################################### subdir('gplugin-gtk3-viewer') subdir('gplugin-gtk4-viewer') doc_targets = [gplugin_doc] doc_targets += gplugin_gtk3_doc doc_targets += gplugin_gtk4_doc alias_target('doc', doc_targets) ############################################################################### ############################################################################### install_data('ChangeLog', 'INSTALL.md', 'README.md', 'HACKING.md', install_dir : get_option('datadir') / 'doc' / 'gplugin') 'api reference' : get_option('doc'), 'GTK3 widgets' : get_option('gtk3'), 'GTK4 widgets' : GTK4.found(), 'man pages' : get_option('help2man'), }, bool_yn : true, section : 'Miscellaneous') 'introspection' : get_option('introspection'), 'vapi' : get_option('vapi'), }, bool_yn : true, section : 'Bindings')