-
Notifications
You must be signed in to change notification settings - Fork 2
/
meson.build
120 lines (105 loc) · 3.63 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-notes', 'c',
version: '0.0.1',
meson_version: '>= 0.44.0',
license: 'GPL3+',
default_options: [
'c_std=gnu11',
'warning_level=1',
'buildtype=debugoptimized'
])
pkg_name = meson.project_name()
pkg_id = 'org.sadiqpk.notes'
pkg_version = meson.project_version()
pkg_is_debug = get_option('buildtype').startswith('debug')
pkg_prefix = get_option('prefix')
pkg_srcdir = meson.source_root()
pkg_builddir = meson.build_root()
pkg_libdir = join_paths(pkg_prefix, get_option('libdir'))
pkg_localedir = join_paths(pkg_prefix, get_option('localedir'))
pkg_datadir = join_paths(pkg_prefix, get_option('datadir'))
pkg_schemadir = join_paths(pkg_datadir, 'glib-2.0', 'schemas')
pkg_po_dir = join_paths(meson.source_root(), 'po')
top_inc = include_directories('.')
src_inc = include_directories('src')
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
cc = meson.get_compiler('c')
conf = configuration_data()
conf.set('ENABLE_TRACING', get_option('tracing'))
conf.set('NDEBUG', (not pkg_is_debug))
conf.set('G_DISABLE_ASSERT', (not pkg_is_debug))
conf.set('G_DISABLE_CAST_CHECKS', (not pkg_is_debug))
conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_VERSION', pkg_version)
conf.set_quoted('PACKAGE_BUGREPORT', 'https://sadiqpk.org/bugs')
conf.set_quoted('PACKAGE_NAME', meson.project_name())
conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_ID', pkg_id)
conf.set_quoted('PACKAGE_URL', '')
conf.set_quoted('PACKAGE_LOCALE_DIR', pkg_localedir)
common_flags = [
'-DHAVE_CONFIG_H',
'-D_FORTIFY_SOURCE=2'
]
add_global_arguments(common_flags, language: 'c')
c_link_args = cc.get_supported_arguments(
['-Wall',
'-Werror=format-security',
'-Werror=implicit-function-declaration',
'-fasynchronous-unwind-tables',
'-pipe',
])
pkg_dep = [
dependency('glib-2.0', version: '>= 2.56.0'),
dependency('gtk+-4.0', version: '>= 3.93.0'),
dependency('libxml-2.0'),
dependency('goa-1.0',),
dependency('libecal-1.2', version: '>= 3.18.0'),
dependency('libedataserver-1.2', version: '>= 3.18.0'),
]
configure_file(
output : 'config.h',
configuration : conf,
)
subdir('src')
subdir('data')
subdir('docs')
subdir('po')
subdir('tests')
if get_option('bash_completion')
subdir('completion')
endif
meson.add_install_script('build-aux/meson_post_install.py')
run_target('make-po',
command: [
find_program('build-aux/make_po.sh'),
meson.project_name(),
meson.current_build_dir(),
join_paths(pkg_srcdir, 'po')
])
run_target('make-help-po',
command: [
find_program('build-aux/make_po.sh'),
pkg_id,
meson.current_build_dir(),
join_paths(pkg_srcdir, 'docs/help'),
'help-',
'true'
])
system = host_machine.system()
if system == 'linux'
system = 'GNU/Linux'
endif
output = '\n ' + pkg_name + ' ' + pkg_version + '\n'
output += ' ==============================\n\n'
output += ' prefix: ' + pkg_prefix + '\n'
output += ' compiler: ' + cc.get_id() + ' ' + cc.version()+ '\n'
output += ' build type: ' + get_option('buildtype') + '\n'
output += ' host system: ' + system + '\n'
output += ' tracing: ' + get_option('tracing').to_string() + '\n'
output += ' manpage: ' + get_option('man').to_string() + '\n'
output += ' bash-completion: ' + get_option('bash_completion').to_string() + '\n'
output += ' Now type \'make\' to build ' + pkg_name + '\n'
message(output)