summaryrefslogtreecommitdiff
path: root/meson.build
blob: d22e008a35142b7c42941b82144ee68179d2e7d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
project('libsecret', 'c',
  version: '0.20.3',
  license: 'GPL2+',
  meson_version: '>= 0.50',
)

gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')

# API version
api_version = '1.0.0'
api_version_major = api_version.split('.')[0]
api_version_minor = api_version.split('.')[1]
api_version_micro = api_version.split('.')[2]

libtool_version = '0.0.0'

# Options
with_manpage = get_option('manpage')
with_gcrypt = get_option('gcrypt')
enable_debug = get_option('debugging')
with_vapi = get_option('vapi')
with_gtkdoc = get_option('gtk_doc')
with_gir = get_option('introspection')

# Some variables
config_h_dir = include_directories('.')
build_dir = include_directories('build')
libsecret_prefix = get_option('prefix')
datadir = get_option('datadir')
includedir = get_option('includedir')
bindir = get_option('bindir')
libdir = get_option('libdir')
libexecdir = get_option('libexecdir')
locale_dir = get_option('localedir')
pkgdatadir = datadir / meson.project_name()
pkglibdir = libdir / meson.project_name()
sysconfdir = get_option('sysconfdir')
po_dir = meson.source_root() / 'po'

# Dependencies
min_glib_version = '2.44'
glib_deps = [
  dependency('glib-2.0', version: '>=' + min_glib_version),
  dependency('gio-2.0', version: '>=' + min_glib_version),
  dependency('gio-unix-2.0', version: '>=' + min_glib_version),
]

min_libgcrypt_version = '1.2.2'
gcrypt_dep = dependency('libgcrypt', version: '>=' + min_libgcrypt_version,
			required: with_gcrypt)

# Libraries
math = meson.get_compiler('c').find_library('m')

# Configuration
conf = configuration_data()
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('G_LOG_DOMAIN', meson.project_name())
conf.set_quoted('LOCALEDIR', libsecret_prefix / locale_dir)
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE_STRING', meson.project_name())
conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set('WITH_GCRYPT', with_gcrypt)
if with_gcrypt
  conf.set_quoted('LIBGCRYPT_VERSION', min_libgcrypt_version)
endif
conf.set('WITH_DEBUG', enable_debug)
conf.set('_DEBUG', enable_debug)
conf.set('HAVE_MLOCK', meson.get_compiler('c').has_function('mlock'))
configure_file(output: 'config.h', configuration: conf)

# Test environment
test_env = environment()
test_env.set('abs_top_builddir', meson.build_root())

# Subfolders
subdir('po')
subdir('egg')
subdir('libsecret')
subdir('tool')
subdir('docs')