birb/birb

Prepare for the 0.1 release
v0.1
3 months ago, Gary Kramlich
79e5dc2cd3f4
Prepare for the 0.1 release

We didn't have a -dev tag in the extra version which is why it wasn't removed
in this commit.

Testing Done:
Ran `ninja turtles` and `ninja dist`.

Reviewed at https://reviews.imfreedom.org/r/2970/
project('birb', 'c',
version : '0.1.0',
meson_version : '>=1.0.0',
default_options : ['c_std=c17', 'warning_level=2'])
toplevel_inc = include_directories('.')
gnome = import('gnome')
pkgconfig = import('pkgconfig')
###############################################################################
# Versioning
###############################################################################
parts = meson.project_version().split('-')
if parts.length() > 1
extra = parts[1]
else
extra = ''
endif
parts = parts[0].split('.')
BIRB_MAJOR_VERSION = parts[0]
BIRB_MINOR_VERSION = parts[1]
BIRB_MICRO_VERSION = parts[2]
BIRB_LIB_VERSION = f'@BIRB_MAJOR_VERSION@.@BIRB_MINOR_VERSION@.@BIRB_MICRO_VERSION@'
version_config = configuration_data()
version_config.set('BIRB_MAJOR_VERSION', BIRB_MAJOR_VERSION)
version_config.set('BIRB_MINOR_VERSION', BIRB_MINOR_VERSION)
version_config.set('BIRB_MICRO_VERSION', BIRB_MICRO_VERSION)
version_config.set('BIRB_EXTRA_VERSION', extra)
version_config.set('BIRB_VERSION', meson.project_version())
###############################################################################
# Dependencies
###############################################################################
glib_dep = dependency('glib-2.0', version : '>=2.76.0')
gio_dep = dependency('gio-2.0')
gobject_dep = dependency('gobject-2.0')
add_project_arguments(
'-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_76',
'-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_76',
language : 'c',)
###############################################################################
# Internationalization
###############################################################################
GETTEXT_PACKAGE = 'birb'
LOCALE_DIR = get_option('prefix') / get_option('localedir')
add_project_arguments(f'-DLOCALEDIR="@LOCALE_DIR@"', language : 'c')
add_project_arguments(f'-DGETTEXT_PACKAGE="@GETTEXT_PACKAGE@"', language : 'c')
###############################################################################
# Documentation
###############################################################################
if get_option('doc') and not get_option('introspection')
error('Documentation requires GObject Introspection.')
endif
gidocgen_dep = dependency(
'gi-docgen', version: '>= 2023.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'
doc_targets = []
###############################################################################
# Sub directories
###############################################################################
subdir('birb')
subdir('po')
###############################################################################
# Custom Targets
###############################################################################
if meson.backend() == 'ninja'
run_target('turtles',
command : ['ninja', '-C', '@BUILD_ROOT@', 'birb-pot', 'all', 'test'])
endif
# This needs to be after all of the sub-directories have been processed.
if get_option('doc')
alias_target('doc', doc_targets)
endif
###############################################################################
# Summarize all the things!
###############################################################################
summary({
'prefix': get_option('prefix'),
'bindir': get_option('bindir'),
'libdir': get_option('libdir'),
'datadir': get_option('datadir'),
}, section : 'Directories')
summary({
'documentation': get_option('doc'),
'internationalization': get_option('nls'),
'introspection': get_option('introspection'),
}, section : 'Options')