-
Notifications
You must be signed in to change notification settings - Fork 31
/
meson.build
120 lines (101 loc) · 3.11 KB
/
meson.build
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
project('gnome-calculator', ['c', 'vala'],
version: '48.alpha',
meson_version: '>= 0.57.0',
license: 'GPLv3+',
)
inc_rooth = include_directories ('.')
inc_rooth_dep = declare_dependency (include_directories : inc_rooth)
gnome = import('gnome')
i18n = import('i18n')
if get_option('development')
app_id = 'org.gnome.Calculator.Devel'
name_prefix = '(Nightly) '
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
version_suffix = '-@0@'.format (vcs_tag)
else
app_id = 'org.gnome.Calculator'
name_prefix = ''
version_suffix = ''
endif
# Some variables
libexec_dir = join_paths(get_option('prefix'), get_option('libexecdir'))
locale_dir = join_paths(get_option('prefix'), get_option('localedir'))
po_dir = join_paths(meson.project_source_root(), 'po')
gcalc_vapi_dir = join_paths(meson.current_source_dir(), 'vapi')
# Dependencies
glib_min_version = '2.40.0'
libsoup_min_version = '3.4.0'
gio = dependency('gio-2.0', version: '>= ' + glib_min_version)
glib = dependency('glib-2.0', version: '>= ' + glib_min_version)
gmodule_export = dependency('gmodule-export-2.0')
gobject = dependency('gobject-2.0', version: '>= ' + glib_min_version)
libxml = dependency('libxml-2.0')
libsoup = dependency('libsoup-3.0', version: '>= ' + libsoup_min_version)
gee = dependency('gee-0.8', version: '>= 0.20.0')
gobject_introspection = dependency('gobject-introspection-1.0', required: false)
introspection = not get_option('disable-introspection')
if not gobject_introspection.found()
introspection = false
endif
# Libraries
cc = meson.get_compiler('c')
valac = meson.get_compiler('vala')
libmath = cc.find_library('m')
searchpath = []
if get_option('libpath') != ''
searchpath += [get_option('libpath')]
endif
mpc = declare_dependency(
dependencies: [
cc.find_library('mpc', dirs: searchpath),
valac.find_library('mpc', dirs: gcalc_vapi_dir)
]
)
mpfr = declare_dependency(
dependencies: [
cc.find_library('mpfr', dirs: searchpath),
valac.find_library('mpfr', dirs: gcalc_vapi_dir)
]
)
posix = valac.find_library('posix')
# Configuration
conf = configuration_data()
conf.set_quoted('APP_ID', app_id)
conf.set_quoted('NAME_PREFIX', name_prefix)
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('LOCALE_DIR', locale_dir)
conf.set_quoted('VERSION', meson.project_version() + version_suffix)
conf.set10('DEVELOPMENT_BUILD', get_option('development'))
configure_file(output: 'config.h', configuration: conf)
config_h_dir = include_directories('.')
# Subdirs
subdir('po')
subdir('vapi')
subdir('libmpfr')
if get_option ('gcalc')
subdir('gcalc')
endif
if not get_option ('disable-ui')
gtk = dependency('gtk4', version: '>= 4.17.0')
if get_option('gci') and get_option('gcalc')
subdir('gci')
endif
if get_option('app')
# Extra scripts
gnome.post_install(
glib_compile_schemas: true,
gtk_update_icon_cache: true,
)
libadwaita = dependency('libadwaita-1', version: '>= 1.6.beta')
gtksourceview = dependency('gtksourceview-5', version: '>= 5.3.0')
subdir('data')
subdir('lib')
subdir('src')
subdir('search-provider')
subdir('help')
endif
endif
if get_option('doc')
subdir('doc')
endif
subdir('tests')