This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmeson.build
executable file
·72 lines (60 loc) · 1.99 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
project('com.github.nahuelwexd.GtkValaTemplate', 'vala', 'c',
version: '0.1.0',
license: 'MIT',
meson_version: '>= 0.50.0',
default_options: ['warning_level=2'],
)
# Defines the gettext package. Required to use gettext.
add_project_arguments('-DGETTEXT_PACKAGE=@0@'.format(meson.project_name()),
language: 'c',
)
# Add additional runtime checks in Vala. Improves type safety in C.
add_project_arguments('--enable-checking',
language: 'vala',
)
# Check the profile for this build
if get_option('profile') == 'development'
profile = '.Devel'
add_project_arguments('-D', 'DEVEL',
language: 'vala'
)
else
profile = ''
endif
# Define global variables
gnome = import('gnome')
i18n = import('i18n')
prefix = get_option('prefix')
datadir = prefix / get_option('datadir')
localedir = prefix / get_option('localedir')
# Define the app metadata
app_id = '@0@@1@'.format(meson.project_name(), profile)
project_website = 'https://github.com/nahuelwexd/GTK-Vala-Template'
resource_path = '/com/github/nahuelwexd/GtkValaTemplate'
version = '@0@-@VCS_TAG@'.format(meson.project_version())
gettext_package = meson.project_name()
# Generate a header with the metadata
config_h = configuration_data()
config_h.set_quoted('APP_ID', app_id)
config_h.set_quoted('PROJECT_WEBSITE', project_website)
config_h.set_quoted('RESOURCE_PATH', resource_path)
config_h.set_quoted('VERSION', version)
config_h.set_quoted('GETTEXT_PACKAGE', gettext_package)
config_h.set_quoted('LOCALEDIR', localedir)
config_h_in = configure_file(
output: 'config.h.in',
configuration: config_h,
)
vcs_tag(
command: ['git', 'rev-parse', '--short', 'HEAD'],
fallback: get_option('profile') != 'default' ? 'devel' : 'stable',
input: config_h_in,
output: 'config.h',
)
confinc = include_directories('.')
# Subdirectories
subdir('data')
subdir('src')
subdir('po')
# Post install script
meson.add_install_script('build-aux/meson/post-install.py')